New Gamma Correction Tool!


#81

Yea, your shaders are bad ass. They work great. I use them quite frequently. But sometimes I don’t use them so then a generalized solution to the gamma problem is nice. :slight_smile:


#82

Redsand,

cool you like my idea. I have updated the showEditor.mel script with your newest release.
I improved it a bit further to make it less buggy.

I will improve the maya interface implementation over time now. :slight_smile:
Hope you dont mind if I use your script as a base for it.

Anyway, thanks for your great script. :wink:

showEditor.mel (right click save)

:bounce:


#83

Once again thank you for this script Red. I have a question though, I recently tried playing around with fur to create grass and noticed that the script does not gamma correct these, is there a specific reason for this? Not a huge problem just wondering :slight_smile:


#84

I don’t use Maya fur that much in my work so I never tested any of those shaders. I can probably add support for those if it would come in handy.


#85

Fixes and feature requests added:

  1. fur shaders now supported.

  2. fixed an error in direct select mode where if nothing was selected an error was thrown. now it’s caught with a warning.

  3. added better, more informative feedback messages. should make it easier for the user to troubleshoot any problems.

  4. gamma nodes will now be named according to the shader and attribute slot they are connected to. example: gamma node connected to blinn1.color will be named blinn1_color instead of gammaCorrect1 or whatever. should make it easier to figure out which node is which in the hypershade.

Let me know if you run into any bugs.

Thanks,

Justin


#86

Woah… That was quick. Thanks a lot for all your effort and hard work in this script :).


#87

I found a little bug … I cant run it with the last updated … it gives me the following error every time that I tried to update selected materials or not even when I create a new scene it happens as well … OSX 10.6.6 Maya 2011 SP1

Error: Unknown object type: FurDescription


#88

I’ll investigate and see what the deal is. Should be an easy fix.

EDIT

It should be fixed now. Same name and version number as before.


#89

I’ve only just discovered you had made this tool Justin !
:surprised

I’ll be trying it out this week, sounds like it’s working well :cool:


#90

A question:

Your script does not apply gamma correction if the color is black/white. Doesn´t this lead to inconsistencies? For example, if I have a texture map where certain parts have a value of 0 or 255, those wont look the same as when I use a color swatch with 0 or 255, because that swatch wont be gamma corrected, like the texture. If this is correct, wouldn´t it be better to just apply a correction node, even with values of 0 and 255?


#91

Gamma corrections don’t affect the black (0.0) or white (1.0) point of an image. If you open up Photoshop paint a bit of black (0) and white (255) paint and then apply a gamma correction to it, the black and white values won’t change.

So ultimately it makes no difference if you add a gamma correction to a constant colour which is either pure black or pure white.


#92

ditto…
observe the following.

Pure black and pure white values aren’t going to shift, it’s the middle values that will change the most.


#93

Aha, I see, cool :slight_smile:


#94

Thank you, this is really helpfull


#95

great stuff! using this script so much!
is it possible to get a version that handles utility nodes as the colour input?
eg a blendColors node or anything else?


#96

Glad it has been helping you out. There is a way to do just that. That is what the direct select mode is for. It does work a little bit differently, though. Here is what you do: With the tool in direct select mode select the blend color node and hit the ‘gamma correct selected’ button. This will pop a gamma correct node directly after the blend color node. If you then want to remove that later, with the tool in direct select mode, just select the gamma node itself and hit the ‘removed selected’ button. This was my workaround to handle these sorts of situations.

I would like to point out one other thing about this script that might get overlooked and may come in handy for certain work flows. There has been some debate about the best approach to a linear work flow not just in mr for maya, but a linear work flow in general. One that is software agnostic and will work across many different applications. Some people suggest saving all file textures as linear to begin with and then not worry about managing values inside the 3D application. I think this is a great approach and makes total sense to me.

This script can assist in that sort of a workflow as well, and here’s how. I built an option into the script that would allow the user to either gamma correct file textures only, or color swatches only. Over time ‘color swatches’ evolved into ‘everything else besides file textures.’ I never altered the name of the radio button to reflect this however. So if you wanted to use the workflow where you have all your file textures saved as linear, but you decided that you wanted to use procedural textures for some things, or you still needed to gamma correct your light shaders, or you wanted to do something else I haven’t thought of, you can put the script in color swatches only mode and you do not have to worry about it inserting gamma correct nodes on your file textures. This way both your file textures and your procedural textures are correct.

If anyone has any thoughts or concerns I’m open to suggestions.

Thanks,

Justin


#97

Hey Justin,

Thanks for the reply.
I was working with the script without the GUI, so it would just assign gamma nodes to all shaders and i’ve implemented it into another script i’ve written for scene setup at my work.
I have tried the direct select and that works perfectly, but yeh was hoping for an interface free method.
So i was going through the script and its quite large that I can’t seem to locate where it only assigns to .outColor and ignore other inputs.
My example was blendColors node which has output of “blendNode.output” to “blinn.color.”
This connection is a rgb connection too but can’t for the life of my work out how to make it work automatically.


#98

Just updated the script to fix a minor bug for Maya 2012. Previously certain light shaders would not receive gamma correction. That has been fixed and all lights shaders should be supported for Maya 2012.

-Justin


#99

Does this work with Vray also?


#100

No, unfortunately not. I would like to add support for it at some point in the future, not sure exactly when that will happen though.

-Justin