Best way to emulate fullbrights/lumas with shaders?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
KillPixel
Posts: 49
Joined: Sun Jun 22, 2014 7:35 pm

Best way to emulate fullbrights/lumas with shaders?

Post 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 :)
[url=https://www.youtube.com/user/KillPixel]KillPixel@YouTube[/url]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

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

Post by obsidian »

Yes, you'll need an alpha channel with the green texture, as well as blendFunc blend.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
KillPixel
Posts: 49
Joined: Sun Jun 22, 2014 7:35 pm

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

Post by KillPixel »

Worked like a charm, thanks!

:up:
[url=https://www.youtube.com/user/KillPixel]KillPixel@YouTube[/url]
Post Reply