Vertex Color Alpha

I’m trying to adjust the alpha value of faces using vertex color. As far as I can tell, this works fine in Multitexture mode, but not GLSL (which is what I need to use). Here’s a blend file that demonstrates this.

VertexAlpha.blend (528 KB)

Just wanted to make sure I’m doing this right before submitting a bug report. I’ve run into this problem before but ended up just working around it. Coming back to it now, I thought it would have been fixed but it doesn’t look like it.

Can this be used to make a “viewing hole” through meshes that are in the way?

could you use the volume of a cone to do it?

(once it is working)

it sounds like something that could be worthwhile for sure.

Yes, though it you just want a hole without transparency a workaround would be to just move the face out of the way.

You could do this via the light data node (parent a lamp to the camera and use material nodes to increase the alpha of an object based on distance).

For general purpose object transparency though, you can use the object.color attribute.

Using object.color affects the entire object though. I need to adjust the transparency of individual faces on the object.

You could probably work around it by way of using node materials.

Use the vertex color output in the geometry and then use that (or a single color channel via the separate RGB node) to act as a driver for face transparency.

Regardless, I would still report the issue that setting vertex color alpha doesn’t work in GLSL, any genuine bug needs to be reported.

Yea, that’s actually what I had been doing for awhile. However, node materials are a bit more taxing in terms of performance. The rasterizer goes from ~7.5ms to ~13ms when using a node material in my current setup, so I’d prefer to be able to just use vertex colors.

I’ve gone ahead and submitted the bug report.

yeah, this sounds like a good feature/implementation

how do I check to see where a vertex is in world coordinates?

You can get a vertex’s world position like this:

vertexPosition = obj.worldTransform * vert.getXYZ()

Strange that you say it doesn’t work in glsl. I’ll have to play aroung a little when I’m home. Have you checked the relevant boxes in your material setting (ie teansparency, vertex color etc). You probably have though.

Try setting the alpha to zero on the material?

That’s what I wanted to make sure of before submitting the bug report. They’re both checked as you can see in the file.

Yeah, looks like it’s not working. An easy workaround would be to use a texture with varying amounts of opaqueness / transparency, and slide the UV values on the faces to match the transparency that you need the faces to be.

Does my video card radeon 9200 support pixel shader 1.1 and vertex shader 1.1?

Thanks,
Alfie Stewart
No Fault Accident Claims