Normal....point, vertex or primitive

   5011   2   1
User Avatar
Member
280 posts
Joined: Dec. 2015
Offline
Hi, I am a bit confused at what kind of normals does mantra use to compute reflections and refractions as in houdini you could add normals to points vertex and primitive separately.
Basically I have a holed cube (one cube inside another) and I reverse the normals of the inside cube so they face inwards. Then I notice that if I place the reverse after the normal SOP only the faces get inverted. But if I placed it before both vertex and primitive normals gets inverted….which gives me different results when rendering refractive materials.
I have difficulty wrapping my self around the concept of different normals for vertex and primitives….

(a primitive facing one way and vertex the other way…sounds interesting to experiment with but…. puff there goes my mynd )

But which one does mantra use for its compute needs, particularly when it comes to refractions and reflections?

I know this may be a silly question but I really like to have the basic very clear in my head. So any help would be welcome.
https://www.imdb.com/name/nm8408875/ [www.imdb.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Either point or vertex normals with default shaders will cause Mantra to use those normals for refraction and reflection. Houdini only supports either point or vertex N normals within a single object/Display SOP. Never both. It's a historic limitation and a good one imho.

If you don't want point/vertex N normals, append an Attribute Delete SOP and remove N from both vertex and point type attributes. The material will build them for you from the primitive normal direction.

—-

The answer ultimately depends on the shader/material you assign to your geometry. Using any of the shipped materials will inherit any point or vertex normal vector N attribute present on the geometry, and if there is no point or vertex vector N attribute present, the shader is programmed to generate the surface normals from the primitive normals interpolated across the polygon faces as the geometry is both refined and sampled by rays.

To ensure the Normals face toward the eye/camera, the shader will also do a frontface() operation to ensure the surface normals face toward the eye/camera.

—-

When rendering transparent objects or using two-way shaders (textures on both sides of a face), this frontface() option can be disabled. It's the “Shade Both Sides As Front” parameter on the Principled Surface material. If you are rendering transparent objects, it is important to assure that your primitive normals face outward for refraction and reflection to work properly although not mandatory. It is good practice. Verify primitive normal outward orientation by turning on primitive normals in the viewport. If they face inward and you are rendering transparent dielectric type materials or using two-way shaders, use a Reverse SOP to reverse the vertex order winding to revers the primitive normals.

Note that Houdini has opposite Left Handed winding to Maya/3DSMax/RenderMAN and perhaps others. If you are importing any geometry from another application, assume that it is Right handed winding and you need to apply a Reverse SOP if you want to render it with transparency or with a two-sided shader, for Boolean operations to work properly, for collision SDF volumes or VDB grids to be computed properly, etc. Otherwise you can rely on the frontface() operation on your normals to ensure they face forward.


Hope this helps.
There's at least one school like the old school!
User Avatar
Member
280 posts
Joined: Dec. 2015
Offline
Wow!
Thank you very much Jeff this more than explains everything I wanted to learn about Normals….it actually goes straight to the points I was wondering the most. How normals from diferent elements are treated and what mantra needs from them. Thank you for taking the time to write this.
https://www.imdb.com/name/nm8408875/ [www.imdb.com]
  • Quick Links