Shader question


(dwe_flame) #1

i have this shader



textures/outer_space/Portal_light
{
	qer_editorimage textures/outer_space/Spacelight_1.jpg
	q3map_surfacelight 4000	
	cull none
	surfaceparm nomarks
	qer_trans 0.5
	surfaceparm trans
	{
	map $lightmap 
	rgbGen identity
	tcGen lightmap 
	}
	{
	map textures/outer_space/Spacelight_1.jpg
	blendfunc filter
	blendFunc GL_DST_COLOR GL_ZERO
	//rgbGen const ( 0.241176 0.241176 0.241176 )
	}
	{
	map textures/outer_space/Spacelight_1.jpg
	blendfunc add
	rgbGen wave sin 0 1 0.9 0.2
	}
	{
	map textures/outer_space/Spacelight_1.jpg
	blendfunc add
	rgbGen wave sin 0 1 0.9 0.3 
	}
	{
	map textures/outer_space/Spacelight_1.jpg
	blendfunc add
	rgbGen wave sin 0 1 0.9 0.7 
	}
	{
	map textures/outer_space/Spacelight_1.jpg
	blendfunc add
	rgbGen wave sin 0 1 0.9 0.9 
	}
}

weks nice as a texture that gets brighter and draker, but i cant seem to make it like 50% transparant too.
anyone can help me out in this one ?


(stealth6) #2

make it a tga file and add an alpha layer that is grey all over (half white half black) is 50% transparent


(dwe_flame) #3

hummm, but i can also use the alpha from a other texture right ? this will save me space in the final pk3 file.

and not a very good shader maker, so what exactly should i do/add in the code ?


(stealth6) #4

hmm your right I seem to remember people taking about using another jpg image to define the transparency, but I don’t know how that works sorry.


(dwe_flame) #5

mmm plese some scripter / shader man can help us out here ? :rolleyes:


(merlin1991) #6

if you want to make it 50% transparent you can use something like “alphaGen const 0.5” on all stages


(dwe_flame) #7

ok, thanx, i will try that one.
do i need to make the image a TGA in that case ?


(dwe_flame) #8

mm it seems not to be working :confused:


(FireFly) #9

You can use a jpg image that has a black background:

textures/eltz/env/bluestar
{
qer_editorimage textures/eltz/env/bluestar.tga
surfaceparm nolightmap
surfaceparm	trans
surfaceparm nonsolid
surfaceparm nomarks
cull none

{
map textures/eltz/env/bluestar.tga
blendFunc GL_SRC_ALPHA GL_ONE
rgbGen identity
}

{
map textures/eltz/env/bluestar.tga
blendfunc add
rgbGen wave sin 0 1 0.9 0.2
}

{
map textures/eltz/env/bluestar.tga
blendfunc add
rgbGen wave sin 0 1 0.9 0.3
}
}

(dwe_flame) #10

that looks like a very nice one :slight_smile:
are you willing to share that one ? (attach the .tga)

i also did try something with water like it was done in siwa_water, and add lightmap to it :slight_smile:


(Detoeni) #11

are you willing to share that one ?

umm… he did.
its at the top of his post.
Although its a jpg texture, you still list it as tga in the shader

edit: o wait its 256x512 pic, doh. just crop it to the size you need.


(dwe_flame) #12

ok, is working great now
i only added the “q3map_surfacelight 100” to give it a little bit of the blue light touch :slight_smile:

thanx
i will probably use this in my map if you dont mind me to ?


(FireFly) #13

I don’t mind at all, feel free to use the image & shader in your own map…

I’m glad that I could help, good luck with your map. :slight_smile:


(dwe_flame) #14

for those that are curious, progress can be found here:

http://www.aqua-page.nl/1869forum/viewtopic.php?f=18&t=366
on last page are the most recent screenshots ofc :tongue: