Hello,
I have a problem with writing into an other layer than gl_Layer 0, with an 3d Texture attached to my FBO: Here is my code for the texture and FBO generation:
Code :
glActiveTexture(GL_TEXTURE0);
 
glGenTextures(1, &tex3DLVRed);
glBindTexture(GL_TEXTURE_3D, tex3DLVRed);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F, 32, 32, 32, 0, GL_RGBA, GL_FLOAT, 0);
glBindTexture(GL_TEXTURE_3D, 0);
 
glGenFramebuffers(1, &fboLightInject);
glBindFramebuffer(GL_FRAMEBUFFER, fboLightInject);
 
glFramebufferTexture(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,tex3DLVRed,0);
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);

My display routine looks like:
Code :
glUseProgram(lightInjectProgram);
glViewport(0, 0, 32, 32);
glClearColor(0.f, 0.f, 0.f, 0.f);           
glBindFramebuffer(GL_FRAMEBUFFER, fboLightInject);
glBindVertexArray(pointVAO);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawArraysInstanced(GL_POINTS,0,1,512*512);
glUseProgram(0);

My geometry shader looks like this:
Code :
version 330
layout(points) in;
layout(points, max_vertices = 1) out;
 
void main() 
{
	gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
	gl_Layer = 1;
	EmitVertex();
	EndPrimitive();
}
with gl_Layer=0, it works but when I use some other value, for example 1 it does not produce any output. In the Fragment shader I just assign red color for debug purposes.

It would be great if anybody comes up with an idea what to try or where my failure is.
I have an example program which works, therefore I am sure that my hardware is ready for this. but the example is such a complex program that I seem to overlook important instructions.

Thank you