MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / computeViewNormal

Function computeViewNormal

TheForceEngine/Shaders/grid.h:16–21  ·  view source on GitHub ↗

Use the screenspace partial derivatives of the viewspace position to compute the normal.

Source from the content-addressed store, hash-verified

14
15// Use the screenspace partial derivatives of the viewspace position to compute the normal.
16vec3 computeViewNormal(vec3 pos)
17{
18 vec3 dx = dFdx(pos);
19 vec3 dy = dFdy(pos);
20 return normalize(cross(dx, dy));
21}
22
23float computeViewFalloff(vec3 viewPos, vec3 viewUp)
24{

Callers

nothing calls this directly

Calls 2

normalizeFunction · 0.50
crossFunction · 0.50

Tested by

no test coverage detected