VelociChicken
unread,May 9, 2013, 8:49:13 AM5/9/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello, I have an array of 8 different cubemaps that I want to accessfrom
within a single fragment shader.
I have a selection declared by the following:
uniform samplerCube RenderCube[8];
And I want toaccess it in the fragment shader with something like:
colour = textureCube(RenderCube[n], normal);
It compiles without error, but how do I decare the sting of eight
cubemaps inthe calling C++ code?
I'm able to do this with an arrary of sequencial (0-7) numbers by using:-
glUniform1iv(GetUniform("RenderCube"), 8, (GLint*)&cubeMapsReferences);
Where GetUniform is my function for grabbing the shader variable uniform
number.
for (int n = 0; n < 8; n++)
{
glActiveTextureARB(GL_TEXTURE0_ARB+n);
...code forbinding each cubemap texture...
}
But it's doesn't seem to work at all, is this the correct way of doing this?
Iknowit's an odd thing to want todo, but it's what I need to do with my
current experiment.
Thanks,
Dave.