haggi
09-06-2009, 07:05 AM
Hi,
I'm fighting with my volume shader and intersections.
So I have some questions for which I could not find an answer in the manuals.
a) what exactly are volume samples good for? I think I understand the concept of sampling where qmc distributed samples are taken
for a pixel and then filtered to the final result. But what is different here for volume shaders?
b) my volume shader works with autovolume only and different settings for volume samples does not have any influence at all. Why?
c) how can intersections handled correctly in a raymarcher volume? In my shader I do the following:
- step from "org" along the "dir" Vector until I reach the "state->dist" limit.
- accumulate density
- calculate color based on density
With autovolume functions I do the following:
- if currentShader == 0 what means the first shader in an intersection, then calculate the result and save it in userColor
- if currentShader != 0 then calculate the result based on userColor and save it again in userColor
This way only the results of the single intersections can be mixed. But what if I have a density function that needs to be evaluated more often like this one:
http://www.wiki.render3d.de/doku.php?id=renderwiki:shaderlib:mr:hkvolumeshader :problems
As you can see, there is a problem as the volumes start to intersect.
It seems that my concept of calculating volumes is not the right one. Does anyone have an idea how I can solve these problems. There seems to be a way because the maya fluids are
able to handle these problems very well. And they work without autovolume and they react to a change in the volume samples. Seems there is a different concept of calculating volumes here.
Any ideas?
Thanks a lot for any hints.
I'm fighting with my volume shader and intersections.
So I have some questions for which I could not find an answer in the manuals.
a) what exactly are volume samples good for? I think I understand the concept of sampling where qmc distributed samples are taken
for a pixel and then filtered to the final result. But what is different here for volume shaders?
b) my volume shader works with autovolume only and different settings for volume samples does not have any influence at all. Why?
c) how can intersections handled correctly in a raymarcher volume? In my shader I do the following:
- step from "org" along the "dir" Vector until I reach the "state->dist" limit.
- accumulate density
- calculate color based on density
With autovolume functions I do the following:
- if currentShader == 0 what means the first shader in an intersection, then calculate the result and save it in userColor
- if currentShader != 0 then calculate the result based on userColor and save it again in userColor
This way only the results of the single intersections can be mixed. But what if I have a density function that needs to be evaluated more often like this one:
http://www.wiki.render3d.de/doku.php?id=renderwiki:shaderlib:mr:hkvolumeshader :problems
As you can see, there is a problem as the volumes start to intersect.
It seems that my concept of calculating volumes is not the right one. Does anyone have an idea how I can solve these problems. There seems to be a way because the maya fluids are
able to handle these problems very well. And they work without autovolume and they react to a change in the volume samples. Seems there is a different concept of calculating volumes here.
Any ideas?
Thanks a lot for any hints.