About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Texture Glitch
Author Message
Rubeus Offline
Member

Post: #1
Texture Glitch
I'm using an Icosahedron subdivided a few times. This is required for my game. Putting a texture on it is fine, except in the back there's an ugly... thing. An example pulled from the Goog:
[Image: seam1.png]
(This shows the issues more clearly than the test texture I'm using)
Well, I found the almost magical Mesh->fixTexWrapping() that seemed to fix my problem. But.... it creates those pesky extra verts. >:(
[Image: 25umkwp.jpg]
(Sorry for the low quality - Remote Desktop is.... >_> )
Unfortunately, this easy solution won't really work with what I'm doing. I was wondering if anyone knew any magic or math that could bypass the problem.
From what I can gather, the nature of an Icosahedron causes the seam where the UV meets to be backwards or something. I never got into texture mapping and such.
The rips happen because the very nature of my game requires the verts move around, grow, shrink, etc.
So far, the only method I could think of that could possibly be of any use is using fixTexWrapping(), then somehow find the new verts and move them to always be in the same position as the originals. But this seams (xD) to be a very inefficient solution. As of right now, I'm working on this method, but I was curious if anyone had any insight on this issue and could provide a less....hack.
05-21-2014 09:02 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Texture Glitch
You do need multiple vertexes at same position to have correct tex mapping, there's no workaround it (unless you just ignore tex UV's altogether, and recalculate them dynamically in the pixel shader).
The best shape for UV mapping is MeshBase.createBall or createBall2 (don't remember which one) which have tex mapping automatically set correctly.

Quote:Then somehow find the new verts and move them to always be in the same position as the originals
The engine has MeshBase.setVtxDup to calculate vtx duplicates which gives you index to a vertex with the same position.
But I'd just transform vertexes based on their position. So if 2 vertexes have the same position, then their transformation would be the same, then you don't need to look for duplicates.
05-21-2014 11:13 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Texture Glitch
I was afraid of that. I guess I can pull off some fancy code to keep those verts from divorcing. I may look into the shader later, but that sounds like a pain in the hind-quarters.
05-22-2014 03:14 AM
Find all posts by this user Quote this message in a reply
Post Reply