Forum: Poser - OFFICIAL


Subject: Adjustable background sphere gradient shader

IsaoShi opened this issue on May 30, 2009 · 16 posts


IsaoShi posted Sat, 30 May 2009 at 8:49 PM

Who wants a simple-to-adjust, two-colour procedural background gradient shader for use on a skydome in Poser 5/6/7/Pro? Well, I did. And just in case anyone else does, here it is.

 

The above demo pictures are worth quite a few words, but I'll explain a bit more anyway.

 

I use bagginsbill's EnvSphere as a background in my Poser startup scene. If I'm not using a spherical panoramic image on this, I like to use a simple two-colour gradient, combined with a shadow- and AO-catcher on the ground plane. It renders very fast and looks much better than a plain background.

 

But I found I needed an easy way to adjust the gradient to suit different camera angles and focal lengths, without rotating the sphere, and without having to keep fiddling with maths nodes in the Material Room.

 

So, partly as a learning exercise and partly for practical use, I decided to make my own adjustable gradient shader.

(Someone may well have done this before, but if so I haven't seen it; and anyway that's not important.)

I need hardly mention that my ability to make a shader even this simple is due entirely to bagginsbill's incredible knowledge and his passion to teach others. Thanks, bb!

 

The gradient shader has four parameter nodes:-

 

PM:Spread - controls the vertical spread of the gradient. Adjust Value_1 from 0 (shallow) to 1 (deep) to suit camera focal length. The actual value has no significance.

PM:V-Pos - controls the vertical position of the gradient mid-point in relation to the horizon. Adjust Value_1 from -5 to +5 to suit camera tilt angle. Again, the actual value has no significance.

PM:Intensity - controls the brightness. Adjust Value_1 from 0 to 1. Depending on the colours you chose for the gradient you might be able to go higher than 1, but watch out for colour shifts due to RGB channel clipping.

PMC:Colours - sets the two colours used for the gradient. Top=top and bottom=bottom.

 

Anyone who uses bagginsbill's Parmatic will know that they can control the three PM: nodes from the sphere's Parameters palette in the Pose Room (see piccy). These nodes are also clearly labelled in the Material Room Advanced view. The colours are selected in the Material Room, as I think it's preferable to pick these colours visually. Also, the balance between the two colours you pick may affect the gradient, and you can check this visually on the PoserSurface before rendering.

 

I made this shader in Poser Pro with gamma correction switched off. In Poser 7 it gave almost identical results, as I expected. I didn't build any gamma correction into the shader, but I'll do that if anyone really really wants me to. The gradients render very nicely in Poser Pro with GC switched on.

 

My next exercise is to write the Matmatic script that will generate this shader; but I'm still negotiating the green slopes of that black mountain!

Well, that's it. I hope someone finds it useful. Shader file coming up...

"If I were a shadow, I know I wouldn't like to be half of what I should be."
Mr Otsuka, the old black tomcat in Kafka on the Shore (Haruki Murakami)