Hi all,
I've been playing around with OSL textures and trying to generate some normal maps. I'm seeing some weird behaviour which I'm hoping someone can shed some light on.
Here's a simple scene with a white diffuse model:
Next I've created a simple (REALLY simple) OSL texture that just sets the colour to the Geometric normal of the surface. I've applied the texture to the diffuse channel and it looks like the kind of thing one would expect:
Finally I applied the Geometric Normal texture to the texture slot on the diffuse material. I was hoping this would do nothing and render like the first image, but it's getting strange artifacts:
Does anyone know what's going on? Do I need to transform the geometric normal in OSL to something else?
Cheers,
James.
OSL normals
Moderator: juanjgon
Perhaps the problem is that you need to declare the output as "vector" or "normal", not as "color"
https://docs.otoy.com/StandaloneH_STA/S ... rTypes.htm
Thanks,
-Juanjo
https://docs.otoy.com/StandaloneH_STA/S ... rTypes.htm
Thanks,
-Juanjo
it would make sens but as far as I know octane OSL texture only support color output.juanjgon wrote:Perhaps the problem is that you need to declare the output as "vector" or "normal", not as "color"
https://docs.otoy.com/StandaloneH_STA/S ... rTypes.htm
Thanks,
-Juanjo
Pascal ANDRE
I think I've got to the bottom of this...
The Octane materials expect normal maps in tangent space rather than 'common' or 'world' space. This means that if you want a null map (i.e. a normal map that doesn't change anything - a good starting point for something that does!) you need to supply a map that points purely in the Z direction. The added hook is that the vectors are normalised so that each component lies in the range (0,1) rather than (-1,1). As such, linking the normal map to an OSL node (or an RGB node) that just outputs the colour (0.5, 0.5, 1.0) gives a result that matches a material with no normal map.
This is a long winded way of saying (0.5, 0.5, 1) is the colour of a normal map that does nothing at all.
Next week I shall investigate why 0 is the correct amount to enter into an ATM when you don't want to take any money out...
J.
The Octane materials expect normal maps in tangent space rather than 'common' or 'world' space. This means that if you want a null map (i.e. a normal map that doesn't change anything - a good starting point for something that does!) you need to supply a map that points purely in the Z direction. The added hook is that the vectors are normalised so that each component lies in the range (0,1) rather than (-1,1). As such, linking the normal map to an OSL node (or an RGB node) that just outputs the colour (0.5, 0.5, 1.0) gives a result that matches a material with no normal map.
This is a long winded way of saying (0.5, 0.5, 1) is the colour of a normal map that does nothing at all.
Next week I shall investigate why 0 is the correct amount to enter into an ATM when you don't want to take any money out...
J.