Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMightTower2

Posted 25 June 2013 - 02:22 PM

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:
 

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:

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:

#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


#5MightTower2

Posted 25 June 2013 - 02:20 PM

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:
 

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:

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:

#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 came 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


#4MightTower2

Posted 25 June 2013 - 02:20 PM

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:
 

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:

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:

#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 came 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


#3MightTower2

Posted 25 June 2013 - 01:32 PM

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:
 

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:

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:

#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 came 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


#2MightTower2

Posted 25 June 2013 - 01:23 PM

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:
 

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:

glUseProgram(lightInjectProgram);
glViewport(0, 0, grid.getDimension(), grid.getDimension());
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:

#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 came 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


#1MightTower2

Posted 25 June 2013 - 01:11 PM

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:
 

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);

glGenTextures(1, &tex3DLVGreen);
glBindTexture(GL_TEXTURE_3D, tex3DLVGreen);
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);

glGenTextures(1, &tex3DLVBlue);
glBindTexture(GL_TEXTURE_3D, tex3DLVBlue);
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);
glFramebufferTexture(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT1,tex3DLVGreen,0);
glFramebufferTexture(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT2,tex3DLVBlue,0);

glBindFramebufferEXT(GL_FRAMEBUFFER, 0);



My Display Routine Looks like:

glUseProgram(lightInjectProgram);
glViewport(0, 0, grid.getDimension(), grid.getDimension());
glClearColor(0.f, 0.f, 0.f, 0.f);           
glBindFramebuffer(GL_FRAMEBUFFER, fboLightInject);
glBindVertexArray(pointVAO);
GLenum buffers1[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,GL_COLOR_ATTACHMENT2};
glDrawBuffers(3, buffers1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawArraysInstanced(GL_POINTS,0,1,512*512);
glUseProgram(0);

My geometry shader Looks like this:

#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 came 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


PARTNERS