Skip to content

Graphic calculations

vhirtham edited this page Jul 17, 2018 · 1 revision

Table of content

  1. Shader
    1. Fragment shader



Shader

Fragment Shader

Face normal of a triangle

From this thread:

N = cross(dFdx(p), dFdy(p))

p is the fragment position in any affine space (object space, world space or eye space, but not NDC). The normal N will be in the same space.

Clone this wiki locally