Page 1 of 1

Best way to emulate fullbrights/lumas with shaders?

Posted: Sun Jun 22, 2014 10:55 pm
by KillPixel
Using shaders is a new thing for me and I'm having difficulty figuring out how to do this.

I would like to have a texture that acts as a background and have another texture to lay over top. For the top texture, I want to have specific areas to by invisible while others to be fully opaque and fullbright.

I've tried blendfunc add but some of the background texture is visible in the top one. What's the best way to do this? Alpha channels?

Here are two test files I'm using, one background (blue.tga) and the overlay (blue_on.tga). My goal is to have "blue_on.tga" to lay over blue, I want the black to be invisible and the green square to be 100% opaque and fullbright.

http://www.killpixel.com/kpcn/shaders/

This got me close, but still no dice.

Code: Select all

textures/tech/blue
{  
	q3map_lightimage textures/tech/blue_on.tga
	surfaceparm nodlight
	surfaceparm nomarks
	{
		map textures/tech/blue.tga
	}
	{
		map $lightmap
		blendFunc filter
	}	
	{	
		map textures/tech/blue_on.tga
		blendfunc add
	}		
}
Any help would be greatly appreciated, thanks :)

Re: Best way to emulate fullbrights/lumas with shaders?

Posted: Sun Jun 22, 2014 11:03 pm
by obsidian
Yes, you'll need an alpha channel with the green texture, as well as blendFunc blend.

Re: Best way to emulate fullbrights/lumas with shaders?

Posted: Sun Jun 22, 2014 11:12 pm
by KillPixel
Worked like a charm, thanks!

:up: