Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
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  
  Need help performing additive blending in Java2D  (Read 5372 times)
0 Members and 1 Guest are viewing this topic.
Offline Vey

Senior Newbie

« Posted 2009-02-10 13:47:16 »

I am making a 2D graphics engine using Java2D and I'm in need of help. I want to perform additive blending on my particles but I can not find a way that is fast enough for real-time drawing. Any hints?

I might also be interested in using the transparent pixels stored by photoshop and then replace my black-ish pixels with those.

For those who do not know what additive blending does, it "adds" the value of a pixel to draw to the pixel it's drawing to and thus a part of a picture will seem more transparent depending on how black it is since black==0.
Offline CommanderKeith
« Reply #1 - Posted 2009-02-10 14:04:39 »

Maybe try this library:

It has additive blending, and it can be accelerated by the java2d d3d pipeline.

I've used it once just to test it out and it worked pretty good, but I didn't use additive blending, i just used the bloom effect.

Offline Vey

Senior Newbie

« Reply #2 - Posted 2009-02-25 14:41:09 »

That does indeed look promising, but I can't seem to find a way to download it. I've talked to some teachers in school but after checking they all seem pretty clueless as well. One mentioned that it is included in the J3D package, but I checked and it wasn't in there.

I've obviously googled and checked the link for downloads but with no luck. So where can I get it? Thank you!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Wildern

Junior Devvie

« Reply #3 - Posted 2009-02-25 18:40:10 »

Hitting Google up for "com.sun.scenario" yielded a link that I shortened to get this one
Offline brackeen

Junior Devvie

« Reply #4 - Posted 2009-02-25 21:51:15 »

I think the problem is Scenario treats blend modes like an image filter (requires an input image, returns an output image), rather than just selecting the blend mode in Graphics2D like you would SrcOver or Xor.

Something called PhotoComposite got mentioned once - anyone know if it's going to make it into JDK 7?
Offline CommanderKeith
« Reply #5 - Posted 2009-02-26 04:14:27 »

Sun java2D engineer Chris Campbell mentioned it in his blog a while back, but I haven't seen anything since. I've got a feeling that the JavaFX work is taking priority for the time being:
Coming Soon: PhotoComposite
It's not officially approved (or integrated) yet, but I've been working on adding more blending modes to Java 2D, in addition to those already provided by AlphaComposite. Many of these modes come from traditional photography techniques, thus the name "PhotoComposite". Some modes are simple (Add, Multiply) and can be accelerated easily using OpenGL's built-in blending rules, others are more involved (ColorBurn, SoftLight) and benefit greatly from the use of shaders for efficient rendering.

Offline zammbi

JGO Coder

Medals: 4

« Reply #6 - Posted 2009-02-26 05:23:57 »

There was also this:

Which also says that they were going to try do "average, darken, lighten, color burn/dodge" for Java 7.

But if you want to do your own code for now there was this :

Current project - Rename and Sort
Offline Vey

Senior Newbie

« Reply #7 - Posted 2009-02-27 22:48:10 »

Thank you, I managed to import the package, gonna experiment with it tomorrow Smiley

Also yeah, PhotoComposite seems pretty interesting!
Pages: [1]
  ignore  |  Print  

Riven (847 views)
2019-09-04 15:33:17

hadezbladez (5795 views)
2018-11-16 13:46:03

hadezbladez (2603 views)
2018-11-16 13:41:33

hadezbladez (6211 views)
2018-11-16 13:35:35

hadezbladez (1499 views)
2018-11-16 13:32:03

EgonOlsen (4734 views)
2018-06-10 19:43:48

EgonOlsen (5793 views)
2018-06-10 19:43:44

EgonOlsen (3276 views)
2018-06-10 19:43:20

DesertCoockie (4175 views)
2018-05-13 18:23:11

nelsongames (5501 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 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‑
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!