Wednesday 19 March 2014

Erratum.

In a previous post: http://mklvfx.blogspot.fr/2014/02/radial-mapping.html
I said something very wrong while talking about linear vs srgb intepretation of a texture.

I said that ‘At the bottom, remapping with a linear texture is almost accurate. It's not exactly, but it's a matter of texture compression.’

I WAS WRONG. Systematically blaming texture compression is too easy. A flow in my photoshop knowledge was to be blamed, and I found out about that thanks to Simon Trümpler in this post. (We will be getting back to this post some time soon).

When you create a gradient in photoshop, there's a property called smoothness that you need to set to 0 if you want the interpolation between your gradient stops to be linear. This is what was truely messing up my gradient.

An easy way to double check that this is correct in photoshop is to create a 256 texture and compare the mouse pointer position with the brightness value.

At 48 in position, the 0% smoothness gradient = 48
              while the 100% smoothness gradient = 36


At 173 in position, the 0% smoothness gradient = 174
                while the 100% smoothness gradient = 184

At 255 in position, the 0% smoothness gradient = 255
                while the 100% smoothness gradient = 255
 

At 100 % smoothness, the values get accurate in certain positions (near the stops and midpoints) but they shift in between.
The 0 % smoothness ramp is not fully accurate, you might be a pixel off sometimes but overall it's pretty good.

And this how it verifies in the udk:
(don't forget that the srgb option needs to be false in your gradients textures)






No comments:

Post a Comment