Page 1 of 3

Volumetrics / Ray Marching

PostPosted: Wednesday, 14.May 2014, 16:59
by Skinnytorus
Hi there,
I wonder if there is a potential to do Volumetrics / Ray marching stuff in wz4. On one hand we have all sorts of density fields (ADF, SDF, PDF) and no proper way to render their effect... Maybe a volumetric material modulated by a 3d texture or something?... Any ideas?

Re: Volumetrics / Ray Marching

PostPosted: Wednesday, 14.May 2014, 17:32
by ikam
it seems complicated :p, I never done this kind of thing.

Re: Volumetrics / Ray Marching

PostPosted: Wednesday, 14.May 2014, 17:37
by Skinnytorus

Re: Volumetrics / Ray Marching

PostPosted: Wednesday, 14.May 2014, 17:50
by Skinnytorus
OK. Then maybe a basic fog material modulated by a 3d noise texture? I don't see any way to modulate fog for now...

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 06:43
by ikam
I found into the deep of wz4 code, a piece of code (commented) that seems destined to display adf as rendernode.
Code seems correct but it mess the 'ops' (script code that define operators) part.

I'll try to do someting with that, maybe it could be a first step.

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 07:07
by Skinnytorus
Cool. Was that the last remmed out part of adf.cpp?

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 07:40
by ikam
yes, the RNRenderADF code

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 08:10
by Skinnytorus
There are pointers to MakeRay and TraceRay functions necessary for raymarching. Any success yet?

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 08:46
by ikam
I successfully write the operator and bind it to the RNRenderADF code and it runs correctly but it display nothing except a big box colored at edges.
All interesting render stuff is made by the associated shader in file adf_shader.asc, there is some part of code disabled and some errors, I need to works on this part to get something usefull...

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 08:51
by Skinnytorus
OK. Good luck there!

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 10:39
by ikam
Ok I pushed on github a restored version of the RenderADF code with its new operator.
It render an adf volume (fromMesh ADF) but need some tweaks to do something better, and for now I don't see cleary what we can do with that...

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 11:04
by Skinnytorus
Yeah... Not much. Besides, It blacks out the rest of the scene and makes other meshes transparent... As if it didn't do a z-buffer check...

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 11:55
by ikam
at worst, we can use it for debugging adf volumes as this render is better than the default previewer for adf operators :)

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 12:29
by Skinnytorus
OK. I wonder if fog material can be modulated by texture. That would be great! :)

Re: Volumetrics / Ray Marching

PostPosted: Thursday, 15.May 2014, 14:17
by ikam
you mean something like that (2nd example) ?

I prefer the particles volume (first example)