Setting Background Transparency of new Force Icons -1 reply

Please wait...

Twin Blade

I don't spend enough time here

50 XP

19th January 2004

0 Uploads

27 Posts

0 Threads

#1 6 years ago

Hello,

I finished my own set of force icons, but they do not show up properly in game. There is no background transparency, so they just show up like boxes. How can I set the transparency of the icons? :) I tried with black and white colors - neither worked. The icons are 8-bit .TGA files straight from PhotoShop CS3.

Thanks in advance




Silverfang22

Knight Fall Operative

50 XP

7th January 2007

0 Uploads

485 Posts

0 Threads

#2 6 years ago

You need to give them shaders if you want to make black backgrounds transparent.




Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#3 6 years ago

In particular, you need a blending function. Take a peek at some base shaders and graphics.




Twin Blade

I don't spend enough time here

50 XP

19th January 2004

0 Uploads

27 Posts

0 Threads

#4 6 years ago

Emmm... okay. Well I have no clue about shadering whatsoever. :D Can someone help me in this instance then? :) What I need is background color of black to be transparent - and if opacity of the icons can be set too, that would rock. That's all I need really. Naturally, I will add you to my credit list in README when I release this for download.

EDIT: Hmm - I wonder if it's possible to make them shiny as well? You know like JK2 when you gain a new force power? The new/updated force power shines a bit. I wonder if it works to put it in here as well. :D If so then i may need a good shadering tutorial which explains the different meanings of coding. :) Maybe one of you pros have it?




DarthStevenus

GF is my bext friend *hugs GF*

50 XP

18th December 2009

0 Uploads

909 Posts

0 Threads

#5 6 years ago

There's not really any tutorials for writing shaders. It's kind of something you just have to do yourself, learning from the base shaders and the Q3map2 shader manual:

Q3Map2 Shader Manual: Table of Contents

To give you a basic idea of how they work though, here are a few general guidelines.

All shaders have a format similar to this:

nameofshader //A general name, usually the path to the image being used { some commands //some shaders may have nothing here { more commands //there can be several of these stages } }Here's one of the base shaders as an example:

gfx/misc/lightningFlash { cull twosided { map gfx/misc/lightningflash blendFunc GL_ONE GL_ONE rgbGen vertex } }The line 'map gfx/misc/lightningflash' is the path to your image (usually a jpg, sometimes a png or tga). The line below it, 'blendFunc GL_ONE GL_ONE' is the blend function of the image. GL_ONE GL_ONE (also known as add) will make all the white areas of your image fully opaque, and the black parts fully transparent. Those are probably the two most important lines of the shader. I'd say ignore 'cull twosided' and 'rgbGen vertex' for now. In fact I think you could probably leave them out. So your shader would look something like this:

gfx/yourfolder/yourforceicon { { map gfx/yourfolder/yourforceicon blendFunc add } }




Twin Blade

I don't spend enough time here

50 XP

19th January 2004

0 Uploads

27 Posts

0 Threads

#6 6 years ago

Magnificent! They work lovely! Thank you very much for your help. :) :) :) :) Now all I need to do is just give them some shine - or "glow" if possible, so they just don't look like ordinary icons, but get some life too. Thank you so much!

EDIT: By the way, my icons don't seem to be very detailed in-game, despite me putting on quite an effort to make them very detailed. haha Do you perhaps know a way how to make it possible in-game? :) I was checking a little on that page with stuff where it says "detail" haha, but so far no luck. :D




jk3editor

Retard Hungarian Modder

50 XP

21st August 2008

0 Uploads

1,520 Posts

0 Threads

#7 6 years ago

JKA's render is not perfect... :D The basic JKA textures looks very cool, but in-game they are not so detailed :P




DarthStevenus

GF is my bext friend *hugs GF*

50 XP

18th December 2009

0 Uploads

909 Posts

0 Threads

#8 6 years ago

What exactly do you mean by 'shiny'? Do you mean like a glow? Or do you want it to look metallic or something?




Twin Blade

I don't spend enough time here

50 XP

19th January 2004

0 Uploads

27 Posts

0 Threads

#9 6 years ago

@jk3editor: Yups. Noticed it. :D Haha

@DarthStevenus: Yes - a little of both in fact. :) Shiny metallic, with a nice glow. All the icons are colored according to alignment (green for Light Side, blue for Neutral and red for Dark Side), and they have a colored fractal pattern as background. So... a shiny metallic looking icons with a nice glow as bkg would be awesome. :)




Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#10 6 years ago

To reduce blurring of the icons, try adding the 'nopicmip' keyword to the main stage of the shader (i.e. on a separate line after blendFunc) You may also want nomipmap to disable "mipmapping" (A technique used to avoid aliasing/pixelated images when downscaling them)

<3 this shader manual