brandonborkholder / glg2d

Graphics2D wrapper for JOGL
77 stars 31 forks source link

implement a shader-based pipeline #3

Open brandonborkholder opened 12 years ago

brandonborkholder commented 12 years ago

Initial work has already been done on a shader-based pipeline, see e9db0c1043be735f0bd68d19058bf2e7a915f7ff. We should extend this to cover the entire functionality of java.awt.Graphics2D.

ghost commented 12 years ago

In your humble opinion, which functionalities are particularly difficult to implement in the fixed pipeline but very easy to implement in the shader based pipeline? I hope you won't drop the former.

brandonborkholder commented 12 years ago

I haven't found anything that easier to implement in a shader than it is on the CPU. However, I'd like to build a shader pipeline so that glg2d is usable on mobile devices with OpenGL ES. I also think that some things can be faster in a shader than on the GPU. For example, StrokeShader.ghttps://github.com/brandonborkholder/glg2d/blob/master/src/main/java/glg2d/impl/shader/StrokeShader.gtakes a path and draws it using the properties for a BasicStroke object. This could be optimized even more using NVidia's Path api.

Graphics2D.setPaint(Paint) is one method that may be easier with a shader (if you give it some non-constant color). But I haven't implemented this yet and am not sure that's true.

However, rest assured I'm not dropping the fixed function pipeline (using GL2 profile). I know that some people using glg2d are using it on old hardware and don't have the latest video hardware.

ghost commented 11 years ago

You speak about mobile devices. Is it possible to build GLG2D without AWT?

brandonborkholder commented 11 years ago

Not without AWT. I'm assuming that you have the full JVM, but only OpenGL ES2.