Rainbow

Started by bigben, February 26, 2008, 06:50:49 pm

Previous topic - Next topic

j meyer

Thanks nikita,going to try that. :)

bigben

There may be some merit in this, but the main problem I can see to begin with is that the rainbow appears as a dark band when shaded from the sun when it should actually disappear.  This has given me a few ideas which might be worth pursuing though...

bigben

November 06, 2008, 07:20:53 am #62 Last Edit: November 06, 2008, 07:22:56 am by bigben
I'm pleased to say that I've made some substantial progress with this.  I went back to an earlier version and tried an alternative simplification of the cloud layer.

I now have it down to a single cloud layer using the same masks but rearranged in a slightly different way. 

A lot of the noise was due to the settings in the cloud fractal resulting in a low number of cloud samples even though the quality was set high.  Cloud samples now set to 64 and it's nice and smooth.

The main change has been in the building of the cloud mask. Rather than use 3 cloud layers (Red, Green and Blue) I built the rainbow colour first, added it to a surface shader and set the blending shader for this to the cloud fractal (which in turn is masked by distance restrictions to limit the depth of the rainbow).  The cloud colour is now white, and set to 100, so it still behaves correctly in shadows.

This makes the colour much more predictable, and simplifies the process of constructing composite rainbows. The secondary colours also stand up to fading much better.

The biggest advantage is in the improved render times which is pretty exciting.  The sample below took only 20 minutes with detail 1, AA 4, no GI (no acceleration in the cloud node).  For the previous versions this would have taken up to a day to render.  The screengrab shows the simplified cloud network. Everything else is pretty much the same.  The rainbow travels with the camera, with the only input required being the sun's heading and elevation, which can be easily scripted in an animation.

Now I just have to fix up the mixing of colours in the rainbow to suit the output of the new model.

Mohawk20

Howgh!

dandelO

The best yet, this looks great. Well done on your perseverance with this!

rcallicotte

I agree.  This is the best implementation so far.
So this is Disney World.  Can we live here?

bigben

Left my usb stick at home so the morning's train trip was about getting this rainbow to the next stage. I downloaded a picture of a rainbow and calculated the positions of the primary and secondary colours to give a better distribution of colours.  On a surface preview it's pretty accurate, but on a cloud the amount/gradation of secondary colours depends on what's behind the rainbow.  A little more experimentation with cloud settings to go for that one.  The other tweak was an improvement (simplification) of the cloud model.

The network looks quite complicated but there are very few nodes that actually control input and output, so most of it can be hidden internally.

Required controls

  • Sun heading

  • Sun elevation

  • 2 distance shaders limit the depth of the rainbow

  • Output of rainbow

  • Output of rainbow depth (-> Blending shader for cloud fractal)



Everything else is calculated on the camera's position (i.e. it moves like a real rainbow)

Optional controls

  • Strength of secondary rainbow

  • Strength of inner lightening (inside primary and outside secondary rainbows)


Mohawk20

Good to see you on this again. Hope you get to finish it soon.
Howgh!