Jump to content

  • Log In with Google      Sign In   
  • Create Account

Solid_Spy

Member Since 26 Nov 2012
Offline Last Active Mar 11 2016 12:06 PM

Posts I've Made

In Topic: How to send a CubeMap texture to a compute shader?

06 December 2015 - 01:59 AM

Success!

 

I found the issue. At first I thought that GL_RGBA8 and GL_RGBA32F were equivalent, for some reason :P. I changed my textures to GL_RGBA32F and now it is officially working.


In Topic: How to send a CubeMap texture to a compute shader?

06 December 2015 - 12:15 AM

I decided to ditch cubemaps for now and use image2d's instead, and was suprised to see that those don't work either!!

 

Something is seriously wrong. I am able to get image2d to work in other compute shaders. I think the root of the problem is the SSBO, because all these problems started ever since I started using them. I think that is causing a bug, maybe in the drivers, because I am certain I am implementing them correctly. I looked at various tutorials on how to use SSBOs. However, I don't want to ditch the SSBO for storing 9 vectors, but it looks like I have no choice.

 

I guess I have no choice but to maybe use another texture that is write only to store the harmonic coefficients somehow.. until anyone can help me find out what the hell is going on here.


In Topic: How to send a CubeMap texture to a compute shader?

05 December 2015 - 08:56 PM

Ok, I am starting to believe that the reason this isn't working, is because the cubemap needs to be immutable, which I read in this article:

http://malideveloper.arm.com/resources/sample-code/introduction-compute-shaders-2/

 

"A very important restriction for using shader images is that the underlying texture must have been allocated using “immutable” storage, i.e. via glTexStorage*()-like functions, and not glTexImage2D()."

 

I have modified my cube map creation code like so, however, I am not sure if I am doing it right. Gdebugger will not display the texture (probably since immutable textures only have support for 4.2 or above, and gdebugger is meant for lower version of OpenGL). EDIT: I changed the texture to be immutable and successfully tested it in a vertex/pixel shader, but in the compute shader, things still arent working.

	glGenTextures(1, &cubeMapObject);
	glBindTexture(GL_TEXTURE_CUBE_MAP, cubeMapObject);

        int levels = floor(log2((16.0)))+1;

	glTexStorage2D(GL_TEXTURE_CUBE_MAP, levels, GL_RGBA8, 16, 16);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataLeft);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataRight);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataUp);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataDown);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataFront);

	glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
			0,
			0,
			0,
			16,
			16,
			GL_BGRA,
			GL_UNSIGNED_BYTE,
			cubeMapSideDataBack);

	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S,
					GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T,
					GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R,
					GL_CLAMP_TO_EDGE);

In Topic: Light vs Mesh culling causes specular discontinuities.

24 October 2015 - 04:33 PM

Ok, I managed to solve it. I forgot to add falloff to the specular. I swore I already added it, but I didn't for some reason. I added it to the diffuse light but not the specular tongue.png.


In Topic: problem with vbo

16 September 2015 - 01:08 PM

could you give more details? How are you creating your projection matrix? How are you using your projection matrix/vbo data? Have you set the GlViewPort to 800x600? Did you bind the vbo?


PARTNERS