kma_hextiled_triplanar bug

   667   3   0
User Avatar
Member
12 posts
Joined: Oct. 2022
Offline
Why does the uv on the geometry affect the result?
Houdini (20.0.533)
Edited by kornilowadd - Dec. 20, 2023 12:56:22

Attachments:
pt_uv.png (2.3 MB)
pt_uv_02.png (2.2 MB)
pt_uv_render.png (1.9 MB)
pt_uv_02_render.png (2.1 MB)
NO_UV.png (2.1 MB)
SHADER.png (224.2 KB)

User Avatar
Member
7863 posts
Joined: Sept. 2011
Offline
kornilowadd
Why does the uv on the geometry affect the result?

because it's a normal map, which is essentially a vector field in surface space. To convert the space from surface to world space, a matrix must be constructed. This is usually done using by taking the derivatives of the uv's since the map will be in the same space as the uv coordinates. Triplanar mapping doesn't use uv's so there is no valid space with which to build a transform. The surface shader will still happily build one from the uv's if they exist--even if it makes no sense for triplanar mapping. When they do not exist, the tangents of the parametric coordinates are used instead, which for triangles are ugly nonlinear things.

In short, normal mapping cannot be used with triplanar mapping. Use a bump map or displacement instead.
User Avatar
Member
8647 posts
Joined: July 2007
Online
jsmack
Triplanar mapping doesn't use uv's so there is no valid space with which to build a transform.
Is there not?

For me in theory a very logical space would be the orthogonal projection Matrix multiplied by dihedral matrix between it's Z axis and surface N, per each projection
And then blend resulting evaluated world space normals within blend regions of the projections
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
7863 posts
Joined: Sept. 2011
Offline
tamte
Triplanar mapping doesn't use uv's so there is no valid space with which to build a transform.
Is there not?

For me in theory a very logical space would be the orthogonal projection Matrix multiplied by dihedral matrix between it's Z axis and surface N, per each projection
And then blend resulting evaluated world space normals within blend regions of the projections


yes, that would make sense, unfortunately the materialX surface shader only works with tangent space normals. It will take significant modifications to materialX as well as a new triplanar mapping node meant for normal maps--so it's not possible with MaterialX currently. It should be fairly straightforward with a VEX Mantra material though.
  • Quick Links