Removing glow around pictures
Moderator: Coders of Rage
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Removing glow around pictures
Why don't you instead just use transparency and use SDL Image and use IMG_Load?
There's no place like ~/
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: Removing glow around pictures
FUCKIN' LIBRARIES, HOW DO THEY WORK?LeonBlade wrote:Why don't you instead just use transparency and use SDL Image and use IMG_Load?
I guess it has something to do with speed. Although I would think that reading in an image, removing the keyed color, and then displaying takes more time than just loading an image and displaying it without removing keyed colors (alpha pixels) unless there's some sort of surface merging going on (probably is).
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Removing glow around pictures
I don't even...xiphirx wrote:FUCKIN' LIBRARIES, HOW DO THEY WORK?LeonBlade wrote:Why don't you instead just use transparency and use SDL Image and use IMG_Load?
I guess it has something to do with speed. Although I would think that reading in an image, removing the keyed color, and then displaying takes more time than just loading an image and displaying it without removing keyed colors (alpha pixels) unless there's some sort of surface merging going on (probably is).
I just use IMG_Load myself... too much hassle with the whole color key bull shit.
There's no place like ~/
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Removing glow around pictures
Why not just load it as a texture with alpha support? That is afaik not slow as hell. And 3D isn't that much harder.
Re: Removing glow around pictures
omg, you guys have problems I did not even know about
PNG + SFML = No artifacts + Hardware Acceleration
PNG + SFML = No artifacts + Hardware Acceleration
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Removing glow around pictures
lol. I just use SDL for image loading & padding, then render with OpenGL, but I guess I'm okay with a fanboy =PK-Bal wrote:omg, you guys have problems I did not even know about
PNG + SFML = No artifacts + Hardware Acceleration
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Removing glow around pictures
Loading a texture with alpha support is absolutely not "slow as hell." I'm not sure how exactly SDL handles it (without hardware acceleration). I will have to look into whether it's emulating the transparency or using the hardware, but it's a waaaaaaaaaay cleaner solution than color masking. That shit is soooo outdated.
In the hardware accelerated world, you never see that. Textures are just saved with transparency, and it's way less hassle.
In the hardware accelerated world, you never see that. Textures are just saved with transparency, and it's way less hassle.
-
- Respected Programmer
- Posts: 387
- Joined: Fri Dec 19, 2008 3:33 pm
- Location: Dallas
- Contact:
Re: Removing glow around pictures
So far as the hardware is concerned, it's merely an additional operation that involves a few lerps or simple accumulation depending on the blend mode. The only thing you SHOULD be sacrificing here is the 1 to 32 bits of space (depending on image format) to store the alpha. You DO take a small hit from even enabling alpha blending for hardware accelerated API's but it's nothing to shake a stick at.
If its ridiculously slow, then SDL would be emulating it in software in which you must do this for every pixel that passes any scissoring or depth/backface culling, for every primitive for every pass and it would involve a read from the destination buffer. In this case...absolutely yes, it would be just retardedly slow without any optimization.
If its ridiculously slow, then SDL would be emulating it in software in which you must do this for every pixel that passes any scissoring or depth/backface culling, for every primitive for every pass and it would involve a read from the destination buffer. In this case...absolutely yes, it would be just retardedly slow without any optimization.
- Bakkon
- Chaos Rift Junior
- Posts: 384
- Joined: Wed May 20, 2009 2:38 pm
- Programming Language of Choice: C++
- Location: Indiana
Re: Removing glow around pictures
This... this is what I suggested...LeonBlade wrote:Why don't you instead just use transparency and use SDL Image and use IMG_Load?
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Removing glow around pictures
Yeah, that's along the lines of what I was thinking.qpHalcy0n wrote:If its ridiculously slow, then SDL would be emulating it in software in which you must do this for every pixel that passes any scissoring or depth/backface culling, for every primitive for every pass and it would involve a read from the destination buffer. In this case...absolutely yes, it would be just retardedly slow without any optimization.
If I recall correctly (from my teenage days of dicking with SDL), one of the results returned from the SDL hardware checks is alpha blending support. I'm fairly certain it is hardware accelerated--but I'm pretty sure that if this is not available, SDL definitely emulates.
...In this day and age though... if somebody's hardware doesn't support alpha blending, they can deal with shitty CPU emulation, imo.