Texture transparency

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Texture transparency

Post by N|K »

How would one make a simple semi-transparent texture, say, with an opacity of 50%?
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Texture transparency

Post by dONKEY »

Grey alpha channel and appropriate shader script
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

It must be easier than that?!

I added 'qer_trans 0.5' in the shader and the result is that the relative texture is 50% transparent in the editor.. However, I am aftering it being 50% transparent in-game.
Is there a simple command for the shader than can make it transparent in the game like in the editor?.. 'surfaceparm trans 0.5'?!
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Texture transparency

Post by AEon »

qer_trans 0.5 is a strictly GTKradiant relevant command, the game ignores it.

IIRC, you have to create the appropriate 32bit tga file for a 50% transparency. Obsidian would know this more precisely.
Tabun
Posts: 76
Joined: Fri Aug 07, 2009 4:26 pm

Re: Texture transparency

Post by Tabun »

No need to actually make the alpha channel, I think. You can just use any old JPG and add: alphaGen const 0.5 to get 50%/grey alpha.
[size=85][url=http://www.tabun.nl]www.tabun.nl[/url][/size]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Texture transparency

Post by obsidian »

Tabun wrote:No need to actually make the alpha channel, I think. You can just use any old JPG and add: alphaGen const 0.5 to get 50%/grey alpha.
Ding ding ding! Assuming you want the ENTIRE texture to be 50% opaque.
[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]
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

Yeah, I was the entire texture 50% opaque.
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

Not working... Here is my shader:

textures/bla/bla
{
{
map textures/bla/bla.jpg
alphaGen const 0.5
}
}
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Texture transparency

Post by obsidian »

It's a general shader directive, q3map_alphaGen const
[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]
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

Is still not working; has actually made it worse.. The texture is not loading now.
Here is the shader I used:

textures/bla/bla
{
{
map textures/bla/bla.jpg
q3map_alphaGen const
}
}
$NulL
Posts: 100
Joined: Wed Mar 27, 2002 8:00 am

Re: Texture transparency

Post by $NulL »

textures/bla/bla
{
{
map textures/bla/bla.jpg
alphaGen const 0.5
blendfunc blend
}
}

I think should work.
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

Hey man!

Awesome, it worked!

Thanks allot for that!
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Texture transparency

Post by AEon »

May need to remember this for the glass I use in AEcantw2...
N|K
Posts: 63
Joined: Wed Sep 23, 2009 11:11 am

Re: Texture transparency

Post by N|K »

Hey I was out the door earlier on today when I verified transparency, but now that I have taken the time to look at it properly I have discovered that although it is transparent, a texture behind it that is scrolling does not show through it... Anyone know what could be causing this?!
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Texture transparency

Post by AEon »

Some of my template_ae textures were/are showing this issue as well. It might be best for you to copy/paste the primary "glass" shader plus the shader that is not shown into this thread. That way everyone could take a closer look. A screenshot may also help.
Post Reply