Game Development Community

What does the PNG alpha value affect?

by Greg G · in Torque Game Engine Advanced · 02/26/2009 (1:35 pm) · 4 replies

I am working on a building with windows. Each window is made up of four panes of glass with a wood cross separating them. All of this is just a texture on a single polygon.

I want to apply a cube map to the windows so they look reflective. The problem is that if I use the alpha value in the diffuse texture to make sure the cube map only shows up on the glass, and not the wood, then the normal map applied to the wood doesn't show up either. In fact no shader effects show up on the wood it just shows the diffuse texture.

So it would appear that the alpha value of PNGs affects all shader effects and not just specular or cubemaps. Is this correct, and if so is there some way around this short of writing your own shader?

I am still very confused as to how to write an actual shader that would accomplish what I want to do.

#1
02/26/2009 (2:20 pm)
It affects both specular and cube map reflection. Since the specular is the effect that most pronounces the normal map, it might look like the normal map isn't doing anything, specially if your color map has too much lighting information on it (as usual for most wood textures made out from photos).
#2
02/26/2009 (2:44 pm)
I see, so is there any way to make it ONLY effect the cube map and not the specular? I suppose I am going to have to write my own shader if I want to do that correct?
#3
02/27/2009 (10:31 am)
Yes, you'll need to write your own shader for that. The basic custom shaders and looking at the dynamically generated shaders is a good way to see how it's done.
#4
06/02/2009 (4:31 pm)
try looking at this, just click logon