[Sidefx-houdini-list] OT: sRGB to linear question

John Coldrick jc at axyzfx.com
Tue Jul 8 12:56:15 EDT 2008


On Tuesday 08 July 2008 12:32, Sean Lewkiw wrote:
> Sorry to hog the list, but I'm still struggling a bit....
>
> > 	It seems obvious, but where it gets tricky is that when you render that
> > sRGB texture in mantra, what you're doing is rendering a texture map that
> > has a gamma burned into it(sRGB) that is different than what the renderer
> > is using(probably linear assuming you've changed nothing).
>
> I don't understand this.  How is the texture that mantra is using to
> render different from the texture from the original (sRGB) texture?

	It's not(mip mapping aside).

> Isn't is the same, gamma-burnt-in image I've been happily viewing?  That
> is, if I multiply Cf by my gamma encoded image's zero value, I get zero,
> and similarly again for values between zero and a bajillion?

	Yup.  Sorry if I wasn't clear - by rendering 'linear' - mantra is *not* 
tainting anything passing through it, it's the same burnt-in, lovely image 
you liked from the net.  The only downside is that you're using an image with 
a hard coded gamma as a texture map.  Being aware of that is all that's 
important.  There's nothing inherently wrong with the image, unless you were 
rendering it in the same shot with another texture map that was a cineon or 
linear image!  Again, even in that case, if you hit render and you like what 
you see, then you're OK.  However, once you start mixing colourspaces(which 
by all accounts you *don't* seem to be doing), you're likely in for a world 
of hurt.


> (I should mention that we have a mplay LUT that closely mimics the look
> of the Truelight film LUT which our compositors use, into which we
> render our images, and this is how we judge colour.)

	OK, in that case it's assuming you have a linear incoming OExr render(for 
example) and your LUT utility shows you what it will look like on your 
Truelight.  Let's say you have a flag in the picture with your inet image 
displayed on it.  It will look like it will look like on the Truelight in 
that case, there's nothing 'hidden' in there that would hurt you.  However, 
keep in mind that you've lit your scene to have it look the way you want.  A 
better approach would be to convert the image to linear and light it so that 
looks correct.  If leaving it at sRGB gets you what you want faster, then 
fine.  In your pipeline, for many cases, it wouldn't be the first thing I'd 
do however given it sounds like you've got more than sRGB in there.

	The thing is, as a rule you want to unwire yourself from the tyranny of sRGB.  
It's everywhere because you use computer monitors to view images - sRGB 
doesn't really belong in a film world.

> In a nutshell, my point is that when I think of what my shaders are
> doing mathematically to the texture map anyway, (power functions,
> clamps, remaps, etc), whether it's linear or sRGB seems to be the least
> of my worries!  ;-)

	It's really important to be aware of it.  Working all-linear will give you 
more control IMHO.

>
> Is the thinking that the need for truly linear images as textures so
> that physically accurate materials and lights perform the way they
> should, (EX:  HDR lighting)?

	That too, yes.  Again, not *strictly* necessary unless that sort of thing is 
important to you or your pipeline.

	To sum up, if it looks good and you like it, there's no hidden gotchas.  
However, please be aware that the author you reference says "beware 
absolutes", he's not saying converting your tmaps to linear is categorically 
unnecessary.  Most of the work we do here doesn't require that, but some 
does.  It sounds like you'll probably be OK with what you're using.  If you 
start having trouble getting your lighting/shading solution to look correct 
when you look at your Truelight lookup, then you know the first thing to 
try...;)

	Oh, and one more thing - you'll find people that will jump up and down and go 
blue with screaming insisting this is all wrong and you *must* do this or 
that.  I guess it makes sense, this touches on an area that people will get 
very passionate about - the ability to perceive colour.

	Cheers,

	J.C.

-- 
John Coldrick                  www.axyzfx.com        Axyz Animation
416-504-0425                                         477 Richmond St W
                                                     Toronto, ON Canada
jc at axyzfx.com                                        M5V 3E7
-----------------------------------------------------------------------
The best car safety device is a rear-view mirror with a cop in it.
  - Dudley Moore





More information about the Sidefx-houdini-list mailing list