Shaders

Moderator: Rab,d

Post Reply
Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Shaders

Post by Boons » Fri Sep 16, 2011 5:07 pm

textures/skies/desert_1
{
qer_editorimage textures/skies/desert_1.tga
q3map_lightImage textures/skies/bright_sun.tga
skyparms - 1024 -
q3map_sun 1.0 1.0 1.0 800 225 45
q3map_skylight 150 3
//q3map_surfacelight 200
surfaceparm sky
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm nodlight
surfaceparm nomarks
{
map textures/skies/desert_1.tga
tcMod scale 1 1
rgbGen identityLighting
}
{
map textures/skies/desert_1.tga
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
rgbGen identityLighting
}
}


If I just link a texture to this I can make it a "sky" shader?
Image
Image

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Fri Sep 16, 2011 5:11 pm

Also there is no specific `grasssteps`surface parm... is that something that needs to be coded into the engine?
Image
Image

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Fri Sep 16, 2011 6:28 pm

textures/common/glass
{ qer_editorimage textures/common/glass.jpg
qer_trans 0.4
surfaceparm fog
surfaceparm trans
fogparms ( 0.8 0.815686 0.717647 ) 5000
fogonly

{
map textures/common/glass.jpg
map $lightmap
rgbGen identity
}

}


//textures/common/glass
//{
//qer_editorimage textures/common/glass.jpg
//q3map_normalimage textures/common/glass.jpg
//q3map_lightmapsamplesize 1x1
//{
//map $lightmap
//rgbGen identity
//}
//{
//map textures/common/glass.jpg
//blendFunc blend
//}
//}


Why is it not see through? lol
Image
Image

User avatar
Rab,d
Developer
Developer
Posts: 3301
Joined: Tue Dec 21, 2004 5:20 pm
Location: Charlotte, NC USA
Contact:

Re: Shaders

Post by Rab,d » Fri Sep 16, 2011 6:52 pm

Boons wrote:textures/common/glass
{ qer_editorimage textures/common/glass.jpg
qer_trans 0.4
surfaceparm fog
surfaceparm trans
fogparms ( 0.8 0.815686 0.717647 ) 5000
fogonly

{
map textures/common/glass.jpg
map $lightmap
rgbGen identity
}

}


//textures/common/glass
//{
//qer_editorimage textures/common/glass.jpg
//q3map_normalimage textures/common/glass.jpg
//q3map_lightmapsamplesize 1x1
//{
//map $lightmap
//rgbGen identity
//}
//{
//map textures/common/glass.jpg
//blendFunc blend
//}
//}


Why is it not see through? lol
Transparent textures require a .shader(.shd) file AND an alpha channel. The texture format must also support alpha channels. .jpg does not. An alpha channel is a grescale image(layer) that shows the engine what part of the texture is to be solid and what part is transparent.

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Fri Sep 16, 2011 7:04 pm

ah so only 32bit tgas... rgr thanks
Image
Image

User avatar
Rab,d
Developer
Developer
Posts: 3301
Joined: Tue Dec 21, 2004 5:20 pm
Location: Charlotte, NC USA
Contact:

Re: Shaders

Post by Rab,d » Fri Sep 16, 2011 7:20 pm

Boons wrote:ah so only 32bit tgas... rgr thanks
.png also works. And i think it takes less memory with only some loss of quaility. I haven't experimented with it much.

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Sun Sep 18, 2011 5:00 pm

I added a alpha channel to the texture and saved it as a tga.. still no luck :S
Image
Image

User avatar
Rab,d
Developer
Developer
Posts: 3301
Joined: Tue Dec 21, 2004 5:20 pm
Location: Charlotte, NC USA
Contact:

Re: Shaders

Post by Rab,d » Sun Sep 18, 2011 6:44 pm

did you change the .shader to reflect the new extention?
Also...you have to make or update the .shd file for EGL, too. :)
the .shader files are only for the map making process..because that's what q3map2 recognizes....but EGL uses the .shd files. They are placed in the /baseq2/scripts folder.

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Sun Sep 18, 2011 7:14 pm

Ah yes now it works :D thanks rabies
Image
Image

User avatar
InFerNo
Developer
Developer
Posts: 4371
Joined: Mon Aug 25, 2003 11:07 am
Location: dday2
Contact:

Re: Shaders

Post by InFerNo » Tue Sep 20, 2011 2:25 pm

Rab,d wrote:
Boons wrote:ah so only 32bit tgas... rgr thanks
.png also works. And i think it takes less memory with only some loss of quaility. I haven't experimented with it much.
Portable Network Graphics (PNG play /ˈpɪŋ/[2]) is a bitmapped image format that employs lossless data compression.
Image

Boons
Developer
Developer
Posts: 597
Joined: Sat Aug 20, 2005 6:36 pm

Re: Shaders

Post by Boons » Fri Sep 30, 2011 6:09 pm

FYI, you can use .jpg and the line alphagen const .5 to fake a "alpha channel" if you want it to be see through.

But what really fixed the problem was putting them both in the .shd and .shader folders.
Image
Image

Post Reply