3D fractals demo


#1

Lately I was playing with raymarching and 3d-fractals. I came up with the method to optimize raymarching and implemented it in Urho. I also added volumetric light scattering for point and spot lights. Taking from this demo: blog.mmacklin.com/2010/05/29/in-scattering-demo/ and using some ugly hackery to make it work with finite attenuation lights (it uses inverse square fore light attenuation ).

Requires modern GPU.

Screenshots and download:
bananaft.itch.io/yedomaglobula

Follow me: https://twitter.com/Bananaft



Volumetric Rendering
#2

Looks freaking amazing man. Reminds me of those ShaderToy fractal demos.
Any chance to get the C++ source code or is it all done in shader code?
Edit: Found the code in Angelscript.


#3

super cool.
The lights look great. Are you also building collision objects for that character to stand on?

I did some similar work a while ago… but I never took it as far as you have:
topic1682.html


#4

nice, I love fractals


#5

I like the lighting effect. Awesome demo.


#6

Thank you all for feedback. So it actually works :slight_smile:. Forgot to ask, I really want to know what hardware you have and what performance you are getting?

My go to source.

With this project I’ve made my first baby steps in C++. Whole raymarching thing is purely glsl and renderpath.xml. But I had to disable Z-culling for light volumes, to make them work with raymarching result. Also I passed couple additional shader parameters for light scattering of spotlights. That’s like 5-6 lines changed.

No, I just placed him there :slight_smile:. I haven’t tried collisions yet, but I will. Mesh is not an option, I have to calculate SDF for collisions either on GPU or CPU, both ways seems terrible. CPU will require to write code twice, keep it same, and may still give different results (in theory). GPU has problems with bringing information back to CPU to update objects.


#7

I wonder if a Linux version can be built. :-/


#8

just put the linux binary player in the folder and run it.
it works partially, I experimented somes bugs…


#9

Here is my fork and all the changes.


#10

Very nice demo !

Do you think you could make a pull request in Urho3D master branch for adding this volumetric effect support to point and spot lights ? That would be awesome.


#11

Hi, sorry for long reply.

I never did a pull requests, might use an assistance, and my coding style is a bit savage.

Also, it works easily only with deferred lighting, other modes will need an additional light volumes pass, witch is not cool.
Plus, this light scattering should somehow interact with fog, and trying to resolve this will rise many complicated questions.


#12

The new version features four different fractals, smoother lights scattering, cubemap sky and colored ambient occlusion, and some more minor tweaks.


#13

So cool…
Unfortunately the misspelling of a certain resource prevents me from pouring the submarine some tea.


#14

What do you mean? Is there an error, it won’t load or something?


#15

Yea, it’s looking for a Teapot where there only is a TeaPot.


#16

So you’ve built Linux binary from my brunch? How does it work? What GPU do you have?


#17

I ran the game.as with a natively built Urho3D player. It’s a simple naming issue fixed by changing line 234 of game.as from:

tpObject.model = cache.GetResource("Model","Models/Teapot.mdl");

to:

tpObject.model = cache.GetResource("Model", "Models/TeaPot.mdl");

…damned alternative spellings. :stuck_out_tongue_winking_eye: