Page 1 of 1
Texture transparency
Posted: Sun Oct 04, 2009 9:12 am
by N|K
How would one make a simple semi-transparent texture, say, with an opacity of 50%?
Re: Texture transparency
Posted: Sun Oct 04, 2009 9:35 am
by dONKEY
Grey alpha channel and appropriate shader script
Re: Texture transparency
Posted: Sun Oct 04, 2009 9:49 am
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'?!
Re: Texture transparency
Posted: Sun Oct 04, 2009 11:06 am
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.
Re: Texture transparency
Posted: Sun Oct 04, 2009 11:51 am
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.
Re: Texture transparency
Posted: Mon Oct 05, 2009 1:46 am
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.
Re: Texture transparency
Posted: Mon Oct 05, 2009 1:47 am
by N|K
Yeah, I was the entire texture 50% opaque.
Re: Texture transparency
Posted: Mon Oct 05, 2009 1:58 am
by N|K
Not working... Here is my shader:
textures/bla/bla
{
{
map textures/bla/bla.jpg
alphaGen const 0.5
}
}
Re: Texture transparency
Posted: Mon Oct 05, 2009 2:01 am
by obsidian
It's a general shader directive, q3map_alphaGen const
Re: Texture transparency
Posted: Mon Oct 05, 2009 2:04 am
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
}
}
Re: Texture transparency
Posted: Mon Oct 05, 2009 2:26 am
by $NulL
textures/bla/bla
{
{
map textures/bla/bla.jpg
alphaGen const 0.5
blendfunc blend
}
}
I think should work.
Re: Texture transparency
Posted: Mon Oct 05, 2009 2:34 am
by N|K
Hey man!
Awesome, it worked!
Thanks allot for that!
Re: Texture transparency
Posted: Mon Oct 05, 2009 8:19 am
by AEon
May need to remember this for the glass I use in AEcantw2...
Re: Texture transparency
Posted: Mon Oct 05, 2009 1:09 pm
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?!
Re: Texture transparency
Posted: Mon Oct 05, 2009 1:32 pm
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.