I’ve hit a bit of an odd problem: vertex colours seem to be showing up for some objects, but not others.
Specifically, I have a scene that I’m exporting from Blender, and some of the objects have vertex colours. However, not all of these objects show the vertex colours as expected in Panda: When viewing the objects in PView with no lighting, or when attempting to access the vertex colours in my shaders, certain objects appear to have either no vertex colours, or all their vertices coloured white (it’s not clear which). When viewing the objects in PView with the default (non-per-pixel) lights enabled, the vertex colours become visible.
To illustrate, I’ll show two objects, one above the other. Both have vertex colours, and both use the same material (which has “Vertex Color Paint” checked), I believe.
This is what I see in Blender; the cyan colouring is the vertex-colouring in question:
This is what I see in PView with no lights; note the lack of colour on the lower object:
This is what I see in PView with basic lighting enabled; note that the lower object appears to now show the vertex colours:
Looking at the egg file, the two objects appear very similar. Take a look at the following excerpts:
# ...
<Texture> Texture.008 {
"tex/stoneNormals.png"
<Scalar> wrap { repeat }
<Scalar> minfilter { linear_mipmap_linear }
<Scalar> magfilter { linear_mipmap_linear }
<Scalar> envtype { normal }
}
<Texture> Texture.007 {
"tex/sketch3.png"
<Scalar> wrap { repeat }
<Scalar> minfilter { linear_mipmap_linear }
<Scalar> magfilter { linear_mipmap_linear }
<Scalar> envtype { modulate }
}
<Material> Material.004 {
<Scalar> ambr { 1 }
<Scalar> ambg { 1 }
<Scalar> ambb { 1 }
<Scalar> emitr { 0 }
<Scalar> emitg { 0 }
<Scalar> emitb { 0 }
<Scalar> specr { 0.5 }
<Scalar> specg { 0.5 }
<Scalar> specb { 0.5 }
<Scalar> shininess { 12.5 }
}
# ...
# This is the object displaying the issue, I believe:
<Group> "inner chamber" {
<Transform> {
<Matrix4> {
3.68231 0 0 0
0 3.68231 0 0
0 0 3.68231 0
0.00287303 -0.125973 6.26969 1
}
}
<VertexPool> "inner chamber" {
<Vertex> 0 {
-6.90264 -7.03148 -2.16922
<UV> {
0 0.5
<Tangent> { 0 1 0 }
<Binormal> { -1 0 0 }
}
<RGBA> { 0 1 1 1 }
}
# < more vertices here... >
<Polygon> {
<Normal> { 0 0 1 }
<TRef> { Texture.007 }
<TRef> { Texture.008 }
<MRef> { Material.004 }
<VertexRef> { 30 38 39 37 <Ref> { "inner chamber" } }
}
# < more polygons here... >
# ...
# This is the one that works, I believe.
<Group> antechamber {
<Transform> {
<Matrix4> {
3.68231 0 0 0
0 3.68231 0 0
0 0 3.68231 0
0.00287303 -0.125973 6.26969 1
}
}
<VertexPool> antechamber {
<Vertex> 0 {
-1.27935 -1.4082 5.36891
<UV> {
0 0.346031
<Tangent> { 1.36327e-06 1 0 }
<Binormal> { -1 1.36327e-06 0 }
}
<RGBA> { 0 1 1 1 }
}
# < more vertices here... >
<Polygon> {
<Normal> { 0 -1 0 }
<TRef> { Texture.007 }
<TRef> { Texture.008 }
<MRef> { Material.004 }
<VertexRef> { 62 9 6 59 <Ref> { antechamber } }
}
# < more polygons here... >
(I’m happy to post the full version of the above, if desired; I stuck to excerpts for the sake of (relative) brevity.)
I’m using Panda 1.9.1, I believe.
So… I’m mystified. Does anyone have any ideas regarding where the problem may lie?