AmplifyCreations / AmplifyShaderEditor-Feedback

4 stars 0 forks source link

ASE function "World Normal Face" #354

Closed Dawie3565 closed 1 week ago

Dawie3565 commented 1 week ago

ASE function "World Normal Face"

--1-- Change name from "World Normal Face" to "Face Normal" to match same as Unity SG --2-- Remove world space Camera Pos as it is not part of function and breaks in use with decals --3-- Update per latest changes to match Unity SG adding Space sub options

Link: http://paste.amplify.pt/view/raw/3f511519

image

Note this function is used a lot in SRP decals as decals don't have a vertex normal, so we use the Face Normal node to derive the approximate world space normal of the surfaces that the decal intersects. adding any world space Camera Pos breaks this intended use and main reason for it to be removed and match same as Unity SG.

diogovtx commented 1 week ago

Implemented 1 and 3. Kept 2 because it's important for precision and should not break in any case. I did fix it to ensure the translation to view space happens before interpolation.

Didn't change the name, because it would create conflicts due to unitypackages. Instead, I added these changes to new node, derived from "World Normal Face", named "Normal Face".