Transparent Window


(Blowfish) #1

Ok, after 3 days of reading shader manuals, reading forum, xfireing friends, etc I give up. Can someone help me with this :

I made a 24 bits TGA file in Corel photopaint of a window. Corel doesnt save alpha channels in tga, but i can make a mask. I use this simple shader :

textures/DutchHaze/asd-raam
{
qer_editorimage textures/DutchHaze/asd-raam.tga
qer_trans .6
surfaceparm trans
surfaceparm alphashadow
surfaceparm pointlight
implicitBlend -
implicitMap textures/DutchHaze/asd-raam.tga
}

When I am in radiant 1.5 its all transparent because of the qer_trans .6 . In game its still non transparent. I thought maybe the alpha channel wasnt ok for radiant, so I opened it in gimp (latest version) and saved it again. Then compiled … but no luck. Gimp sees ita s a TGA with alpha channel.

Files :

http://www.p0wnd.nl:666/temp/asd-raam.tga
http://www.p0wnd.nl:666/temp/asd-raam2.tga

Also read : http://4newbies.planetwolfenstein.gamespy.com/cmmarkers.htm :smiley:


(Qualmi) #2

hm…try this. make a picture with corel. make alpha-channel, save as png. open it with gimp, export to tga.

maybe this work, if you have not tried this already. dunno if i get your post right…


(Berzerkr) #3

Hm, maybe this shader works:

textures/DutchHaze/asd-raam
{
	surfaceparm trans
	surfaceparm alphashadow
	surfaceparm pointlight
	implicitBlend -
}

It’s the same as it’s used for the transparent windows in fuledump.


(MrLego) #4

I threw one of your images in the alpha folder and used the following shader:

textures/alpha/asd-raam
{
	cull disable
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm alphashadow
	surfaceparm metalsteps
	surfaceparm pointlight
	surfaceparm trans
	implicitMask -
}

implicitmask subtratcts the alpha channel from the main image - blend is looking to combine multiple images.

This is the result:


(Pande) #5

Using simple stages would be easier for this, Blowfish.

textures/alpha/asd-raam
{
qer_editorimage textures/alpha/asd-raam
qer_trans 0.6
cull disable
nomipmaps
nopicmip
surfaceparm nomarks
surfaceparm alphashadow
surfaceparm metalsteps
surfaceparm pointlight
surfaceparm trans
{
map $lightmap
rgbGen identityLighting
}
map textures/alpha/asd-raam.tga
blendfunc blend
}
}


(Pande) #6

Using simple stages would be easier for this, Blowfish.

textures/alpha/asd-raam
{
qer_editorimage textures/alpha/asd-raam
qer_trans 0.6
cull disable
nomipmaps
nopicmip
surfaceparm nomarks
surfaceparm alphashadow
surfaceparm metalsteps
surfaceparm pointlight
surfaceparm trans
{
map $lightmap
rgbGen identityLighting
}
map textures/alpha/asd-raam.tga
blendfunc blend
}
}


(Blowfish) #7

[quote=Berzerkr;188252]Hm, maybe this shader works:

textures/DutchHaze/asd-raam
{
    surfaceparm trans
    surfaceparm alphashadow
    surfaceparm pointlight
    implicitBlend -
}

It’s the same as it’s used for the transparent windows in fuledump.[/quote]

Tried it, didnt work :cool: Thanks anyway…


(Blowfish) #8

[quote=MrLego;188253]I threw one of your images in the alpha folder and used the following shader:

textures/alpha/asd-raam
{
    cull disable
    nomipmaps
    nopicmip
    surfaceparm nomarks
    surfaceparm alphashadow
    surfaceparm metalsteps
    surfaceparm pointlight
    surfaceparm trans
    implicitMask -
}

implicitmask subtratcts the alpha channel from the main image - blend is looking to combine multiple images.

This is the result:[/quote]

Well that looks fine by me… :slight_smile: . Does it matter which folder its in, or is it just the implicitMask -in the shader that removes the alpha channel ?


(Blowfish) #9

[quote=Pande;188262]Using simple stages would be easier for this, Blowfish.

textures/alpha/asd-raam
{
qer_editorimage textures/alpha/asd-raam
qer_trans 0.6
cull disable
nomipmaps
nopicmip
surfaceparm nomarks
surfaceparm alphashadow
surfaceparm metalsteps
surfaceparm pointlight
surfaceparm trans
{
map $lightmap
rgbGen identityLighting
}
map textures/alpha/asd-raam.tga
blendfunc blend
}
}[/quote]

Mmmhh… you lost me there. Stages ? Will test this and see how things will look.


(CptnTriscuit) #10

The problem is in your shader. Here in your original shader you are invoking implicitBlend and than overwriting it with implicitmap. Take a look at your last two lines.


textures/DutchHaze/asd-raam
{
qer_editorimage textures/DutchHaze/asd-raam.tga
qer_trans .6
surfaceparm trans
surfaceparm alphashadow
surfaceparm pointlight
implicitBlend -
implicitMap textures/DutchHaze/asd-raam.tga
}

The solution is to simply remove the last line. So it should look like this:


textures/DutchHaze/asd-raam
{
qer_editorimage textures/DutchHaze/asd-raam.tga
qer_trans .6
surfaceparm trans
surfaceparm alphashadow
surfaceparm pointlight
implicitBlend -
}

:slight_smile:


(Blowfish) #11

Ok, thanks. And since all shader experts are here… another question. Do all textures need shaders ? If so, is there something like a default shader value ?


(CptnTriscuit) #12

There is a default for textures that do not have a defined shader value. But it is generally good practice to write a shader for each of your textures; especially since ET implicit shader directives can do most of the work for you.

  • implicitMask
  • implicitMap
  • implicitBlend

(Blowfish) #13

I must be doing something very wrong, since none of the options worked for me. I changed the shader file. Do I need to rebuild ? I tried the 1th and 3th build option in radiant 1.5 Still no effect on window…


(CptnTriscuit) #14

Few things to try:

Have you added ‘DutchHaze’ to shaderlist.txt in your etmain/scripts directory? If not, add it.

Also, in GTKRadiant, make sure you select textures>Flush & Reload Shaders after modifying any of your shaders or shaderlist.txt.

Recompile.


(Blowfish) #15

Yes, DutchHaze is in the shaderlist.txt and i see that its being used in the console. Just one funny thing. When i open the file in notepad, its nice formated. When I open other shaders in notepad, they are not nicely formated, but all behind eachother.

Before I compile I always do a flush reload. Does it matter which of the compile options I use ?


(CptnTriscuit) #16

Eh, for now just use a compile that has includes the -bsp -vis & -light switches.

Can you post an ingame screenshot of your window after you try again? I might get a better idea of whats going wrong.


(Blowfish) #17

textures/DutchHaze/asd-raam
{
qer_editorimage textures/DutchHaze/asd-raam.tga
qer_trans .6
surfaceparm trans
surfaceparm alphashadow
surfaceparm pointlight
implicitBlend -
}

textures/DutchHaze/asd-raam2
{
qer_editorimage textures/DutchHaze/asd-raam2.tga
qer_trans .6
surfaceparm trans
surfaceparm alphashadow
surfaceparm pointlight
implicitBlend -
}

http://screenshot.xfire.com/screenshot/natural/ceb3ff40219928a173d83d2e79e4b26462412d2e.png

Cant see trough windows…


(Blowfish) #18

OK, Found my problem ! :smiley: Knew it was a clasic error… forgot to delete dutchhaze.pk3 files from etmain when i tested it on the server…

IT WORKS !! :slight_smile: Thank you all for the help …


(CptnTriscuit) #19

ah, good! It’s often something simple like that.


(stealth6) #20

you could always just ask a friend to make the window hehe (alpha channel and 32bit tga) then you could avoid most of this hassel lol