Pages: [1]
  Print  
Author Topic: Transparency question (shaders)  (Read 9230 times)
baronofhell
Lesser Nub


Cakes 0
Posts: 103



« 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?
Logged
Neozuki
THIS ONE POST HERE SHOULD DO IT.


Cakes 0
Posts: 1


« Reply #1 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.
Logged
baronofhell
Lesser Nub


Cakes 0
Posts: 103



« Reply #2 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:



How do I make it look like this in the game?
Logged
tw3k
Lesser Nub


Cakes 0
Posts: 143



« Reply #3 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.
Logged
baronofhell
Lesser Nub


Cakes 0
Posts: 103



« Reply #4 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 Smiley )



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!

Logged
tw3k
Lesser Nub


Cakes 0
Posts: 143



« Reply #5 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.
Logged
dmn_clown
Posts a lot
*

Cakes 1
Posts: 1324


« Reply #6 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.
« Last Edit: March 22, 2007, 11:04:47 AM by dmn_clown » Logged

Pages: [1]
  Print  
 
Jump to: