Jakub Trávník's resources

Trávník's smooth self-referential formula - Renderer Program and Optimization

Go back to main page on Trávník's smooth self-referential formula. Go back to Program and Sources.

How to use Renderer Program

Minimal Java version to use this is Java 8. You can use later versions for this. It should work, but I have not tested it.

There are scripts run.sh and run.bat that assist with running the standalone renderer. They expect one parameter: a filename with job file. The job file describes what should be rendered (output PNG image file name, there are several formulas to choose from, saving interval, pixel width of output image, a view coordinates, a render coordinates, subpixel shifts and the arguments to the rendering formula like the big number N).

There are lot of examples in files ending with "-job.txt". You can run them with run.bat / run.sh scripts. For all of them there is already an output image present so you can just view output image without running the job. If you would like to run the job, delete the output image first. If image is present, the render job will try to complete it (it uses transparent pixels to mark incomplete parts) so if there is completed image it does nothing (even if you change some parameters of job). You can load an incomplete image into a image viewer or some editors (that do not lock the image file) while computation is running but as the image file is being rewritten every minute or so you may run into case where this happens during loading so loading would fail in some way. You may have better chance to load big images with backup file ending ".previous.png" while computation is running.

Details on format of job files are described in text file "renderjob-notes.txt" that is also a part of distribution.

Rendering optimization

In provided sources for rendering formula there are two Java implementations of the formula: SelfFormula and SelfFormulaFast. The SelfFormula is as close as possible to the displayed formula above. The SelfFormulaFast contains several optimizations that significantly improve runtime, however they produce same results.

Optimization in SelfFormulaFast:

I have tested that both SelfFormula and SelfFormulaFast produce same output. See directory "self-formula-slow" for two outputs (image files are identical byte for byte) produced by two implementations. The slow one was running for a week on my computer, the fast was took about 10 seconds.

Go back to main page on Trávník's smooth self-referential formula. Go back to Program and Sources.

Back to index - Jakub Trávník's resources.