Mon, Sep 9, 7:22 AM CDT

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Sep 09 6:38 am)



Subject: Help needed with Poser5 shaders


compiler ( ) posted Sun, 29 August 2004 at 3:17 PM · edited Mon, 29 July 2024 at 1:14 AM

Thanks for having a look. Here are my problems : 1- the "user_define" node outputs a color from numeric value. I use it in HSL mode (I expect it is Hue Saturation Luminosity). What is the correspondance between Poser usual color box (where all these 3 values are noted from 1 to 240) and this node (where these value appear to be noted from 0 to 1) ? I tried the linear method (1/240), but to no avail. 2- is there a way to do the reverse of the "user_define" node ? I mean : entering a color and getting its values for Hue Saturation Luminosity (which would make my first question pointless for the use I'm planning). Thanks in advance for your answers or hints.


stemardue ( ) posted Sun, 29 August 2004 at 4:13 PM

Attached Link: http://www.utm.edu/%7Emharvey/MathFunctions/Powers.html

don't know if this can help, but it's worth a look!


stemardue ( ) posted Sun, 29 August 2004 at 4:36 PM

file_125605.jpg

... actually it seems to work as you expected... This is how i set it up for a quick and efficient use


stemardue ( ) posted Sun, 29 August 2004 at 4:39 PM

Be careful tho, set the 'value 2' parameter of the math function nodes to something different to 0 BEFORE selecting Divide as function, or else a really stupid bug in poser would freeze the whole program (it apparently can't manage a division by zero error...)


compiler ( ) posted Sun, 29 August 2004 at 5:01 PM

Thanks for answering my first question, stemardue. What I was trying to do was entering the value manually which, for some reason, doesn't work. Your shader works all right. (and dividing by 0 doesn't freeze my Poser5. Which version are you on ?) Now, for my second question, is there a way to extract the Hue Saturation Luminosity values from a given color ? I read all the site you pointed to above, but it seems math functions cannot give the answer I seek...


stemardue ( ) posted Sun, 29 August 2004 at 5:14 PM

is there a way to extract the Hue Saturation Luminosity values from a given color ? I don't know any in bare poser other than reading em in the color palette, but maybe there is some variable in Python to get those values from a given texture/picture. In photoshop you can see them in the 'info' palette just mousing over a pic, but i don't know if this can help you. Oh, btw i'm using P5 SR4 in win98 (maybe OS is the key of my freezing problems)


Ajax ( ) posted Sun, 29 August 2004 at 5:21 PM

If you look at your colour in Photoshop or a similar app you can find out what the HSL values should be. I don't know of a way to do it in the material room. What exactly are you trying to do? If you just want one colour, you'd be better off with the simple colour node. You can set the colour using HSL in that if you want. The advantage of using the user defined node is that you can use mathematical operations as inputs for the RGB/HSL values to make the colour vary across 3D space. With RGB you can use the component node to extract the individual R, G and B values and pass them to other nodes, but there doesn't seem to be an HSL equivalent. Stewer might know one.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


compiler ( ) posted Sun, 29 August 2004 at 5:31 PM

Attached Link: http://www.renderosity.com/messages.ez?ForumID=12355&Form.ShowMessage=1906697

What I'm trying to achieve is to set several colors at once. I want to set the color in a single "simple color" node, then extract its HSL values, modify the S and L value so that I'll have lighter or darker tones of the same color to plug into a color ramp. The final goal is explained in the thread below : http://www.renderosity.com/messages.ez?ForumID=12355&Form.ShowMessage=1906697 I have tried to multiply the base color by different shades of grey, but it gives of a greyish look to the color, whereas I want it just darker or lighter.


stemardue ( ) posted Sun, 29 August 2004 at 5:58 PM

add the greytones in the L channel instead of multiplying! I think that might solve it...


Ajax ( ) posted Mon, 30 August 2004 at 3:57 AM

file_125606.jpg

I can't help you on using HSL with the nodes, but here's a way you may not have tried for darkening a colour without making it look grey. Basically, I'm making the colour darker by multiplying it by itself. You could also try subtracting a shade of grey from it, but if you do that then some of the RGB values are likely to wind up below zero. You can run them through a clamp to stop that, but chances are you'll still wind up with things that aren't quite what you were after. Could be worth trying though.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


compiler ( ) posted Mon, 30 August 2004 at 11:10 AM

Multiplying the color by itself is a great idea ! But I don't understand the nodes plugged into the color ramp's input plug. Can you tell me what their function is ?


compiler ( ) posted Mon, 30 August 2004 at 3:26 PM

I've tried this technique, and it works great for dark to medium dark colors. For bright colors, however, it returns an equally bright color, and hasn't the suitable contrast. The search continues... Thanks for all your ideas. Please keep on sending them.


Ajax ( ) posted Mon, 30 August 2004 at 4:31 PM

Yeah, makes sense that it wouldn't work too well for bright colours. Hmmm. Maybe you could use the brightness of the colour to set the value of the power you raise it to. The diffuse node creates normal diffuse shading, just like what you get when you set the diffuse colour of the root node. The difference is that you can use the diffuse node as input for other nodes and process it. Since I've set the diffuse colour to white, the output can be though of as a number between zero and one (it's actually a grey RGB colour between black and white). I multiply it by 4, round it and divide by 4 to get four shades that will show on the model in the appropriate places according to the lights in the scene. It's a similar approach to using a specular node to tell you where the shades should be on the model.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


compiler ( ) posted Tue, 31 August 2004 at 10:41 AM

In fact, what I'm trying to do is reducing the luminosity of the brightest colors. So I'm experimenting with combining your shader above with mine : multiplying by a small amount of grey the powered color. The brighter the color, the higher the amount of grey. But, in turn, this doesn't work too wel for darker colors. I'm not giving up...


diolma ( ) posted Tue, 31 August 2004 at 4:49 PM

Attached Link: http://www.easyrgb.com/math.php?MATH=M18

Dunno if this'll help or not, but I googled it: (BTW - "to google" is now an officially recognised word:-]). Got this from the attached link..- I leave it to you wizards to work out the nodes required:-).... RGB to HLS: var_R = ( R / 255 ) //RGB values = From 0 to 255 var_G = ( G / 255 ) var_B = ( B / 255 ) var_Min = min( var_R, var_G, var_B ) //Min. value of RGB var_Max = max( var_R, var_G, var_B ) //Max. value of RGB del_Max = var_Max - var_Min //Delta RGB value L = ( var_Max + var_Min ) / 2 if ( del_Max == 0 ) //This is a gray, no chroma... { H = 0 //HSL results = From 0 to 1 S = 0 } else //Chromatic data... { if ( L < 0.5 ) S = del_Max / ( var_Max + var_Min ) else S = del_Max / ( 2 - var_Max - var_Min ) del_R = ( ( ( var_Max - var_R ) / 6 ) + ( del_Max / 2 ) ) / del_Max del_G = ( ( ( var_Max - var_G ) / 6 ) + ( del_Max / 2 ) ) / del_Max del_B = ( ( ( var_Max - var_B ) / 6 ) + ( del_Max / 2 ) ) / del_Max if ( var_R == var_Max ) H = del_B - del_G else if ( var_G == var_Max ) H = ( 1 / 3 ) + del_R - del_B else if ( var_B == var_Max ) H = ( 2 / 3 ) + del_G - del_R if ( H < 0 ) ; H += 1 if ( H > 1 ) ; H -= 1 } Cheers, Diolma



diolma ( ) posted Tue, 31 August 2004 at 4:56 PM

Oh - and good luck!!



Ajax ( ) posted Tue, 31 August 2004 at 7:02 PM

Urrggghhh. I could certainly do that with nodes, but it's a lot of nodes. When you get that many, the material room slows down to an irritating extent.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


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.