Colour cloud via external shader(& rainbow rehash)

Started by bigben, July 06, 2012, 08:41:56 PM

Previous topic - Next topic

Dune

Your sophisticated approach is bearing fruit, Ben. This is going  to be very good!

bigben

Thanks.  I think I've almost got the primary rainbow nailed and the other components should be pretty straightforward after that.  I know of a few limitations, mostly relating to adjusting the distance from the camera but that's mostly just a matter of convenience. Make it work first, then worry about making it practical   ;)

bigben

OK, this is pretty much the final model for the primary rainbow. The image shows the maximum possible density of the entire rainbow, with the density shader of the cloud replaced with a constant colour (white of course). Yes there isn't much orange, but usually the rainbow won't be at full intensity, in which case there.

I had to do a test render of this as previous test showed that the rainbow can go white if a ray has to pass through too much cloud. This model uses a fixed cloud depth of 5000m on the secondary planet to control the maximum thickness.

Planning the connections for tweaking/animating and hiding the rest of the complex node network.
Inputs:

  • Colour adjust node to connect the density shader of the cloud(s)  used for rain (used to tweak density/intensity) of  the rainbow)
  • (optional) Constant scalar used as a multiplier of the rainbow density
  • Secondary planet will need to be visible in node network to match position of planet to camera and to set the distance from the camera of the rainbow (via the planet diameter)
  • Colour adjust node for setting the range of brightening inside the rainbow (20° in this image, but will be changed to provide 100% and then tweaked by this shader)
  • Constant scalar for relative intensity of secondary rainbow compared to the primary

Outputs:
  • Mask to modify density shader of rain (cut out/reduce density of rain where it will be replaced by/combined with the rainbow)
  • Surface shader for use as a preview on the terrain surface to see the position of the rainbow in preview window with the atmosphere turned off. (I found this useful for composition)

Dune



bigben

#20
Running a test render now of a double rainbow.  I digressed a bit by trying my original method of adding some base density to the colour masks. Better saturation of colours (perhaps even too good) but it suffered from banding at low densities.  This method is the best compromise I've found so far between colour and smoothness at low mask density. 

There is still one problem I have yet to deal with... distance from the camera.  My original idea was to set the cloud thickness to a fixed thickness (5000m) and fixed altitude (2500m) and then adjust the radius of the secondary planet to change the distance from the camera (the camera is in the center of the planet).  I started building with a planet with a radius of 1m and when I adjusted the planet radius and cloud altitude I got a hefty drop in density.  I suspect there's some other atmosphere settings affecting the density of clouds according to their altitude. Will have to read up on that later.

bigben

Close but no banana yet...  Secondary rainbow @ 50-53° radius, density = 0.3x primary rainbow
Something's wrong in the yellow (probably my error) and the low density violet end also looks too dark.  I might try extending the outer back scatter lightening into the violet end of the rainbow to lighten it up, although this should really be tested in situ with surrounding rain.

bigben

Doing a bit more homework, read Matt's helpful post on ray tracing.  This looks like a candidate for "ray trace everything".  Seems to improve rendering speed and improve noise.  Detail's only 0.35 for this test and rendering time seems to be more even across the different areas.  With ray trace everything turned off the areas outside of the masked rainbow render very quickly but the rainbow renders VERY slowly.


Oshyan

Raytrace Atmosphere should give you any benefits of reduced noise that you're seeing, while not incuring the raytraced terrain slowdown issues you're seeing. At least I think that should be true...

- Oshyan

bigben

I actually had ray trace atmospheres checked previously but in this case I think I underestimated the impact of the changes I had made to the masks.  Just for interest I loaded both into Photoshop, set the top layer to difference and then applied an extreme levels adjustment to see the difference.  There are small differences in the atmosphere, although on visual inspection this seems to be more a case of differing noise patterns.  The latter image looks a little smoother in the atmosphere but that's very subjective.

The terrain is another story but I was just doing a quick test without tweaking any of the other settings.

Tangled-Universe

The terrain looks crappy because of the ray detail multiplier setting.
Go inside your rendernode and open the "render subdiv" node. Inside you'll see the ray detail multiplier set to 0.25.
This means that for ray traced elements like water transparency and terrain the detail setting will be multiplied by 0.25.
That's the reason the terrain looks worse than expected and is also the reason why, by default, underwater features look triangulated.
Increase it to 0.5 or 0.7 and see if it is more to your liking. You can set it to 1 max, of course, but be aware rendertimes increase.

edit: I'm wondering if this multiplier also affects RTA?

For RTA it's difficult to determine the settings and it requires good understanding of the pixel sampler.
It's good to know how many samples you require for a 'smooth' result without RTA.
If it's a huge amount (hundreds of samples)  then you likely need to make good use of the adaptive AA pixel sampler and relatively higher AA.
Be aware that in case of RTE it also affects your terrain.
So like Oshyan said, if you feel exploring raytracing the atmosphere then go for RTA instead of RTE.

bigben

Thanks for the explanation.  I was aware of the settings you mentioned but now I know where they are   ;)
Almost there with the gradient on the secondary rainbow but the wider variation of  width in the bands is proving challenging

bigben

Left a render running last night.  To some extent the render settings are important in this model, since I've been tweaking mask gradients and densities to try and keep things as smooth as possible.  Some of the problems I was trying to fix early on weren't actually problems at higher detail settings.
Increasing the AA to 8 (with Detail 0.35) made a very smooth rainbow in the atmosphere, but the low detail in the terrain increased where the terrain and rainbow overlap.  This one is Detail 0.5, AA8