Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


#ActualNeosettler

Posted 13 January 2013 - 12:17 PM

Greetings everyone,

I’ve been looking around and found many threads on this topic but none of them seems to tackle my concern specifically. So I’ll try to explain my approach in drawing geometries with multiple materials.

For simplicity sake, let’s focus on only one geometry.

Geometry:
-Meshes Array
-Vertices
-Vertices Attributes
-VBO

Mesh:
-Face Indices
-Material

This concept first appeared ideal for sharing the vertices between meshes but consider a geometry composed of 4 Quads:

---------
| A | B |
----+----
| C | D |
---------

- VBO is aligned ABCD
- Mesh1: Material1: Face Indices AD
- Mesh2: Material2: Face Indices BC

The problem:
Chances are that Mesh2 will be rendered correctly because the Vertices are packed one after the other in the VBO but Mesh1 might have wrong data since the Face Indices AD are not align in the VBO.

The goal:
To share V, VA and VBO between meshes. Avoiding geometry reconstruction and using FI to render whatever part of the geometry, leaving the VA undisturbed from their original structure (presumably imported from an CG package).

Now, could this be done or I’m dreaming a fantasy world?


#1Neosettler

Posted 12 January 2013 - 01:51 PM

Greetings everyone,

I’ve been looking around and found many threads on this topic but none of them seems to tackle my concern specifically. So I’ll try to explain my approach in drawing geometries with multiple materials.

For simplicity sake, let’s focus on only one geometry.

Geometry:
-Meshes Array
-Vertices
-Vertices Attributes
-VOB

Mesh:
-Face Indices
-Material

This concept first appeared ideal for sharing the vertices between meshes but consider a geometry composed of 4 Quads:

---------
| A | B |
----+----
| C | D |
---------

- VOB is aligned ABCD
- Mesh1: Material1: Face Indices AD
- Mesh2: Material2: Face Indices BC

The problem:
Chances are that Mesh2 will be rendered correctly because the Vertices are packed one after the other in the VOB but Mesh1 might have wrong data since the Face Indices AD are not align in the VOB.

The goal:
To share V, VA and VOB between meshes. Avoiding geometry reconstruction and using FI to render whatever part of the geometry, leaving the VA undisturbed from their original structure (presumably imported from an CG package).

Now, could this be done or I’m dreaming a fantasy world?

PARTNERS