Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Sprite Alpha. What am I doing wrong?  (Read 3629 times)
0 Members and 1 Guest are viewing this topic.
Offline Dreamcatchermatt

Junior Member





« Posted 2011-01-13 22:59:30 »

Hi all,

Im taking a break from XNA (booo) Uni work to do some more Java Gaming.

I'm trying to make a isomorphic turret-defence using Slick2D and I think that I may have just kneecapped myself while making my Sprites. I spent 2 days doing these, so I hope i'm wrong Cheesy

Now, in XNA, and I was sure in Java2D, you can say that a color, say Color(255,45,255), is a chroma-key mask color, and anything with that will get removed. So, I went ahead and made a load of sprites like this:



Now that i've modeled and rendered all these things, I downloaded slick again and got going ... only to not be able to find a way of doing the above.

I realy dont want to re-render all of these things Cheesy

What am I doing wrong here?

Thanks guys,
Matt
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #1 - Posted 2011-01-13 23:11:19 »

You could just open the images in something like gimp and choose 'Colour to Alpha' to quickly make the pink into alpha.
Not sure if slick has a built in api to do this.
Online Riven
« League of Dukes »

JGO Overlord


Medals: 803
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2011-01-13 23:16:16 »

Please post a PNG image, not a JPG.

Maybe with some crafty code, it can be fixed.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Dreamcatchermatt

Junior Member





« Reply #3 - Posted 2011-01-14 00:35:27 »

I've tried fixing them in photoshop, with no luck.

Sorry, I uploaded the image to a facebook gallery, which seems to have swapped it to a jpg.

Here;


I need to re-work my rendering I think. The reason that I did it this way is because I want the ambient occlusion 'shadows' from the ground plain (also pink) so that once it's tranceparrent I get just hte shadows, and not the pink.

However, now that I've had a think about it some more, I dont this that this would work as therea re gradients of pink that i would want to remove the pink from, just leaving the colored shadows.

I get the shadows and AND render an alpha chanel, because the ground plain needs to have ) alpha to receive the shadows, so I think I need to figure out a way to do this. I've tryed re-rendering onto a white ground plane, but with similar problems.

If there's a code way of doing it, it would be great Smiley
That way I can have my cake and eat it. I think I may have just made this way to complicated for myself.

Thanks for the help guys.
Offline Dreamcatchermatt

Junior Member





« Reply #4 - Posted 2011-01-14 01:59:09 »

Hah, I found out why I'm having troubble removing the pink in Photoshop. When the oclusion renders, it includes 10% of the (pink) background into the resulting color - which is why I cant get rid of the damn stuff without loosing my other colors Cheesy

Cool, I can now manualy remove the pink mask in PS while keeping my shadows.
Offline SwampChicken
« Reply #5 - Posted 2011-01-18 01:24:10 »

Can't you just swap the pink to be 'transparent'?
Offline jezek2
« Reply #6 - Posted 2011-01-18 02:57:50 »

I would rather re-render it with proper alpha instead of this "mask" mess, and forget about this "great" technique in future. There is problem also with antialiasing, not just the ambient in pink areas. You would get poor result if processed somehow to obtain the alpha channel directly from the image.

Also I see slight irregularity in the antialiasing along the walls, was the image scaled?
Offline Nate

JGO Kernel


Medals: 149
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2011-01-18 04:11:55 »

Also I see slight irregularity in the antialiasing along the walls, was the image scaled?
* Nate squints
You see what?  Cheesy

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (12 views)
2014-10-02 14:36:20

Pippogeek (41 views)
2014-09-24 16:13:29

Pippogeek (32 views)
2014-09-24 16:12:22

Pippogeek (22 views)
2014-09-24 16:12:06

Grunnt (48 views)
2014-09-23 14:38:19

radar3301 (30 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (44 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!