I’ve been spending some time learning a few aspects of the engine, that all kind of came together in this little fractal shader example.
The fractal shader code I adapted from http://hirnsohle.de/test/fractalLab/.
The example is written in angelscript, the shader in glsl. Also, it is perpetually a work in progress. It employs several elements provided by the engine that might be useful for learning purposes other than just the shader. Like saving and loading a file, and building a specific type of gui ( more involved than the gui example, and less involved than the editor gui code ). I think that it would be super cool to include in the engine as an example… but I fear that the fractal shader license might prohibit that. however, it’s here otherwise.
As, well I’m not sure the best way to post this information…
It’s part of a repository i maintain that also houses a few other experimental things ( which I am happy to share as well ). So for now, I will just list the relevant files to this specific file.
Where to get the files:
Here is the repo: https://github.com/ghidra/urho_research
fractal_settings holds the “bookmark” files. A save file of settings. There are 4 currently saved.
I have a launch script that I run from the root of that repo. Totally optional, but I find it useful. the shell script is this:
if [ $# -eq 0 ]; then echo "what script should i run?"; else /PATH_TO_URHO/bin/Urho3DPlayer /Scripts/$1.as -pp /PATH_TO_URHO/bin -p "CoreData;Data;Research"; fi
It requires that you have a “Resource” directory next to Data and CoreData, or remove that from the script. You can then run this like:
sh launch.sh fractal
P - toggle parameter pane
F - toggle fullscreen (fullscreen will be slow)
F1-F10 - save bookmarks
1-0 - load bookmarks
Shift - camera speed * 0.01
Ctrl - camera speed *0.01
Alt - camera speed *0.01
(Shift-Ctrl-Alt stack to make the camera move super slow, you’ll notice why)
Just some notes:
I’ll probably spend some time to make more preset bookmarks
Might do some extra work on the gui to be able to type in a value next to the slider
There are a few more shader attributes that I need to expose (having issues using int uniforms as iterators)