Shader Formula Overcomplication
I remembered I used to write formula's in shaders like this - what do people think? float rayleigh_phase_func(float mu) { return 3. * (1. + mu*mu) // ----------------- (16. * PI); } // Henyey-Greenstein phase function factor [-1, 1] // represents the average cosine of scattered directions // g is isotropic scattering // > 1 is forward scattering, < 1 is backwards const float g = 0.76; float henyey_greenstein_phase_func(float mu) { return (1. - g*g) //----------------------------- ((4. + PI) * pow(1. + g*g - 2.*g*mu, 1.5)); } // Schlick Phase Function Factor // Pharr and Humphreys [2004] equivalence to g above const float k = 1.55 * g - 0.55 * (g*g*g); float schlick_phase_func(float mu) { return (1. - k*k) //----------------------------- (4. * PI * (1. + k*mu) * (1. + k*mu)); }
The meme is a screenshot of a tweet showing several complicated shader formulas for light-scattering phase functions. The caption jokes about writing formulas this way and asks what people think, poking fun at overengineered, intimidating-looking code and the gap between mathematical correctness and readable programming. It is commonly sent as a reaction to unnecessarily complex code or proudly incomprehensible technical work. EN: The meme is a screenshot of a tweet showing several complicated shader formulas for light-scattering phase functions. The caption jokes about writing formulas this way and asks what people think, poking fun at overengineered, intimidating-looking code and the gap between mathematical correctness and readable programming. It is commonly sent as a reaction to unnecessarily complex code or proudly incomprehensible technical work.
- @ithueti / 1518 2019-10-27
- @right_wing_dev_squads / 3243 2022-01-09
- Template
- programmer tweet screenshot
- Type
- image
- Size
- 560×800 · 73.0 KiB
- Mood
- sarcastic, nerdy
- Language
- en
- Added