Optimal Normal calculations #434
TokisanGames
started this conversation in
Extras
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From @Xtarsia
This is a new method for calculating normals in fragment()
the n1 - n4 values can be returned to use for correct blending when doing projection too. completley avoiding any need for a normal map 😄 #400, the original artifact #185 , and this new method (no vertex normals calculated at all)
the normals are more correctly centered too
with a single gather_texel_normal() we get the 1st image normals, handy for low-poly. 2nd is the smooth normals.
4x gathers is roughly equal to 1 full texture lookup (a wee bit more expensive)
I think this is a novel approach, i never found anything using gather to generate normals from heightmap on the fly in all my googling efforts.
This method means that the normal values don't exactly line up [with the vertices], im essentially magicking up a 1025th pixel
This method calculates normals at the center of a region vs at the edge:
Beta Was this translation helpful? Give feedback.
All reactions