rgb values and LWF

hi all

how do you guys deal with rgb values out of e.g. photoshop to LWF in max?
I mean the values from 0-255 in max doesn’t match the values out of any app, when working in LWF, it would get brighter (gamma corrected). how do I get the right values? is there a workaround or a trick to match the exact values?

best regards
themaxxer

You’d need to apply the inverse gamma correction to the colors (e.g. raise each color component to the power 1/2.2).

Best regards,
Vlado

The vray colour map has a gamma setting so you can copy and paste your photoshop values into the colour swatch then use the gamma spinner to tell vray what gamma to apply - after that it’s a case of getting your exposure correct to make sure your colour doesn’t burn out.

thanks for answers.

but the vraycolor doesn’t change anything. what gammacorrection do I have to apply? 2.2 or 0.455?

best regards
themaxxer

I wrote this little app to do just what your asking:

http://www.six4one.com/index.php?option=com\_remository&Itemid=26&func=fileinfo&id=38

Just feed it the rgb values and it converts them to gamma 2.2.

As a direct answer to your question, 2.2. But you will also need the “gamma correction” type set to “specify” and you will have to put the color to the slot again after that has been changed. Usually once I set it, it becomes set for any others I create in my scene thereafter.

EDIT: Did you know that using these settings will also wash out your grayscale values and procedural maps as well? You will notice the shift most promenantly in gradients, and the only way I have found to fix it is by using the ColorCorrect tool which affects the complete operation of the gradient, rather than just the input colors. If you find yourself having to drastically increase bump values in order for your textures to show up, this is probably exactly what is happening to you.

I think what the maxer is saying and my understanding of the vray colour, is that the gamma settings don’t actually change the colour values in any way except in how they are displayed. The Gamma settings in vray colour are pretty useless it appears (I hope I’m wrong…), I thought it would apply the gamma but it doesn’t appear that it does. It’s not really documented either.
So you still have to do a conversion with colour correct or a gamma colour correction script to get 2.2 adjusted colours :confused:

Maybe they can change this or add a map to apply gamma in a future version.. Vlado?

yes, It’s exactly as you say.

double agree. i switched back to the color correct plug-in within a day.

I to had a try with the gamma 2.2 settings it appears alright in max but when i opened it in photoshop its was al to dark. is there something i missed?? whe still work with max6 at my wrokplace so maybe thats the problem??

did you render with max FB or vray Framebuffer?
if you rendered with MFB then did you saved the image with gamma 2.2?
in the save dialog you have to check “Override” and put in 2.2 for gamma. then it should appear right.

best regards themaxxer

You could just make a little bitmap with the desired color and apply it to the geometry.

how do you guys deal with rgb values out of e.g. photoshop to LWF in max?
I mean the values from 0-255 in max doesn’t match the values out of any app, when working in LWF, it would get brighter (gamma corrected). how do I get the right values? is there a workaround or a trick to match the exact values?

Sorry I’m a bit late on this one but this can be done with the VRayColor map if you follow these steps.

1. Put a VRayColor map in the diffuse slot.
2. Enter your photoshop RGB values into VRayColor.
3. Set gamma correction to ‘specify’.
4. Type 0.4545 into gamma value.
5. Right click over the VrayColor chip (see diagram) and select ‘copy’.

6. Go back up to the top level of your material and right click over the diffuse colour chip and select ‘paste’.
7. Go to the Maps section of the material and untick the diffuse map.

You now have the corrected colour in the diffuse slot of your material!

Does that fix the problem or have I completely misunderstood the problem, again.

Dan

Yes that does work, I use a script that does a similar thing with fewer clicks. good tip though.

…and the name of this script is? :slight_smile:

best regards
themaxxer

I agree with Dan, its the same as I do it. Although a script that helps would be nice!?

I’ve always done it the way DanBrew does it - i thought this was the intension of this feature.

I get the same result without all of the extra steps :wink: :

1. Set the VRayColor to Specify, Gamma to 2.2, then input your RGB value. Just leave this in the diffuse slot, top level or not.

If you use the other method for more than one color in a session, you will have to set the Gamma back to 1.0 before putting in your next RGB value. This is because it seems that the VRayColor map is smart and will make the .4545 adjustment to all existing VRayColor maps as well as any subsequently created…which leads me to believe that it has further use than as a simple color calculator.

I just tried this again as it definitely did not work in the past, the specify value would not return up the stack. it appears this is working in the latest release, happy days.

Maxer here is the script, I don’t remember where I got it from.

fn calculate_gamma inColSpn outColSpn gammaVal = (
    outColSpn.color.r = 255.0 * ((inColSpn.color.r/ 255.0) ^ gammaVal)
    outColSpn.color.g = 255.0 * ((inColSpn.color.g/ 255.0) ^ gammaVal)
    outColSpn.color.b = 255.0 * ((inColSpn.color.b/ 255.0) ^ gammaVal)
)

rollout gamma_corrector “Gamma Color Corrector” width:340 height:40
(
    colorPicker cp1 “Pick RGB” pos:[8,8] height:24 fieldWidth:48 color:orange modal:false
    spinner spn1 “Gamma” pos:[110,12] height:16 range:[0,100,2.2] fieldwidth:48
    colorPicker cp2 “Corrected RGB” pos:[210,8] height:24 enabled:true fieldWidth:48 modal:false

on gamma_corrector open do
    (
        calculate_gamma cp1 cp2 spn1.value
    )
    on cp1 changed col do
    (
        calculate_gamma cp1 cp2 spn1.value
    )
    on spn1 changed val do
    (
        calculate_gamma cp1 cp2 spn1.value
    )
    on cp2 changed col do
    (
        calculate_gamma cp1 cp2 spn1.value
    )
)

createdialog gamma_corrector

very interesting thread. thanks for the ideas and scripts. :slight_smile:

best regards
themaxxer