Forum

a quick question about sprites

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

a quick question about sprites

Postby behind_you » Tue Mar 01, 2011 8:48 pm

messing with this 4 a while and got nowhere. Sprites normally have the pink color as their transparency color. How do i change it so that black becomes the transparent color? I only want to do this for sprites, but if i have to change if for lmps as well, its fine.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Re: a quick question about sprites

Postby Baker » Tue Mar 01, 2011 9:03 pm

behind_you wrote:messing with this 4 a while and got nowhere. Sprites normally have the pink color as their transparency color. How do i change it so that black becomes the transparent color? I only want to do this for sprites, but if i have to change if for lmps as well, its fine.


Whatever is palette color #255 is the transparent color, if I recall correctly. I assume you have fimg (if not download from the http://www.inside3d.com/frikbot/fimg/

You can't make black the transparent color [not realistically --- you'll break 20 things], but you can use something like Paintshop Pro to change all the instances of color 0 to color 255. This is a 2 minute task per image, it's easy and a hell of a lot less painful that any other method.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby behind_you » Tue Mar 01, 2011 9:10 pm

or i could simply replace color 255 in the palette with watever color i want to use as transparent. Why cant i use black, what will i 'break'?

Is what u explained about paintshop pro replacing color in every image? I didnt understand ur explanation
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Baker » Tue Mar 01, 2011 9:20 pm

behind_you wrote:or i could simply replace color 255 in the palette with watever color i want to use as transparent. Why cant i use black, what will i 'break'?


Because sprites use the Quake palette. And color #255 is the special transparent color and in the Quake palette that special transparent color is pink. You have to do a big chain of changes that would spiral into a huge mess.

The Quake Palette
Image
color 255 is the bottom, right pink at the very corner. You can't change it.

Changing color in an image:

Either Google it or search for a video on YouTube and you'll get something like this link:

http://www.youtube.com/watch?v=1oQi67-T5JA

If you can't figure out how to change a color in a 2D graphic, you'll have serious, serious problems trying to do whatever your project is.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby behind_you » Tue Mar 01, 2011 11:19 pm

no i know how to change a pictures color. I hav a question tho

Changing color 255 means that all sprites and lmps must hav the same color change. What else breaks? I can't think of anything besides sprites and lmps that use that pink for transparency.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Baker » Tue Mar 01, 2011 11:56 pm

behind_you wrote:no i know how to change a pictures color. I hav a question tho

Changing color 255 means that all sprites and lmps must hav the same color change. What else breaks? I can't think of anything besides sprites and lmps that use that pink for transparency.


I told you the easy way that takes 1 minute 45 seconds. You could have adjusted the sprite by now.

If a color is transparent, it is invisible to the engine. Black? Pink? Aqua? I fail to see how the transparent color matters, except if you don't know how to use an image editor and spending a lot of time on engine coding to solve a "Don't know how to use an image editor" problem isn't something I want to spend my time on, really.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby behind_you » Wed Mar 02, 2011 12:01 am

the color doesnt matter. I c. Its just that u caught me off guard when u said ALOT OF THINGS WILL BREAK!!! Thnx 4 ur input!

I know how to edit images. Im only a noob at quakec and source code. Nothing else.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Baker » Wed Mar 02, 2011 12:05 am

behind_you wrote:the color doesnt matter. I c. Its just that u caught me off guard when u said ALOT OF THINGS WILL BREAK!!! Thnx 4 ur input!

I know how to edit images. Im only a noob at quakec and source code. Nothing else.


Look I know, but I want to emphasize "the easiest route". If you are gonna get stuff, go for the easy win. Not the 40-year journey through the desert, ya know :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby metlslime » Wed Mar 02, 2011 12:16 am

Black? Pink? Aqua? I fail to see how the transparent color matters,


For engines that have the "pink edges on sprites" bug (which is most of them), changing it to black will give you "black edges on sprites" which could be preferable.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby behind_you » Wed Mar 02, 2011 12:16 am

i guess. But i hate the pinky color. To death. Im gonna make it halflife's transparent color (r 0, b 255, g 0) its easier to work with and a lot of textures ive been making blended with the pink color causing ugly holes in the finished product
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby behind_you » Wed Mar 02, 2011 12:20 am

metlslime wrote:
Black? Pink? Aqua? I fail to see how the transparent color matters,


For engines that have the "pink edges on sprites" bug (which is most of them), changing it to black will give you "black edges on sprites" which could be preferable.


Does proquake psp have that bug? I havent noticed anything of the sort
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Baker » Wed Mar 02, 2011 12:28 am

behind_you wrote:Does proquake psp have that bug? I havent noticed anything of the sort


Nope. :D Like what metslime suggested, ProQuake PSP changes it to "black edges" on the sprite.

behind_you wrote:i guess. But i hate the pinky color. To death. Im gonna make it halflife's transparent color (r 0, b 255, g 0) its easier to work with and a lot of textures ive been making blended with the pink color causing ugly holes in the finished product


I am thinking you don't understand that Quake sprites are 8-bit color, not 24-bit color. http://quakery.quakedev.com/qwiki/index ... ke_palette
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby behind_you » Wed Mar 02, 2011 12:34 am

offtopic:

Hey baker, whens next version of proquake psp comin out?
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Baker » Wed Mar 02, 2011 12:37 am

behind_you wrote:offtopic:

Hey baker, whens next version of proquake psp comin out?


Unknown. It is a distant 4th place on my priority list. I have a tournament mod I am writing, server security controls I am writing for NetQuake and a major reworking of Engine X that is in-progress.

Probably after those the main reason to update ProQuake PSP is in conjunction with a PSP mod I am making that will require new features.

So I don't see a ProQuake PSP update happening before July, sadly.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby behind_you » Wed Mar 02, 2011 12:45 am

july?! :( Well, i look forward to your other releases.

Btw, i tried ur psp proquake external texture support. I got a bunch of cant find certain pcx errors then it crashes. Whats with that? I only want to use one external texture.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest