How to recompute the normal with VEX?

   1128   3   0
User Avatar
Member
2 posts
Joined: July 2023
Offline
Im trying to recompute the normal with the computenormal vex function in order to get the same result as using a Normal sop node. But no matter how I write the code, I always get a wrong normal showing on the back faces of the geo.
User Avatar
Member
1075 posts
Joined: April 2017
Offline
I also can't make that function work. I always get a normal of {0, 0, 0} on all points.

What's the reason for not using the normal sop?
User Avatar
Member
2127 posts
Joined: Sept. 2015
Offline
The docs say it's for use in shading context and that it's obsolete for SOP context.
User Avatar
Member
8785 posts
Joined: July 2007
Offline
in Point Wrangle:

- if you don't have N attribute on polygonal geo yet, then simply writing
v@N;
will create it based on topology

- if you already have N attribute, then you can check Bindings/Update Normals If Displaced
but then you need to modify v@P for it to trigger such update, so if your Wrangle doesn't modify v@P, you can do at least this to trigger the update:
v@P;
Edited by tamte - Sept. 13, 2023 01:24:55

Attachments:
create_or_update_N_in_wrangle.hipnc (101.8 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links