REFLECT(3G)
π REFLECT π
okay so bestie, welcome to REFLECT(3G) β yes that's the 3G manual section, we're in OpenGL shading language territory, and no cap this one is lowkey iconic π¦
β¨ NAME β¨
reflect β bestie, it literally calculates the reflection direction for an incident vector π
π DECLARATION π
here's the vibe check, copy it exactly:
genType reflect(genType I, genType N);
genDType reflect(genDType I, genDType N);
two flavors, one for genType, one for genDType, slay β¨
πΈ PARAMETERS πΈ
Iβ the incident vector, aka the one that's about to hit the surface π«ΆNβ the normal vector, the surface's whole personality π
π DESCRIPTION π
okay so here's the tea. give it an incident vector I and a surface normal N, and reflect hands you back the reflection direction, and the math is literally:
I - 2.0 * dot(N, I) * N
that's it, that's the formula, no notes π
β οΈ not me forgetting this:Nshould be normalized in order to achieve the desired result. like, fr fr, normalize yourNor the result is not giving what it's supposed to give. consider this your gentle reminder bestie π
β VERSION SUPPORT β
here's the whole era-by-era breakdown, every single version accounted for:
reflect(genType) β ate in literally every single one:1.10β,1.20β,1.30β,1.40β,1.50β,3.30β,4.00β,4.10β,4.20β,4.30β,4.40β,4.50β β main character energy from day one πreflect(genDType) β she was not there early, and that's okay:1.10-,1.20-,1.30-,1.40-,1.50-,3.30-, and then boom π₯4.00β,4.10β,4.20β,4.30β,4.40β,4.50β β a glow up honestly π¦
π₯ SEE ALSO π₯
dot()refract()
go give them a read, they're the besties of this function, iykyk π
π COPYRIGHT π
Copyright Β© 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
π COPYRIGHT (again, bc she said it twice and honestly? iconic) π
Copyright Β© 2011-2014 Khronos Group
π and that's the whole page bestie!! this one came from[FIXME: source], dated01/03/2018, and it's theREFLECT(3G)page β thanks for reading, you're doing amazing sweetie, drink some water and normalize your normals πβ¨π«Ά
π¦ where this page comes from
- ubuntu jammy: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- ubuntu noble: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms