How to make texture alpha visible in the editor?

How to make texture alpha visible in the editor?

I'm using C3D to make models and scenes for games, and I tend to use a lot of quads with partly transparent textures. My game Yoink shows the kind of visuals I'm trying to achieve - a kind of cardboard cutout effect with billboards.

With this in mind, is there any way I can make the alpha channel of a material's texture take effect in the editor as well as when rendered? As far as I can tell, textures with alpha channels always appear opaque in the editor. Am I doing something wrong, or is it just not possible?
 
Hi,
you can achieve both when you check on the "use alpha channel" property of the Material shader. See screenshot.

It's important that transparent object will be drawn last in the OpenGL preview. So move transparent objects always to the end of the list in the Object Browser.

By,
Martin
 
Great, that's pretty close to what I wanted! Thanks! Surprisingly, this is something that very few other modellers handle in an adequate way.

It strikes me that it's a bit tricky to get the objects into the right order to have them drawn properly. When there are several overlapping objects around, it's likely that no order would be correct for all of them at the same time. I imagine this is because you're using OpenGL's alpha blending and you don't want to sort blended polygons into depth order (which I totally understand, I also avoid doing things like that!).

I wonder if this would be an acceptable alternative to depth sorting: how about using glEnable(GL_ALPHA_TEST) / glAlphaFunc() to prevent totally transparent parts of shapes from being drawn? It's obviously not totally correct for anything which is partly transparent, but it would be close to perfect for everything else. It's also easy to program. ;)

One other observation... it seems that the alpha channel of a texture is applied in the editor even when the 'use alpha channel' checkbox is turned off. Seems like this might be a bug.
 
NCarter said:
It strikes me that it's a bit tricky to get the objects into the right order to have them drawn properly. When there are several overlapping objects around, it's likely that no order would be correct for all of them at the same time. I imagine this is because you're using OpenGL's alpha blending and you don't want to sort blended polygons into depth order (which I totally understand, I also avoid doing things like that!).

Depth sorting also only works for very simple geometry. You need depth peeling for arbitrary complex geometry which costs alot of resources and only works on Nvidia hardware scince you need a true 32 bit pipeline. :cry:

NCarter said:
I wonder if this would be an acceptable alternative to depth sorting: how about using glEnable(GL_ALPHA_TEST) / glAlphaFunc() to prevent totally transparent parts of shapes from being drawn? It's obviously not totally correct for anything which is partly transparent, but it would be close to perfect for everything else. It's also easy to program. ;)

Thanks for the tip. That is great idea. I've implemented the glEnable(GL_ALPHA_TEST) / glAlphaFunc() stuff. It will work in the next update.

NCarter said:
One other observation... it seems that the alpha channel of a texture is applied in the editor even when the 'use alpha channel' checkbox is turned off. Seems like this might be a bug.

I know that but removing that behavior is a little bit tricky so maybe once I rewrite the material system. Sorry.

By,
Martin
 
Martin said:
Thanks for the tip. That is great idea. I've implemented the glEnable(GL_ALPHA_TEST) / glAlphaFunc() stuff. It will work in the next update.
Great, I'll look forward to that! Thanks!
 
Back
Top