Seeing other windows through non-transparent windowparts

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
ABit
Lance Corporal
Posts: 18
Joined: Sat Jul 05, 2003 10:35 pm

Seeing other windows through non-transparent windowparts

Post by ABit »

I'm using my own textures for my windows. Problem is i can see (only)other glass textures through the non-transparent parts of the window. I can't see other textures, like walls through the non-transparent parts. I think its some kind of interfering with the shader file.

This is how the shaders look like for all window textures i made:

textures/theBridge/window_vol_frame
{
qer_editorimage textures/theBridge/window_vol_frame.tga
qer_keyword myown
qer_keyword window
surfaceparm glass
{
map textures/theBridge/window_vol_frame.tga
blendFunc blend
}
{
map $lightmap
rgbGen identity
blendFunc GL_DST_COLOR GL_ZERO
}
}

Anyone has any ideas?
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

You are absolutely correct when you say the shader is the problem.
The fact is, you are missing half the shader.
Where is the glass texture itself?
Your only image is a frame, which also does not have the proper parameters.

Here is an example of a working window shader:

textures/window/yourwindow
{
qer_editorimage textures/window/yourwindow_frame.tga
qer_keyword broken
qer_keyword window
qer_keyword glass
surfaceparm trans
surfaceparm nonsolid
<--this lets you move through it.
cull none<--This lets you see through it.
{
map textures/window/yourwindow.tga
blendFunc blend
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
{
map textures/window/yourwindow_frame.tga
blendFunc blend
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}


Not to mention the fact that you are not supposed to see through non-transparent textures :shock:

Or perhaps I misunderstand what you are saying.

Kill Ya later!


Edit: perhaps you can post an image of exactly what the problem looks like......there may be other solutions..... :wink:

Edit #2......something else struck me as strange with that shader, then I realised what it was....it suddenly dawned on me.
The shader you have there is for a solid texture. You can't simply change a few surfaceparms and expect it to work properly.

If you are indeed only using 1 texture for your window, try something like this (change the tex name/directory as necessary for your window):

textures/window/mywindow
{
qer_editorimage textures/window/mywindow.tga
qer_keyword window
qer_keyword glass
qer_keyword masked
surfaceparm noimpact
surfaceparm nonsolid
surfaceparm trans
surfaceparm nolightmap
cull none
{
map textures/window/mywindow.tga
blendFunc blend
rgbgen constant .25 .25 .25
}
}


This should work for a window with only one mapped image. :D
Image
ABit
Lance Corporal
Posts: 18
Joined: Sat Jul 05, 2003 10:35 pm

Post by ABit »

Thanks for your reply, i will experiment with this.

but i don't understand what you mean in the first example. Why do i have to have a separate glass picture. Most of the shaders and pictures i looked at from the mohaa game, they use one shader for the frame with one alpha-channeled tga, and one for the broken version. Sometimes with an alpha-channeled environment picture for reflection etc.

I made mine as one frame picture, parts of the picture are frame (nontransparent) and parts are glass (transparent), the same for the broken one.

8-) to be sure, the shader i used worked for my windows, looks like glass, can see thru and are breakable, exept that the glass part of opposite windows are visible thru the nontransparent parts.
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

You can do this with a single image. It is not a rule that you cannot.

But, if you use simply 1 single image, then you must make sure that the
alpha layer does not include the frame. If it does, you will get the result that you described in your q.

In other words, when you make the alpha layer, anything that you do not wnat to see through should be white, and anything that will be transparent will be black or grey. So basically, your frame in the alpha layer needs to be white.

Kill Ya Later!
Image
ABit
Lance Corporal
Posts: 18
Joined: Sat Jul 05, 2003 10:35 pm

Post by ABit »

Thanxx Crunch, seems this will work.
Have to do a big study on shaders...... :wink:
Post Reply