Math for Game Developers - Lambertian Surfaces
HTML-код
- Опубликовано: 11 окт 2024
- Lambertian surfaces receive light according to Lambert's Cosine Law, which we can calculate using a dot product.
Find the source code here: github.com/BSV...
New video every Thursday. Question? Leave a comment below, or ask me on Twitter: / vinobs
Thank you so much, before tuning in I was unsure if I understood the law right, but now I fully get it!
Merry Christmas man, You the bawm!
happy christmas 2 years late
I was initially confused by RemapVal() until I found it in the functions.si file. But then I saw Clamped() in there too. Why not use built-in GLSL function clamp()? Also, what the heck is Lerp(), ie. pow(x, log(flLerp) * -1.4427)?
Oh I didn't know clamp() existed :) Lerp() is poorly named but it's a biased interpolation, 0.5 is linear, values like 0.2 or 0.8 would ease in or out.