Jump to content
  • Advertisement
Sign in to follow this  
1Bad

OpenGL Subdivided Icosahedron Texturing Seem!

This topic is 3852 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 all, I am working on a project and I am attempting to wrap a texture around a subdivided icosahedron to create a planet. I use a function for finding UV on a sphere, to generate the UV's for my icosahedron. However, there is a seam where there are triangles have vertices with UV coordinates on opposite sides of the texture. Example: vertex1.U = .9 and vertex2.U = .1 . As a result of these UV's being on opposite sides of the spectrum, the entire texture is being drawn between these vertices, and it is creating an ugly seem. Are there any flags to tell opengl to wrap UV's across the texture boarder? if not, what are the other options?

Share this post


Link to post
Share on other sites
Advertisement
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)

ought to do the trick... textures wrap by default.

Share this post


Link to post
Share on other sites
What header do I need for GL_CLAMP_TO_EDGE?

EDIT:
I found this topic

http://www.gamedev.net/community/forums/topic.asp?topic_id=191794

and used the specified #define but it still doesn't solve my problem.

I think the problem lies in the fact that a single triangle might have the U-coordinates .1 and .9 . Is this illegal in opengl? or is there a way to tell opnegl to interpolate from 1 to 0, without going through .5?

Share this post


Link to post
Share on other sites
Thanks Kalidor, thats what I figured I would have to do. As a temporary fix I added a check to the render code to check for UV's which cross the texture border and add +1 to the lower UV value so that the value would index into the correct position. However rather being able to repeat the entire texture, it is only repeating the edge pixels when using GL_REPEAT.

Share this post


Link to post
Share on other sites
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!