Alphatexture problem


(Donpedro) #1

Hi everybody
I wanted to create a decal. First of all, i created a 128*128 texture with alpha channel. I saved it in TGA format, and 32 bit. so, the problem is not on the texture. I put into textures into its folder, and i created the shader

textures/ammu/k_decal
{
	cull disable
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm alphashadow
	surfaceparm metalsteps
	surfaceparm pointlight
	surfaceparm trans
	implicitMask -

{
map textures/ammu/decalk.tga

}

What is the problem? In radiant and in the game i can see the “black” area at the texture, so ET didnt used the alpha channel?
thx for the help. :?


(nUllSkillZ) #2

With which program did you create the tga?
There’s one “{” to much in the shader.

Edit:

May be you can post a download link to the TGA.


(kamikazee) #3

Contrary to nUllSkillZ, I think there was one ‘}’ missing in your post seeing how you added a map stage.
Also, you are writing “implicitMask -” meaning it will take “textures/ammu/k_decal.tga” as the file for masking. Did you intended to use that file as the mask and are you sure the file exists?

If not, try this as your shader:

textures/ammu/k_decal
{
	cull disable
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm alphashadow
	surfaceparm metalsteps
	surfaceparm pointlight
	surfaceparm trans
	implicitMask textures/ammu/decalk.tga
}

(Donpedro) #4

I created in Photoshop CS2. I tried this:

textures/ammu/k_decal 
{ 
cull disable 
nomipmaps 
nopicmip 
surfaceparm nomarks 
surfaceparm alphashadow 
surfaceparm metalsteps 
surfaceparm pointlight 
surfaceparm trans 
implicitMask textures/ammu/decalk.tga
{
map textures/ammu/decalk.tga 
} 
}

and this, too:

textures/ammu/k_decal 
{ 
cull disable 
nomipmaps 
nopicmip 
surfaceparm nomarks 
surfaceparm alphashadow 
surfaceparm metalsteps 
surfaceparm pointlight 
surfaceparm trans 
implicitMask textures/ammu/decalk.tga
 
}

But always getting this result:
http://srapsrv.uw.hu/shad.jpg


(Donpedro) #5

Sorry try this
http://et-section.atw.hu/shad.htm


(C) #6

i’m missing lines in Your shader:
polygonOffset
sort decal

textures/ammu/k_decal 
{ 
    cull disable 
    nomipmaps 
    nopicmip 
    surfaceparm nomarks 
    surfaceparm alphashadow 
    surfaceparm metalsteps 
    surfaceparm pointlight 
    surfaceparm trans 
    polygonOffset
    sort decal
    { 
        map textures/ammu/decalk.tga 
    } 
}

The implicitMask command has to do with the transparency/translucency of Your texture (alpha-channel in the image).
You may need this in Your shader as well…

You are having problems with the stacking of 2 texture on top of eachother on the same plane.
That’s where “polygonOffset” and “sort decal” come in…

http://q3map2.everyonelookbusy.net/shader_manual/contents.htm


(Donpedro) #7

Doesnt work :frowning:
Here is the tga file:
http://srapsrv.uw.hu/decalk.zip


(kamikazee) #8

Could you also check if you really applied “textures/ammu/k_decal” to the brush?
Select that brush-face only by deselecting everything, then clicking it with Shift+Left mouse button. After that, hit ‘S’ to see which texture is used. If you accidentally applied the texture instead of the shader, it would be no use to try all different kinds of shaders. :wink:


(Donpedro) #9

With C’s shader i’ve got this result now:
http://et-section.atw.hu/shad.htm


(kamikazee) #10

Now I think it only needs 1 line added so it looks like this:

textures/ammu/k_decal 
{ 
    cull disable 
    nomipmaps 
    nopicmip 
    surfaceparm nomarks 
    surfaceparm alphashadow 
    surfaceparm metalsteps 
    surfaceparm pointlight 
    surfaceparm trans 
    polygonOffset
    sort decal
    { 
        map textures/ammu/decalk.tga 
        blendFunc blend
    } 
}

(Donpedro) #11

Thx kamikaze you got the point! Works, nice, thank you again.
My next question how can i create glittering things (like metals) with shader? With wave function?