svg pipeline to panda3d

Return to Showcase

svg pipeline to panda3d

Postby eeghem » Tue Aug 03, 2010 4:13 am

Hi,

I've been working on a pipeline that translates a svg file into an egg file and a number of png images. The primary goal was to use the svg authoring tool as a drawing tool for a gui. The tool currently is in a beta status.

The tool is comparable with egg-texture-cards tool delivered with Panda3D. Different features are:
- accepts svg files
- allows meta information in the svg file to be stored in the egg file (can be used to construct the DirectXXX components from the egg file)
- generates code on the fly based on simple template mechanism

I've created a project space on Sourceforge where the tool is now uploaded. The download delivers a binary for windows and the source code (C++ and Qt). To use the tool, you also need Inkscape installed.

http://sourceforge.net/projects/rxbuilder/

If you have comments on the tool, remarks, ideas. I'd like to hear them.

Regards,
Ruud
eeghem
 
Posts: 26
Joined: Wed Nov 12, 2008 5:52 am

Postby Nemesis#13 » Wed Aug 04, 2010 12:29 pm

I can't look into the code (because of SourceForge's stupidity), but the idea sounds neat.
There are a few SVG to raster converters, but most of them are buggy or only for a specific OS.

Your app depends on Qt and Inkscape, which doesn't make it suitable for everybody, but it brings up an idea:
How about having a native SVG renderer integrated in Panda? You would load your SVG textures same way as usual textures only with a size parameter that defines the pixel-size of the result, which will be loaded and mapped onto an object.
This sounds quite complicated, but in real it would bring two big features:
+ very small texture file sizes independent of the actually rendered textures' size
+ textures virtually available in all sizes. you could even render at 4096² or more (only the graphics card or RAM limits you)
+ all compression is lossless (other than e.g. JPG)

The price for these features is:
- you'd have to create your textures as vector graphics, which in some cases might become more difficult than raster
- the rendering takes some time depeding on the complexity. means longer loading times (might be straightened out with short loading times of the SVGs from disk)


I once tried out a product of Allegorithmic (specialist in vector textures) which basically did this on runtime. It had a few modules for some game engines so that they can load their texture files (i guess something like extended SVG). According to what they say the idea works out very well.

Long story short: +1 for native SVG support.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby eeghem » Thu Aug 05, 2010 2:16 am

True it would be great if Panda supports the svg file format. However, I've spent many hours searching for a good svg library that can render svg images. This is not an easy thing to do since the svg standard has become quite complex. My hope is that one day the Qt framework fully supports the svg standard. Then I can remove the inkscape dependency. That would help.

B.t.w. the source code is not yet uploaded on sourceforge, however it is included in the installer. So run the installer and you can check the source code. I've also added a sample project.
eeghem
 
Posts: 26
Joined: Wed Nov 12, 2008 5:52 am

Postby Nemesis#13 » Mon Aug 09, 2010 2:36 pm

I can't run a windows executable on my non-windows OS.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby eeghem » Tue Aug 10, 2010 1:46 am

Makes sense. I've uploaded a zip holding only the source code. Its developed with the mingw compiler, qt-framework 4.6 and codeblocks ide. Could you try to build it? I'm really interested in how cross-platform this toolset actually is.

Note that if you manage to build it, remember that you need Inkscape on the local system to use it.

If you run into trouble, don't hesitate to mail.
eeghem
 
Posts: 26
Joined: Wed Nov 12, 2008 5:52 am

Postby eeghem » Tue Aug 10, 2010 2:43 am

And after many tries I've managed to upload the source code into a SVN repository. So if you have a subversion client, you can download a copy of the code.
eeghem
 
Posts: 26
Joined: Wed Nov 12, 2008 5:52 am

Postby Praios » Sat Aug 14, 2010 11:13 am

+1 for native svg support
What am I actually talking about? - I don't know...
User avatar
Praios
 
Posts: 234
Joined: Fri Aug 31, 2007 2:23 pm
Location: Germany

Postby dotherwise » Sat Nov 06, 2010 11:04 pm

Why can't Cairo and RSVG be the answer? They are cross-platform afaik.

1. SVG (just xml text)
2. --> lxml --> objects in ram
3. --> manipulate as required
4. --> RSVG render_Cairo (to context)
(or parse and draw 'manually' with Cairo.)
5. --> Transfer bitmap to Panda.

Step 5 is hackey, to say the least -- I didn't have time to get a working result.
(I got a lot of crazy-looking effects that reminded me of my old Z80A days in front of a television on my Spectravideo-318!)

I have mentioned this before; in another thread; what is it that the Clutter-Project peeps are doing that is working so well? In that world you can draw textures in pure Cairo (or via RSVG) and have singing-dancing polygons without any sweat.

\d
User avatar
dotherwise
 
Posts: 65
Joined: Sun Dec 13, 2009 10:11 am
Location: South Africa

Postby dotherwise » Fri Nov 12, 2010 2:18 am

Argh, spam! How does one report it?


\d
User avatar
dotherwise
 
Posts: 65
Joined: Sun Dec 13, 2009 10:11 am
Location: South Africa


Return to Showcase

Who is online

Users browsing this forum: Bing [Bot] and 1 guest