-
A cube requires 6 faces, 12 triangles, and thus 36 vertices. However, in the geometry used for skyboxes, the vertex array obtained using getFullScreenVertexBuffer only has three vertices. |
Beta Was this translation helpful? Give feedback.
Answered by
romainguy
Jul 20, 2023
Replies: 1 comment 1 reply
-
There's no need to build a cube. We use a single triangle that covers the entire screen and compute the view direction at each fragment in the shader (we do this in the vertex shader). That view direction is all that's needed to sample the cubemap. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zy4944796
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no need to build a cube. We use a single triangle that covers the entire screen and compute the view direction at each fragment in the shader (we do this in the vertex shader). That view direction is all that's needed to sample the cubemap.