Phong model, remaking of

   2371   1   0
User Avatar
Member
875 posts
Joined: 10月 2008
オフライン
I want to understand the way VEX shading works so I am reproducing the Phong lighting model:

http://en.wikipedia.org/wiki/Phong_shading [en.wikipedia.org]

I am trying to figure out the corresponding VEX global variables in the Phong equation:



Now, if below we assume the equation variables are on the left, and the corresponding VEX global variables on the right, then would the following be correct?

L == L
N == N
R == ? (get it from the reflect node?)
V == I

ka == custom float parameter
ks == custom float parameter
kd == custom float parameter
α == custom float parameter

Looks like this so far:

Attachments:
phong.jpg (38.2 KB)

--
Jobless
User Avatar
Member
45 posts
Joined: 6月 2009
オフライン
R is the reflected light direction, so I think that you can calculate it using a reflect node.
Otherwise you can do it using the reflection formula: R = 2(N.L)N - L
  • Quick Links