Results 1 to 5 of 5

Thread: Many submeshes result in skewed UV

  1. #1
    Member
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    33

    Many submeshes result in skewed UV

    Hi folks,
    It's been a while since i've posted but luckily I havn't had any Collada problems

    I am writing today for some advice on some exports. For high poly versions of the models i'm exporting (in a proprietary format btw) the models are broken into several index buffers and positions/uvs. The problem is that every UV map following the first is skewed even though the data appears accurate and even the Collada coherency check agrees. Although when importing it into model viewers, the viewer either crashes, attaches the UV similar to below or the UV mapping dissappears altogether (because the data is bad?)

    [attachment=0:a31or5iw]fat_zombie_uv_prob.jpg[/attachment:a31or5iw]

    Note: I had to invert the Y axis of the first UV to correct the orientation.

    I could use any advise to guide me in the right direction. I have attached an example model although it is different one to the zombie above. Many thanks, Maeyan

    http://www.hellgateaus.net/files/skewed_uv.rar File Size: ~500kb
    Don't dream what to be; be what you always dreamed.
    I use Collada in my project Revival

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Santa Clara
    Posts
    356

    Re: Many submeshes result in skewed UV

    I had a quick look at the dae, and here's some comments:

    - you are using 'set' with Input semantic="VERTEX". Although it is an interesting concept (having a set of vertices one could switch from when instancing the geometry) it is not part of the specification. Moreover, you are not definining more than one set of vertices, so I would remove 'set' attribute for all "VERTEX" semantic
    - you are using 'set' with Input semantic="TEXCOORD", wich is fine since more than one UV mapping may exist for each vertex, but in your case you are defining only one set per primitive, so it should be removed.
    - your material has only one mapping to texture coordinates ("uv_0") for diffuse texture. (ok)
    - your binding is binding only one set of textures ("uv_0" is mapped to input_set="0"). Which is fine since all your geometry is using the same material, but indicates again that all the primitives should be defined with set="0" for the "TEXCOORD" semantic

    I hope this helps

  3. #3
    Member
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    33

    Re: Many submeshes result in skewed UV

    Quote Originally Posted by remi
    I had a quick look at the dae, and here's some comments:

    - you are using 'set' with Input semantic="VERTEX". Although it is an interesting concept (having a set of vertices one could switch from when instancing the geometry) it is not part of the specification. Moreover, you are not definining more than one set of vertices, so I would remove 'set' attribute for all "VERTEX" semantic
    - you are using 'set' with Input semantic="TEXCOORD", wich is fine since more than one UV mapping may exist for each vertex, but in your case you are defining only one set per primitive, so it should be removed.
    - your material has only one mapping to texture coordinates ("uv_0") for diffuse texture. (ok)
    - your binding is binding only one set of textures ("uv_0" is mapped to input_set="0"). Which is fine since all your geometry is using the same material, but indicates again that all the primitives should be defined with set="0" for the "TEXCOORD" semantic

    I hope this helps
    Excellent mate! I was hoping it was an implementation problem... i'll let you know.
    Don't dream what to be; be what you always dreamed.
    I use Collada in my project Revival

  4. #4
    Member
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    33

    Re: Many submeshes result in skewed UV

    I adjusted the set attributes as you suggested but I still encounter the same errors. Assuming the UV data is okay (they are all floats between 0 and 1), what else in the implementation could be causing inconsistencies? I could merge all the UV data into one array but it's probably important to keep the model divided into several parts(?). Many thanks for your input.
    Don't dream what to be; be what you always dreamed.
    I use Collada in my project Revival

  5. #5
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Many submeshes result in skewed UV

    Code :
    				<triangles material="mtl" count="81">
    					<input source="#elemental_blue_mesh-vertices" set="2" semantic="VERTEX" offset="0"/>
    					<input source="#elemental_blue_mesh-uv-map-1" set="2" semantic="TEXCOORD" offset="0"/>

    I had a quick look too and notice that you are using the same index (offset=0) values to stream both your vertex and texture coordinates. Is your data really organized that way?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •