Thu, Nov 28, 4:24 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 28 11:20 am)



Subject: Adjustable background sphere gradient shader


IsaoShi ( ) posted Sat, 30 May 2009 at 8:49 PM · edited Sat, 02 November 2024 at 12:45 PM

file_431914.jpg

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)


IsaoShi ( ) posted Sat, 30 May 2009 at 8:50 PM

file_431915.txt

The attachment is a compressed single material file (mz5) that you save anywhere in your Runtime/Libaries/Materials folder, deleting the .txt file extension. I'll post a 91x91px PNG thumbnail for it in a minute.

 

For those not familiar with applying materials to an object, this is what you do. Load and select your EnvSphere or hi res sphere, open the Material Room, find the shader where you saved it in your Library Materials folder, and double-click it. The shader will load into the sphere material, and you'll see the four control nodes top centre.

 

If using a hi res sphere, scale it up to 180,000% (for the benefit of those who use a comma instead of a decimal point, that's one hundred and eighty thousand percent). This makes it nearly 750ft radius. Untick the "Casts shadows" option in the Properties palette. Do not use the render option "Remove backfacing polys", or you won't see it in your render. You wouldn't need to worry about this stuff if you used bagginsbill's EnvSphere.

 

Thumbnail 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)


IsaoShi ( ) posted Sat, 30 May 2009 at 8:51 PM

file_431916.png

Thumbnail... enjoy. I'm off to bed now... nite.

"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)


hborre ( ) posted Sat, 30 May 2009 at 9:59 PM

Nice work!  This is definitely worth playing with.  I wonder what you get when applying BB's GenIBL.  Thanks.  Awfully nice of you to share your creation.


pakled ( ) posted Sat, 30 May 2009 at 10:03 PM

..always another way - the Keymaker

I wish I'd said that.. The Staircase Wit

anahl nathrak uth vas betude doth yel dyenvey..;)


LukeA ( ) posted Sun, 31 May 2009 at 1:01 AM

Cool thanks for sharing :)

 

LukeA

My latest novel


infinity10 ( ) posted Sun, 31 May 2009 at 1:12 AM

 Nice one.  

Eternal Hobbyist

 


Latexluv ( ) posted Sun, 31 May 2009 at 1:16 AM

Thanks so much!

"A lonely climber walks a tightrope to where dreams are born and never die!" - Billy Thorpe, song: Edge of Madness, album: East of Eden's Gate

Weapons of choice:

Poser Pro 2012, SR2, Paintshop Pro 8

 

 


shedofjoy ( ) posted Sun, 31 May 2009 at 4:25 AM

nice idea, gonna have a play with this... thankyou

Getting old and still making "art" without soiling myself, now that's success.


IsaoShi ( ) posted Sun, 31 May 2009 at 5:28 AM · edited Sun, 31 May 2009 at 5:30 AM

Quote - Nice work!  This is definitely worth playing with.  I wonder what you get when applying BB's GenIBL.  Thanks.  Awfully nice of you to share your creation.

Thanks for your vote, everyone!

hborre: Well, the chosen colours quickly become very strong above and below the transition near the horizon, otherwise it would be not so much a gradient as more or less a single shade. Also there would be no horizontal contrast at all. So I don't think it would be much use as an environment for the GenIBL tool, except possibly for some psychedelic lighting effects!

"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)


RobynsVeil ( ) posted Sun, 31 May 2009 at 5:55 AM

Well done, IsaoShi! Totally cool - can't wait to try it. I've been roped into doing some digistamp renders for some of the other girls in the house (who make greeting cards - cool, Poser does crossover!) but as soon as they're happy, I'm definitely going to have a play with this!

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


artdude41 ( ) posted Sun, 31 May 2009 at 6:15 AM

thanks for this . extremely useful


mathman ( ) posted Sun, 31 May 2009 at 9:24 AM

Thanks IsaoShi, you're a champion !


lesbentley ( ) posted Mon, 01 June 2009 at 8:54 PM

Thanks IsaoShi. This should be very useful!


IsaoShi ( ) posted Tue, 02 June 2009 at 3:46 AM

First things first -- you have to go see bagginsbill's new Clouds background shader. That's really something. Puts my little toy in the shade!

Anyway, I applied my toy shader to a curved background prop that came with a light set that I bought (in my early Poser days) and it came out upside down. I had to invert the gradient and set the V-Pos to around 4.0 to get the transition in the right place on that background prop.

I haven't tried it on a standard hi res square yet.

To flip the gradient, just bypass the math subtract node that inverts the "V-Texture-Coordinate" node. I'm going to add another parameter to control this.

Okay, okay, I admit it.... I just enjoy playing with nodes.

"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)


RobynsVeil ( ) posted Tue, 02 June 2009 at 7:37 AM

So do I, IsaoShi! Except with me, it's become an unhealthy obsession.

Your note about applying your shader to a curved background prop going upside down made me think of this:
www.runtimedna.com/forum/showthread.php

He's so smart, that BagginsBill!

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.