hey mrboni i tried to implement the gpugems3
the funny thing is that is kind of old (but nevertheless amazing)
but therefore he uses a lot of fragmentshader that I was not able to puzzle together correctly.
Even if it is HSLS there is a lot of semantics that I didnt encounter before in my vvvv HLSL learnings.
Also I had some problems reading the c++ program code that uses all the fragment shaders.
@tekcor - ah balls, didn’t realise it was GLSL. Just noticed it was made in 2007! Fair play. The thing that really interests me in it is generating complex mesh data with fairly simple density functions
@Vux, I’m primarily interested in being able to procedurally generate animated volume fields that relate to sound input, and visualise those and many ways including as geometry, or particle emitters/forces
in iter you calculate the position of the closest object.
By having this minimal distance you assume you can safely advance your ray from this distance (this is not always true). When distance is under a certain value you assume that you “hit” the object.
As color I just return iteration count, it useful for some other aspects but if you want to color and shade you need to compute normals at intersection point (there’s heap load of doc about it), it’s more or less a gradient function.
Once you have normals you can shade with any light equation you want.
Using abs and % is a domain repetition function. Not too simple to explain, but basically you convolute your ray to fit in a smaller domain. For a lot of useful functions (bend/twist/transform), you generally modify your ray a instead of your object itself.