OpenArena Message Boards

OpenArena Contributions => Development => Topic started by: baronofhell on March 21, 2007, 02:42:21 PM



Title: Transparency question (shaders)
Post by: baronofhell on March 21, 2007, 02:42:21 PM
Changing qer_trans value changes image transparency in the editor.

How do I do that in the game? Can it be done with any images like in the editor?

Or, do jpegs or tgas have to be specially created?


Title: Re: Transparency question (shaders)
Post by: Neozuki on March 22, 2007, 12:33:29 AM
Unless its different in the editor, Jpgs don't support transparency.
I know png's and tga's do though.


Title: Re: Transparency question (shaders)
Post by: baronofhell on March 22, 2007, 09:28:57 AM
In editor textures/base_floor/clanggrate.jpg looks like this when qer_trans it set to 0.4:

(http://home.comcast.net/~dadaniel30/sshots10.JPG)

How do I make it look like this in the game?


Title: Re: Transparency question (shaders)
Post by: tw3k on March 22, 2007, 09:46:00 AM
here clanggrate.jpg saved out as a tga with an alpha channel

I'm not sure if that will help but I've been wondering how an alpha channel effects things.


Title: Re: Transparency question (shaders)
Post by: baronofhell on March 22, 2007, 10:13:05 AM
Tw3k

I put the texture you posted and this is how it looks in game. Do I have to write a shader for it? (I'm not good with shaders :) )

(http://img376.imageshack.us/img376/5899/sshots11cr1.jpg)

If you look at the previous image, you can see through the actual metal part in the grate. That is what I'm trying to get.

Cheers!



Title: Re: Transparency question (shaders)
Post by: tw3k on March 22, 2007, 10:19:57 AM
I really don't know but I think you do need to write a shader for it. clown would know and help there.
I think that alpha channel is wrong in that tga. should be inversed.


Title: Re: Transparency question (shaders)
Post by: dmn_clown on March 22, 2007, 11:02:58 AM
Code:
textures/base_floor/clanggrate_trans
{
          qer_editorimage textures/base_floor/clanggrate.jpg
          {
                      map textures/base_floor/clanggrate.jpg
                      blendfunc add
                      rgbgen identity
          }
          {
                      map $lightmap
                      blendfunc filter
          }
}

or something like that.