This patch adds volume rendering to OpenCL split kernel.
Depends on D2299.
What is the reason for adding tmp_rng and state_shadow globals? As far as I can tell they don't contain any state that is passed between kernels, so I would expect them to just be stored on the stack. Is this for working around address space mismatches?
There seem to be some indentation mismatches here and in other places.
Not sure it's worth adding a function for this, it's only used in one place so could have this code inline.
@surgey, This was renderered from your file with no changes on AMD Firepro W9100 16GB GDDR5 with windows 10 64 build.
Donr run linux so cant so 100% this is just a Nvdia issue without trying the same on linux build but would say 99% sure it's nvidia related
Did some quick tests, doesn't seem to be working.
On AMD OpenCL volume absorption is working correctly, but scattering doesn't work at all. Subsurface scattering sort of works, but has shading artifacts.
On Nvidia OpenCL, 90% of the time nothing renders, which is very odd. The other 10% of the time anything with a volume or subsurface shader renders black.
Is there something missing from these patches to make them work correctly?
Did some more testing with this scene:
The test has three cubes: left is subsurface scattering, middle is absorption, right is volume scatting.
Rendered in three different configurations: CPU, GPU with transparent shadows, GPU no transparent shadows
Same cubes and settings but from inside the volume scattering cube.
Its close, but we need all configurations to match CPU before we can accept these patches.
Volume scattering doesn't work due to NO_TRANSPARENT_SHADOWS.
We will need to force enable transparent shadows if volumes are used then.
Subsurface scattering works ok when using a single program - all kernels in one file.
Not sure why this would be, do you have an explanation or a fix?