Jump to content
  • Advertisement
Sign in to follow this  
Tim Ingham-Dempster

OpenGL Line artifacts in texture Cg

This topic is 3367 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

Hi, I'm trying to upload a cube of voxel data to a texture and render a slice through it. The basic principle seems sound, but I'm getting strange line artifacts: link to image The shader uses two functions, one which converts the 3d co-ordinate into a single float and a second which converts that into a 2d texture co-ordinate.
float serialise(float3 pos, float a)
{
	float x,y,z;
	x = floor((pos.x * a));
	y = floor((pos.y * a))*a;
	z = floor((pos.z * a))*a*a;
	return x + y + z;
}



float2 deSerialise(float x, float a)
{
	float2 temp;
	temp.x = fmod(x,a) + 0.5;
	temp.y = floor(x/a) + 0.5;
	return temp/a;
}


Does anyone know what these lines are? I don't really know where to start looking. I'm using Cg, SDl and OpenGL. Also the slight wrap around from one side of the image to the other is now fixed. Thanks in advance, Tim

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!