Vertex-colour alpha and transparency--circumvention


#1

I’ve discovered that some of my models are being treated as transparent–and oddly, that only parts of those models are being treated so. Investigating, my best guess at the moment is that the model-sections being treated as transparent have vertices with vertex-colour alpha-values less than one; indeed, I see such values in a number of the objects that I’ve looked at.

What I thus imagine is happening is that Panda is seeing values less than one in a given object’s vertex-colour alpha-channel, and so automatically treating it as being transparent.

So, is there any way to disable or circumvent this feature?

(I think, at least, that I’m not using it–but I am using vertex-colours to store data, or to aid in certain parts of the level-building process.)

It might be tempting to just ignore the issue, as it doesn’t seem to be significantly impacting my frame-rate and the transparency-values are often all but opaque. However, in at least one case it seems to be interfering with the rendering of an object that is intended to be transparent.


#2

I think the .egg loader is doing this automatically, and I think you can override this by explicitly forcing a <Scalar> alpha { off } in there.


#3

Ah, I see–and if I put it at the highest level of the scene, will it then apply to all objects below? (I imagine so, but I want to check–especially as importing the scene takes quite some time. (As I’ve mentioned before.))


#4

Okay, I have another question, if I may: It looks like attaching the tag to the highest level of the scene is unlikely to be convenient in my case. Now, I’ve found a way of locating all objects in my Blender-scene that have vertex-colour alpha-values, and can thus potentially assign the tag to each.

However, I’m hesitant to just apply the tag to all of them, uncertain of what that might do to Panda’s ability to group objects together for performance purposes.

However again, there are only ~100 such objects (likely a little less, as there are a few that are intended to have transparency, and which can thus be skipped) over the course of a largish level. Furthermore, they weren’t causing apparent performance issues when they were being rendered as “transparent”. This may, perhaps, indicate that tagging them isn’t likely to result in performance issues.

What do you think?

(I could just try it, but as I’ve mentioned before, this level takes quite some time to export from Blender and import into Panda. I haven’t yet gotten around to implementing a means of loading levels from multiple files–it’s something that I have in mind to attend to after my next intended major milestone…)


#5

The egg loader is pretty smart at binning together objects that have similar state, so I don’t foresee a problem.


#6

Would the presence of the tag be considered to be a separate state, or would they be considered to have the same state as (otherwise-similar) opaque objects?