Set gamma default for linear workflow

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  01 January 2013
Set gamma default for linear workflow

So I'm always creating new Gamma Correct nodes for my shaders, and every time I have to change it to a gamma of 0.454

I never (or at least rarely) use the gamma correct node for anything else, so it would be really handy to have it just pop up as 0.454 by default.

I looked through the shaders in %Maya Folder%/mentalray/include/ and found mayabase.mi which has this section:

# Gamma Correct  #  
declare shader
  	struct {
  		vector		"outValue"
  	} "maya_gamma" (
  		vector		"value",
  		vector		"gamma"
  	version	1
  end declare

Which seems to be the declaration for the Gamma Correct utility node. However, changing the line
vector "gamma"

vector "gamma" default 0.454 0.454 0.454

does nothing after reloading Maya. What am I missing?
  01 January 2013
Don't know why it's not working, but you can just make a shelf button:

$gamNode = `shadingNode -asUtility gammaCorrect`;
setAttr ($gamNode + ".gammaX") 0.454;
setAttr ($gamNode + ".gammaY") 0.454;
setAttr ($gamNode + ".gammaZ") 0.454;

Or search for JJJ Gamma Tools by Justin Jenkis which automatically updates all color swatches or selected ones. Useful tool.
Demo Reel 2012-13!
  01 January 2013
I think that the correct syntax would be:

vector "gamma" #: default 0.454 0.454 0.454
  01 January 2013
Originally Posted by newguy4life: Don't know why it's not working, but you can just make a shelf button:

Button works great!

Dug around a bit and found this, too.

Section 5.1 has the declaration for mip_gamma_gain so I tweaked it like so:

declare shader "de_gamma" (
        color "input",
        scalar "gamma" default 0.454,
        boolean "reverse" default off,
apply texture, environment, lens
#: nodeid 56871328
version 1
end declare

...and added it to userdata.mi. Shows up and seems to work. I'm not sure if it works when you're rendering with Maya software.
  01 January 2013

Here's the link. Should help you out.

If animation is the illusion of life, then life is the illusion of reality.

"On ne sort pas DU REVE."

  01 January 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:57 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.