Selecting the face of a Cubemap in GLSL

冷暖自知 提交于 2019-12-23 08:27:05

问题


Ok, I'm trying to understand how the face of a cubemap is selected using the coordinates supplied to textureCube(). From the spec, I gather the coord with the biggest magnitude defines the face.

For example these coords (-0.2, 0.7, 0.65) would select the Y+ face of the cube map, but these (0.2, 0.3, -0.8) would select the Z- face.

Am I right in my understanding?


回答1:


Indeed you are. This is the simplemost way to select the face of a cube, given a direction from the center.



来源:https://stackoverflow.com/questions/6980530/selecting-the-face-of-a-cubemap-in-glsl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!