LWJGL Forum

Programming => General Java Game Development => Topic started by: Onno on December 01, 2006, 11:17:41

Title: OpenVG Support through Amanith?
Post by: Onno on December 01, 2006, 11:17:41
Hi guys,

I'm new to LWJGL (and game development). So far I like what I see very much.
Since there is already support for OpenGL and OpenAL, I was wondering if OpenVG support was being planned for a future version as well? Vector graphics may come in handy during 2D game development.

I noticed the Amanith Framework (http://www.amanith.org) is Open Sourced. It provides an OpenGL accellerated OpenVG implementation so it will work on todays graphics cards.
It is written in C++ and already seems to have a Python binding available, but I couldn't find any Java bindings. I think it would fit in well with LWJGL.
Title: OpenVG Support through Amanith?
Post by: Matzon on December 01, 2006, 12:42:32
I have personally looked at it before (when it wasn't open sourced), however I'm not sure if there is a general interest in it?
Title: hmmmmmmmm...
Post by: Fool Running on December 01, 2006, 14:34:01
Looks like it would be nice to have a Java binding.  8)
Title: OpenVG Support through Amanith?
Post by: elias4444 on December 01, 2006, 16:15:30
I wouldn't complain if it was added (as I really like vector graphics, and would love to use them if possible). The possibility of turning vector graphics into openGL textures seems kind of interesting.
Title: OpenVG Support through Amanith?
Post by: Onno on December 01, 2006, 19:02:49
Quote from: "Matzon"
I have personally looked at it before (when it wasn't open sourced), however I'm not sure if there is a general interest in it?

I think there would be quite a few types of 2D games that could benefit from it. Point and Click adventures like Monkey Island 3 would be good candidates, but it would also give you high quality sprites and backgrounds to target a large range of screen resolutions in comic-style arcade games.
Title: OpenVG Support through Amanith?
Post by: Matzon on December 01, 2006, 21:08:32
Quote from: "Onno"
Quote from: "Matzon"
I have personally looked at it before (when it wasn't open sourced), however I'm not sure if there is a general interest in it?

I think there would be quite a few types of 2D games that could benefit from it. Point and Click adventures like Monkey Island 3 would be good candidates, but it would also give you high quality sprites and backgrounds to target a large range of screen resolutions in comic-style arcade games.
just use slick for that - http://slick.cokeandcode.com
Title: OpenVG Support through Amanith?
Post by: kevglass on December 01, 2006, 21:17:56
Vector graphics generally would be a good add.

Kev
Title: OpenVG Support through Amanith?
Post by: Onno on December 01, 2006, 21:27:11
Quote from: "Matzon"
just use slick for that - http://slick.cokeandcode.com

I am using that :P
But it uses LWJGL under the hood and thus doesn't support vector graphics. Everything is still bitmapped.
If you simply use OpenGL for your sprites/backgrounds, the bitmaps get scaled. That works okay for most situations, but scaling small sprites to high resolutions looks ugly. Vector Graphics would fix that and allow you to zoom into game-levels endlessly.
But there are many more practical uses for vector graphics (keeping graphics size down for example or animating 2D models the way you would normally animate 3D models using coordinates).
Title: OpenVG Support through Amanith?
Post by: kevglass on December 01, 2006, 21:37:01
It'd be nice to have a light weight implementation of SVG Tiny or SVG Basic that could render to LWJGL. Maybe thats doable pretty quickly, anyone got any examples of some simple compliant SVGs?

Kev
Title: OpenVG Support through Amanith?
Post by: Onno on December 01, 2006, 21:41:07
Quote from: "kevglass"
It'd be nice to have a light weight implementation of SVG Tiny or SVG Basic that could render to LWJGL. Maybe thats doable pretty quickly, anyone got any examples of some simple compliant SVGs?

This (http://www.tinyline.com/svgt/samples/samples/index.html) was my first Google result.

I doubt that it will be quick to implement without using existing libraries though, even SVG Tiny is quite a big specification.
I just clicked on the Tilitilation link in your signature by the way: a great game! Reminds me a bit of a 3D version of Bob's Bad Day (old Amiga Game).
Title: OpenVG Support through Amanith?
Post by: spasi on December 03, 2006, 15:30:16
Quote from: "kevglass"
It'd be nice to have a light weight implementation of SVG Tiny or SVG Basic that could render to LWJGL. Maybe thats doable pretty quickly, anyone got any examples of some simple compliant SVGs?

It should be a lot of work, but if you've got the time (and courage? :lol:), you can have a look at zShapes (http://www.javagaming.org/forums/index.php?topic=14778.msg119569#msg119569). The code is yours to refactor in any way you like. I'd love to see it become a full SVG rendering library, and I'd do it myself under better circumstances. I'm available to answer any questions you may have.

Btw, what I don't like about Amanith is that it's based on dynamic triangulation. This has implications on CPU performance and requires multisampling for antialiasing. Also, anyone knows what's the deal with AmanithVG? Why is that a commercial lib and how does it differ from Amanith Framework?
Title: OpenVG Support through Amanith?
Post by: spasi on December 03, 2006, 15:52:04
Quote from: "kevglass"
anyone got any examples of some simple compliant SVGs?


You can find everything you need in Open Clip Art Library (http://www.openclipart.org/).
Title: Re: OpenVG Support through Amanith?
Post by: Onno on December 03, 2006, 23:31:24
It should be a lot of work, but if you've got the time (and courage? :lol:), you can have a look at zShapes (http://www.javagaming.org/forums/index.php?topic=14778.msg119569#msg119569). The code is yours to refactor in any way you like. I'd love to see it become a full SVG rendering library, and I'd do it myself under better circumstances. I'm available to answer any questions you may have.

Wow.. that's a very  interesting library you have there.
Although it currently only handles shapes, which is not enough for actual rendering of SVG alike vector graphics, it still looks very useful.
Title: Re: OpenVG Support through Amanith?
Post by: spasi on December 04, 2006, 11:50:22
Although it currently only handles shapes, which is not enough for actual rendering of SVG alike vector graphics, it still looks very useful.

Yes, it could work like this:

- Parse an .svg(z) with Batik (http://xmlgraphics.apache.org/batik/).
- Retrieve a list of Java2D shapes using the Batik node tree.
- Convert everything to triangles with zShapes.
- Implement SVG rendering
     That's the difficult part. Batik does this already with Java2D, but we need OpenGL rendering. It should be easy for fills and gradients, but it gets
     complicated if you need scissoring, different blend modes, etc.
- At runtime, go through each shape node (would probably be a GL display list), apply the appropriate rendering state and you're done. ;D