Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (553)
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  
  Best free program that makes making masks for images easy?  (Read 2173 times)
0 Members and 1 Guest are viewing this topic.
Haksu
Guest
« Posted 2009-01-22 23:03:58 »

I need that to opengl transparency things. Is there any program which saves image, for example, to png and creates and saves a mask for it too?
Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #1 - Posted 2009-01-22 23:23:26 »

The png file format has full support for an alpha channel, from anywhere between a 1bpp bitmask, to an 8bpp full alpha channel.
Any paint program that supports manipulation of the alpha channel & correctly maps it onto the features of the png format should be fine.

Gimp is free, PSP has a 30 day shareware, Photoshop is expensive.
you choose your poison.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Haksu
Guest
« Reply #2 - Posted 2009-01-22 23:39:06 »

The png file format has full support for an alpha channel, from anywhere between a 1bpp bitmask, to an 8bpp full alpha channel.
Any paint program that supports manipulation of the alpha channel & correctly maps it onto the features of the png format should be fine.

Gimp is free, PSP has a 30 day shareware, Photoshop is expensive.
you choose your poison.

I looked at java port of nehe tutorial 20 (masking) and it used masking with png:s so why did it if png supports alpha channel? I have used pngs in java2d programs with that alpha thing and it works there but not with jogl I think. Maybe it works with better Image loader?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #3 - Posted 2009-01-23 22:47:15 »

make sure to include the gl functions in your intialization code:
glAlphaFunc(GL_GREATER, 0.01f); // sets aplha function
glEnable(GL_ALPHA_TEST); // allows alpha channels or transperancy

as well as loading the texture make sure the format is GL_RGBA not GL_RGB

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Haksu
Guest
« Reply #4 - Posted 2009-01-24 11:01:26 »

make sure to include the gl functions in your intialization code:
glAlphaFunc(GL_GREATER, 0.01f); // sets aplha function
glEnable(GL_ALPHA_TEST); // allows alpha channels or transperancy

as well as loading the texture make sure the format is GL_RGBA not GL_RGB

That's cool. Doing masks for all images would be annoying.

Thanks to both for your answers.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2009-01-24 16:56:01 »

Keep in mind GL_ALPHA_TEST is really slow.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Haksu
Guest
« Reply #6 - Posted 2009-01-24 18:22:36 »

Keep in mind GL_ALPHA_TEST is really slow.

Ok, thanks for the tip. I guess I will do some tests and look how much it slows down in my case.
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #7 - Posted 2009-01-24 18:32:28 »

Keep in mind GL_ALPHA_TEST is really slow.
Yes there is a performance hit, due to the extra check (that should go without saying), but it really is trivial.
I actually found masks to be slower.

In other words, if you want transperancy there is always going to be a performance hit.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #8 - Posted 2009-01-26 06:54:55 »

It is really not a trivial performance hit.

It is a really heavy operation. I have no explaination, but the framerate suffers a lot.

It also depends on the values passed into glAlphaFunc. With a textures with quite sharp edges, a value of 0.9 will have a totally different impact than say 0.5, even if there is a marginally difference in actually rendered pixels.

In the cases I tried, manually sorting items, and using normal blending, is faster than using GL_ALPHA_TEST.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
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.

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56

Norakomi (42 views)
2014-08-06 19:49:38
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!