Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    135
  • comments
    130
  • views
    52602

Found the problem

Sign in to follow this  
VisualLR

91 views

I found what's causing the strange behavior, but I haven't come up with a solution yet. It's strange, but basically, what's happening is that for some reason the UVs are different on different faces that share a same vertex.

For example,

--- Face: 0
0: -20.00 -20.00 0.00 [ 1.00 0.00 ]
2: -20.00 20.00 0.00 [ 1.00 1.00 ]
3: 20.00 20.00 0.00 [ 0.00 1.00 ]

Notice the UVs for vertex 0, they're 1.0, 0.0 further down the list we have:

--- Face: 4
0: -20.00 -20.00 0.00 [ 0.00 0.00 ]
1: 20.00 -20.00 0.00 [ 1.00 0.00 ]
5: 20.00 -20.00 40.00 [ 1.00 1.00 ]

Now they're 0.0, 0.0 which is wrong, and since this is being mapped directly into the vertex buffer, it's changing UVs that were already good.

So now I have to figure out why this is the case.
Sign in to follow this  


1 Comment


Recommended Comments

If this is still considering the cube, the behaviour might be appropriate, depending on how the data is formatted.

Although a cube only has 8 vertices, each of these vertices may potentially need 3 texture coordinates (one for each face of the cube). So in practice, such a cube will have 3*8=24 vertices. These vertices each have a single texture coordinate set, whereas the original 8 would each have three sets.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!