taiya / igd

Introduction to Game Development (CSC 205)
9 stars 5 forks source link

Lighting equations... #7

Closed jonhealy1 closed 7 years ago

jonhealy1 commented 7 years ago

I was just getting back from Mexico and missed the first half an hour of the lecture.... I assumed the lighting equations would be in the slides. Can someone help?

taiya commented 7 years ago

https://en.wikipedia.org/wiki/Phong_reflection_model

taiya commented 7 years ago

I also want to add, both me and Dr. Tarini were right the other day. There are two ways to write the shading equation, one is with the so called "half-vector" the other is with the "reflected" vector. I was using the second, he was using the first (better for GPU efficiency)

jonhealy1 commented 7 years ago

Sorry what are the two equations we need to know? Is one diffuse and the other specular? Do we use the inverse Phong from this page? Is it Blinn- Phong?

taiya commented 7 years ago

RGB = diffuse + specular diffuse = C_light C_diffuse <normal, light_dir> specular = C_light C_specular <view_dir, reflected_light_dir> (note I didn't mention ambient)

jonhealy1 commented 7 years ago

thank you.