• Advertisement
Sign in to follow this  

FP32 Textures with 3D Textures

This topic is 4515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using this code to make a 3D FP32 Texture and its SLOW when it comes to render the scene... Its a smaller texture so size shouldn't be killing my performance?
const int NOISETEXTURE = 32;
float Noise3DTexPtr[NOISETEXTURE][NOISETEXTURE][NOISETEXTURE][4];

for(int x = 0; x < NOISETEXTURE; x++)
	{
        for(int y = 0; y < NOISETEXTURE; y++)
		{
			for(int z = 0; z < NOISETEXTURE; z++)
			{
				Noise3DTexPtr[x][y][z][0] = PerlinNoise3D(x, y, z, .01, .5, 2);
				Noise3DTexPtr[x][y][z][1] = PerlinNoise3D(x, y, z, .005, .5, 2);
				Noise3DTexPtr[x][y][z][2] = PerlinNoise3D(x, y, z, .01, .25, 2);
				Noise3DTexPtr[x][y][z][3] = PerlinNoise3D(x, y, z, .001, .15, 2);
			}
		}
	}

glGenTextures(1, &skyplane.textureObjectSkyNoise3D);
	glBindTexture(GL_TEXTURE_3D, skyplane.textureObjectSkyNoise3D);

	glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
	glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA_FLOAT32_ATI, NOISETEXTURE, NOISETEXTURE, NOISETEXTURE, 0, GL_RGBA, GL_FLOAT, Noise3DTexPtr);

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by JavaCoolDude
Change the LINEAR filter to NEAREST since there is no hardware capable of that just yet :)


Yeah, I already did that and it worked... Just haven't posted the results yet. ;) What format is everyone using? .dds or the OpenEXR??

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement