F
Freddie The Potato
Guest
Heya
SamplerCubes are a GLSL feature that allows you to group 6 2D textures together to form a cube (1 texture for each face). You can then use GLSL's textureCube function with a directional vector to grab a color from inside the cube.
Usually in order to use the textureCube function, the user first needs to create a samplerCube object and pass it into the shader. However, GMS2 seems to lack this functionality (at least from what I can see.) There are no uniform functions that allow you to create samplerCubes and pass them into the shader.
The only alternative I can think of is packing all 6 face textures into one 2D texture, then somehow converting the components of a 3D directional vector into a 2D texture coordinate in order to grab a color from the correct face.
Is this the only solution? Any tips would be greatly appreciated
SamplerCubes are a GLSL feature that allows you to group 6 2D textures together to form a cube (1 texture for each face). You can then use GLSL's textureCube function with a directional vector to grab a color from inside the cube.
Usually in order to use the textureCube function, the user first needs to create a samplerCube object and pass it into the shader. However, GMS2 seems to lack this functionality (at least from what I can see.) There are no uniform functions that allow you to create samplerCubes and pass them into the shader.
The only alternative I can think of is packing all 6 face textures into one 2D texture, then somehow converting the components of a 3D directional vector into a 2D texture coordinate in order to grab a color from the correct face.
Is this the only solution? Any tips would be greatly appreciated