Hallo
ich beschäftige mich grade mit dieser funktion. der letzte parameter
ist interessant:
When calling SetStreamSource, the stride is normally required to be equal to the vertex size. However, there are times when you may want to draw multiple instances of the same or similar geometry (such as when using instancing to draw). For this case, use a zero stride to tell the runtime not to increment the vertex buffer offset (ie: use the same vertex data for all instances). For more information about instancing, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).
könnte man damit nicht auch instancing erreichen, wenn man den letzen
parameter auf 0 setzt?
also sowas:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
geo:
-pos
-normal
-texcoord0
inst:
-texcoord1 // mat_row_0
-texcoord2 // mat_row_1
-texcoord3 // mat_row_2
-texcoord4 // mat_row_3
dev->SetStreamSource(0, geo, 0, 0);
dev->SetStreamSource(1, inst, 0, sizeof(instance_data));
|
könnte das klappen? laut doku sollte das ja funktionieren.
kanns grade nicht testen aber werde mich mal abends dransetzen.
geht das? :o