ogreSwf/vektrix

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: ogreSwf (now independent from gameSwf)

Post by xavier »

stoneCold wrote:As jacmoe said, with the help of the porting notes you might be able to compile it. Although I have to tell you that I haven't touched the gameswf version for years, since I stopped developing this version back then.
If you are a little patient, I'm currently setting up my new website, and after I get it up and running, I'll have a little candy for everyone who wants GPU driven Flash inside Ogre.
(the candy tastes similar to ScaleForm, but combined with the taste of beer [as in "free" beer] :wink:)

Cheers
Which (reading between the lines here) implies you did similar to Scaleform and forked gameSwf and more or less went the same route that Scaleform did? ;)

One of the nice things about the Hikari/FantastiqUI route is that you can support whatever version of ActionScript the current Flash player supports -- do you have full AS3.0 support?

And of course, will it be open-source or just free? ;)
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf (now independent from gameSwf)

Post by stoneCold »

xavier wrote:Which (reading between the lines here) implies you did similar to Scaleform and forked gameSwf and more or less went the same route that Scaleform did? ;)
Not at all, I can tell you I didn't use a single bit of gameswf, since gameswf is mostly written in C and doesn't really conform with my coding style, I would never even have thought of doing so (I do breathe open source everyday and I do respect the licenses/copyright holders 99% of the time, since I'd like people to do the same with code that I release under an open license :wink:)
Gameswf was just my starting point for the entire Flash+GPU topic, and it acted as a steppingstone not because I was able to use it very nicely, but because I was so disappointed by it's implementation (of course it's an awesome amount of work that has been done for gameswf, but it was/is just too C-ish, black-boxed, non-customizable, non-extendable and of course not entirely designed to be embedded/wrapped with C++/OO Languages).
xavier wrote:One of the nice things about the Hikari/FantastiqUI route is that you can support whatever version of ActionScript the current Flash player supports -- do you have full AS3.0 support?
The last days/weeks I've heavily investigated the tamarin source code, since there's very little to no documentation for it available (mostly one or two usefull code snippets at the mailing lists and that's about it).
But I've grasped most of the important things on how the AVM2/Tamarin work under the hood, and have written a nice/simple/thin wrapper arround it, which makes using Tamarin plain fun instead of hours and hours of trying to figure things out on your own :)
Of course, I wrote this wrapper mostly for the use in my flash/vector graphics rendering library (which I finally named vektrix, btw). With the help of Tamarin it should be able to fully support AS3.0, of course for it to work, all underlying ActionScript classes + the binding to C++ have to be written by someone, since Adobe didn't release these pieces, understandably.
xavier wrote:And of course, will it be open-source or just free? ;)
After weighting the pros and cons and after reading some of sinbad's thoughts about open source licensing, I've decided to release it all as open source/free.
For now, I want to release the code under the LGPL, since releasing it under a more permissive license, like the MIT License would endanger it to be ripped of by any company, just like gameswf was by scaleform.
There is still a lot of work to do to make the whole thing feature complete, but the substantial bits are already there. For example the above named job of writing AS3 and C++ classes is quite some work, which I'd happily give to someone else :)
(a commercial company would hardly have any problems to add those missing things, that's quite about the reason I chose LGPL over a more permissive license, but that could change once the project is mature enough, just like it happend with ogre)

Currently I'm more or less just waiting for sourceforge to rename the project from "vectrix" to "vektrix" (because I'd like to stay away from legal issues, since "vectrix" happend to be a registered trademark in the US :) ), after that I'll be releasing everything asap.
(unluckily, sourceforge is already overdue, since it's promised that the name change will happen within 48h, but nothing has happened yet after one week, I'll drop them a mail today).

Well, that's about the current status, if anyone's got questions just ask here for now.
Once the code is up at sourceforge, I'm gonna create a special forum on my website.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: ogreSwf

Post by xavier »

Nice -- I'll probably be willing to help evolve it as I can on this one, since I rolled my own version of the Hikari concept for our game -- it works for now, but I'd much rather have internal access to how the rendering is done (the whole render-Flash-to-offscreen-buffer works well, but the black-boxed-ness and COM-ness of it all drove me insane for a while). More specifically, I'd like to be able to do what you can with Scaleform and cook the .swf into a more native format (and be able to use DDS, for example).
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf

Post by stoneCold »

xavier wrote:I'll probably be willing to help evolve it as I can on this one, since I rolled my own version of the Hikari concept for our game...
Would be very welcome.
xavier wrote:It works for now, but I'd much rather have internal access to how the rendering is done (the whole render-Flash-to-offscreen-buffer works well, but the black-boxed-ness and COM-ness of it all drove me insane for a while).
I can fully understand you on that, that's quite exactly the reason(s) why I didn't stop development (also cross-platform support was a reason, mostly support for non-pc platforms).
xavier wrote:More specifically, I'd like to be able to do what you can with Scaleform and cook the .swf into a more native format (and be able to use DDS, for example).
That's the thing that I'm aiming for, in general, the design of the library is meant to be extendable / configurable.
Meaning it's not at all bound to any file format or output technology, it should be all placed inside plugins that are connected to the core of the library. In the first place I'll develop the SWF plugin further, since that's the format that I've vaguely designed the core functionality after, but loading a own custom file format would just require to write an own parser class, which is registered to the library through the plugin/factory interface. That way it should also be relatively easy to write converters from one format to another, for instance from SWF to your own custom format.
User avatar
joew
Greenskin
Posts: 113
Joined: Fri Nov 03, 2006 6:03 pm

Re: ogreSwf

Post by joew »

I've worked on flash rendering in the past and I'm no longer under NDA / non-compete from my previous company so I can assure you that once you have the project up on Sourceforge I will be contributing to it.
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf

Post by stoneCold »

joew wrote:I've worked on flash rendering in the past and I'm no longer under NDA / non-compete from my previous company so I can assure you that once you have the project up on Sourceforge I will be contributing to it.
Awesome!

The last days' freetime I've spent with refractoring the code for converting flash "scanline" vector graphics to polygonal vector graphics,
since I wanted this piece of code to be rock-solid before I release the entire project. After all I ended up writing it from scratch once again, but now it's fully working and at least all stress tests that I've performed with it so far, have worked fine.

To do some stress tests, I've converted some pixel-based images to vector graphics.

The traditional svg tiger, with about 11.000 vector graphic elements (lines/beziers)
Image

a wallpaper, converted to vector graphics with about 109.000 elements
Image

and finally a beautiful drawing of our beloved cthulhu, with about 225.000 elements and 8.000 fillstyles (i.e. colours)
Image

Since sourceforge finally managed to change the project unix name as requested, I'm gonna clean up the code tomorrow, smack some documentation/comments/license headers in where needed and then I'll plant it into the svn repo over at sourceforge :wink:
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: ogreSwf

Post by xavier »

Great news! :)
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
joew
Greenskin
Posts: 113
Joined: Fri Nov 03, 2006 6:03 pm

Re: ogreSwf

Post by joew »

Wow looks great stoneCold I can hardly wait to check it out, should be fun to work on :)
User avatar
my.name
Goblin
Posts: 222
Joined: Tue Aug 08, 2006 2:58 pm
Location: Moscow
x 1

Re: ogreSwf

Post by my.name »

How to download source codes?
Links do not work.
Image
Image
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf

Post by stoneCold »

So there it is, the initial commit is up at sourceforge.
There's still temporary debugging/testing code in there, but since I consider the library to be in alpha state that shouldn't bother you :wink:

Currently, the core library itself got one dependency, namely cairo to render vector shapes. It's planned to move it out of the core into a plugin in a later version.
But until then you'll have to just download the dev files / binary of cairo...
cairo-binary-1.4.0
cairo-dev-1.4.0

... and create a "CAIRO_HOME" environment variable which points to the folder where you extract the above archives.
(I'm placing all 3rd party libraries that I'm using at C:\SDKs, therefore CAIRO_HOME would point to C:\SDKs\cairo, for instance)

The same applies for Ogre, OGRE_HOME points to the Ogre3D root directory.
(I'm using the source version of Ogre, so if you're an Ogre SDK user, you'd probably have to remove "OgreMain\" from the vcproj include / library paths / post build events)

SVN: https://vektrix.svn.sourceforge.net/svnroot/vektrix

With the above mentioned env vars set correctly, it should all build and run fine. If anything goes berserk, drop a note here.
Since I've got a free day tomorrow, I'll finally have some time to put some documentation / todo lists together and install phpBB.

[edit]: nearly forgot, cairo doesn't like directx floating point mode set to "fastest", so if you want to use the D3D rendersystem, you should use "consistent" floating-point mode.

Cheers
Last edited by stoneCold on Mon Oct 26, 2009 5:15 am, edited 1 time in total.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: ogreSwf/vektrix

Post by xavier »

Sounds great, thanks stone! I am in the middle of a small rearch right now so there are bits of code strewn about the floor, so to speak, so I won't be able to get to this for a few days, but looking forward to it!
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy
x 6

Re: ogreSwf/vektrix

Post by boyamer »

Looks very good!! With which version do you had it compiled? Trunk or Ogre 1.6.4?

Thanks
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: ogreSwf/vektrix

Post by Wolfmanfx »

Nice but i got link error regarding nedAlloc polling policy. So have you any precompiled thingy or a video for me :)

Code: Select all

1>------ Build started: Project: vektrix_OgrePlugin, Configuration: Debug Win32 ------
1>Linking...
1>   Creating library C:\Users\wolfman\Desktop\vektrix\\bin\vektrix_OgrePlugin_d.lib and object C:\Users\wolfman\Desktop\vektrix\\bin\vektrix_OgrePlugin_d.exp
1>vtxopTexture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Ogre::NedPoolingPolicy::deallocateBytes(void *)" (__imp_?deallocateBytes@NedPoolingPolicy@Ogre@@SAXPAX@Z) referenced in function "protected: virtual void __thiscall Ogre::SharedPtr<class Ogre::Resource>::destroy(void)" (?destroy@?$SharedPtr@VResource@Ogre@@@Ogre@@MAEXXZ)
1>C:\Users\wolfman\Desktop\vektrix\\bin\vektrix_OgrePlugin_d.dll : fatal error LNK1120: 1 unresolved externals
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf/vektrix

Post by stoneCold »

xavier wrote:I am in the middle of a small rearch right now so there are bits of code strewn about the floor, so to speak, so I won't be able to get to this for a few days, but looking forward to it!
Take your time :wink:
boyamer wrote:With which version do you had it compiled? Trunk or Ogre 1.6.4?
I'm compiling it against Ogre 1.6.3 stable currently, I'll download trunk and see what needs fixing.
Wolfmanfx wrote:Nice but i got link error regarding nedAlloc polling policy...
I guess you're using Ogre trunk? I'll have to see what is causing this.
Wolfmanfx wrote:So have you any precompiled thingy or a video for me :)
On your special request...
Image

(if someone's interested in seeing the swf file used in the video, you can get it here)
User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy
x 6

Re: ogreSwf/vektrix

Post by boyamer »

Nice,so for now is impossible to interact with Flash? for example create a gui with button callback?

Looking forward for this..

Great job
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: ogreSwf/vektrix

Post by Wolfmanfx »

Nice music :) nice vid go stone go ;)
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf/vektrix

Post by stoneCold »

boyamer wrote:Nice,so for now is impossible to interact with Flash? for example create a gui with button callback?
That's what is planned for the next milestone, since to achieve that I have to integrate Tamarin / the Adobe VM2 into the project. Once the VM is in place, it's mostly a matter of writing the relevant AS3 classes (e.g. flash.display.SimpleButton) and their bindings to C++.
Don't forget that this is not even remotely relying on the Adobe Flash player, so everything has to be coded before it actually works, but compared to the Adobe Player it is then automagically cross-platform, hardware accelerated, customizable, extendable, royalty free, etc. :wink:
Wolfmanfx wrote:Nice music :) nice vid go stone go ;)
Thx :)
User avatar
my.name
Goblin
Posts: 222
Joined: Tue Aug 08, 2006 2:58 pm
Location: Moscow
x 1

Re: ogreSwf/vektrix

Post by my.name »

Image
Image
Image
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Re: ogreSwf/vektrix

Post by calsmurf2904 »

Code: Select all

Trying to load file 'shape_test.swf'...
EXCEPTION: Unable to find container to load file 'shape_test.swf'.
(occured in 'vtxfilemanager.cpp at line 57')
...when trying to run the ogre3d demo...
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf/vektrix

Post by stoneCold »

check if you've got a directory called $(OGRE_HOME)\Samples\Media\vektrix, it should usually be created by the demo post build event.
If it doesn't exist, simply create it and copy the content of "{VEKTRIX_HOME}\demos\Ogre3D\media" into it (currently there's just shape_test.swf)
You could as well use the tiger swf that I linked above.
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Re: ogreSwf/vektrix

Post by calsmurf2904 »

I manually setup the resources.cfg in the bin folder of the vektrix home (not ogre home). I make the resource.cfg point to ../demos/media and then I just execute the demo binary in the bin folder of vektrix
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
pratty70
Gnome
Posts: 341
Joined: Thu May 13, 2004 4:52 pm
Location: Wales - UK

Re: ogreSwf/vektrix

Post by pratty70 »

Great work, I'll be following this closely, with the possibility of using in the future.
Cheers
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: ogreSwf/vektrix

Post by stoneCold »

If you want to do it that way, you'd have to change Line 75 of Ogre3D_Demo.h to...

Code: Select all

vtx::FileContainer* container = vtx::FileManager::getSingletonPtr()->addFileContainer("../demos/Ogre3D/media");
The resources.cfg is only used by Ogre and it's Resource System, but the vektrix demo doesn't use any ogre resources, so you might as well just use a blank resources.cfg file as well :wink:
Although, all necessary content should be copied over into the ogre samples directory automatically by the demo post-build event, so you should find the vektrix demo binary in $(OGRE_HOME)\Samples\Common\bin\ReleaseOrDebug, just like the other ogre demos.
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Re: ogreSwf/vektrix

Post by calsmurf2904 »

stoneCold wrote:If you want to do it that way, you'd have to change Line 75 of Ogre3D_Demo.h to...

Code: Select all

vtx::FileContainer* container = vtx::FileManager::getSingletonPtr()->addFileContainer("../demos/Ogre3D/media");
The resources.cfg is only used by Ogre and it's Resource System, but the vektrix demo doesn't use any ogre resources, so you might as well just use a blank resources.cfg file as well :wink:
Although, all necessary content should be copied over into the ogre samples directory automatically by the demo post-build event, so you should find the vektrix demo binary in $(OGRE_HOME)\Samples\Common\bin\ReleaseOrDebug, just like the other ogre demos.
Thanks! That did the trick :)
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: ogreSwf/vektrix

Post by Assaf Raman »

@stoneCold: Nice work! Great to see you back here doing great things.
Watch out for my OGRE related tweets here.
Post Reply