I have surface normal values encoded in the RGB channels of 32-bit textures. I have been trying to use these textures as normal maps of an mesh surface. I believe the node I need is: tangent_space_normal_roughness_texture, but I have not fund a way to map its output (NormalData) to an OmniPBR material using MDL Graph Editor.
In the Omniverse Material Graph documentation there is shown this node sequence: normal_map → Geometry Normal → Material surface. However, I can’t find any of these nodes.
Can someone explain to me how to connect the tangent_space_normal_roughness_texture to a material node in MDL Graph Editor?
Ok let me try to find out for you
The tangent_space_normal_roughness_texture node is not really intended to be used in the graph. Although it is exposed. It’s more intended to be used the body of omni core material MDL code. The gist of your issue is that it returns a MDL structure “NormalData”. It contains a float3 normal member, which then needs to be accessed inside the material. There’s no exposed way to do this unfortunately.
The good news though is that it’s not what you need at all. You only need to pass your normal map name to the “Normal Map” input on OmniPBR. Or you can use a normalmap_texture node in the Graph editor and connect the float3 output to the Geometry Normal input on OmniPBRBase.
Internally this is what OminPBR does. Since it’s an uber material, we just call that function and connect it to the geometry normal.
Thank you. I’ll try it. Does this work even if my normal map is 32-bit float in the range [-1, 1]?
Also, this is tricky to test because the normal components represent a very, very lightly curved parabola and the x, y component are close to 0.0, and the z component is almost 1.0.
It doesn’t look like it’s working. In this setup I have a camera looking at a mirror reflecting the sun (distant Light angular size 0.543) onto the camera. When the mirror is flat the sun is right in the middle of the mirror and of a certain size. If I apply the normal map, the sun disappears. If I set the normal map strength to 0.004, you can see the sun moving to the upper left corner of the mirror, where in reality it should stay in the center of the mirror and appear slightly larger.
normal maps are expected to be [0,1]. There’s some scale and offset parameters that you can use.
Thank you. I tried rescaling and shifting the domain: [-1,1] *0.5 à [-0.5,0.5] +0.5 à [0,1]. However, it doesn’t seem to work. I don’t think that re-mapping from [-1,1] to [0,1] is sufficient in my case.
Here is my reasoning.
My rough understanding of tangent space normal maps is that they “perturb” the surface geometry, i.e.: the RGB component are a perturbation offset of the actual normal xyz coordinates which have already being computed by the rendering process – be it ray tracer or scan line. In fact, the intensity, or strength parameter of a normal map, if set to 0.0, leaves the surface normals in their default (render-computed) state.
Because my map is an actual map of the components of the vector normals of the surface geometry (in local object space), just connecting the output of my texture, as normalmap_texture, won’t work. I believe this is why Maya Arnold has a function that specifically treats the RGB input as XYZ surface normal component. And that’s what I thought the tangent_space_normal_roughness_texture was for.
Are you sure you’re map is a tangent space map? It looks like it’s object space. If so you should be able to directly connect it to the geometry normal using a lookup_float3 node with texture_coord_2d.
Can you post your normal image and geometry?