Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualeppo

Posted 03 November 2013 - 08:10 AM

The source data indexes multiple streams/pools of vmaps (position, uv) for each individual vertex element. Your mesh may also store discontinuous uv-map data meaning a vertex may have different uv-values associated with it for different triangles connected to the vertex. You can only set a single index buffer, so you'll have to combine position- and uv-data into a single indexable stream.

 

So, you need to unweld/duplicate vertices. The most intuitive way is to construct both the vertex- and the index stream in a single pass:

 

- Set up an "unweld-buffer" of vertex-count number of elements, each element in this buffer stores a linked-list of possible position-uv-normal etc. sets for a specific vertex combined with an index into the vertex buffer.

- Loop over all vertices in all triangles. (foreach(mesh->triangles as triangle) foreach(triangle->vertices as vertex))

- Grab for each vertex the set of position, uv, etc. data (relative to the current triangle for discontinuous maps)

- Look for a compatible existing element in the unweld-buffer, if it exists place the existing index associated with this element into the index buffer, if it does not, create a new element, assign it the index "vertex-buffer count + 1" and add it to both the linked list and the vertex buffer.


#3eppo

Posted 03 November 2013 - 08:09 AM

The source data indexes multiple streams/pools of vmaps (position, uv) for each individual vertex element. Your mesh may also store discontinuous uv-map data meaning a vertex may have different uv-values associated with it for different triangles connected to the vertex. You can only set a single index buffer, so you'll have to combine position- and uv-data into a single indexable stream.

 

So, you need to unweld/duplicate vertices. The most intuitive way is to construct both the vertex- and the index stream in a single pass:

 

- Set up an "unweld-buffer" of vertex-count number of elements, each element in this buffer stores a linked-list of possible position-uv-normal etc. sets for a specific vertex combined with an index into the vertex buffer.

- Loop over all vertices in all triangles.

- Grab for each vertex the set of position, uv, etc. data (relative to the current triangle for discontinuous maps)

- Look for a compatible existing element in the unweld-buffer, if it exists place the existing index associated with this element into the index buffer, if it does not, create a new element, assign it the index "vertex-buffer count + 1" and add it to both the linked list and the vertex buffer.


#2eppo

Posted 03 November 2013 - 08:08 AM

The source data indexes multiple streams/pools of vmaps (position, uv) for each individual vertex element. Your mesh may also store discontinuous uv-map data meaning a vertex may have different uv-values associated with it for different triangles connected to the vertex. You can only set a single index buffer, so you'll have to combine position- and uv-data into a single indexable stream.

 

So, you need to unweld/duplicate vertices. The most intuitive way is to construct both the vertex- and the index stream in a single pass:

 

- Set up an "unweld-buffer" of vertex-count number of elements, each element in this buffer stores a linked-list of possible position-uv-normal etc. sets for a specific vertex combined with an index into the index buffer.

- Loop over all vertices in all triangles.

- Grab for each vertex the set of position, uv, etc. data (relative to the current triangle for discontinuous maps)

- Look for a compatible existing element in the unweld-buffer, if it exists place the existing index associated with this element into the index buffer, if it does not, create a new element, assign it the index "vertex-buffer count + 1" and add it to both the linked list and the vertex buffer.


#1eppo

Posted 03 November 2013 - 07:58 AM

The source data indexes multiple streams/pools of vmaps (position, uv) for each individual vertex element. Your mesh may also store discontinuous uv-map data meaning a vertex may have different uv-values associated with it for different triangles connected to the vertex. You can only set a single index buffer, so you'll have to combine position- and uv-data into a single indexable stream.

 

So, you need to unweld/duplicate vertices. The most intuitive way is to construct both the vertex- and the index stream in a single step:

 

- Set up an "unweld-buffer" of vertex-count number of elements, each element in this buffer stores a linked-list of possible position-uv-normal etc. sets. for a specific vertex combined with an index into the index buffer

- Loop over all vertices in all triangles.

- Grab for each vertex the set of position, uv, etc. data (relative to the current triangle for discontinuous maps)

- Look for a compatible existing element in the unweld-buffer, if it exists place the existing index associated with this element into the index buffer, if it does not, create a new element, assign it the index "vertex-buffer count + 1" and add it to the linked list and to the vertex buffer.


PARTNERS