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
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 »

[update]

I've created a small binary demo package for those of you who just want to see vektrix in action, without needing to compile the whole thing from source :wink:
(if you are unable to run the demo, you might be missing the VS2008 SP1 runtime, which you can download here)
Download the demo here
[edit]: you can press F1 to display debug information about the object bounding boxes

Screenshot...
Image

Basically, in this little demo you've got 6 "arrow" buttons for controlling the X and Y coordinates as well as the rotation of a SWF object.
The whole logic behind this is done inside ActionScript 3.0, there's no extra C++ code involved at all.

The ActionScript 3.0 code inside the SWF looks like follows...

Code: Select all

plus_x.addEventListener(MouseEvent.CLICK, function() {grad_btn.x += 10;} );
min_x.addEventListener(MouseEvent.CLICK, function() {grad_btn.x -= 10;});

plus_y.addEventListener(MouseEvent.CLICK, function() {grad_btn.y += 10;} );
min_y.addEventListener(MouseEvent.CLICK, function() {grad_btn.y -= 10;});

plus_rot.addEventListener(MouseEvent.CLICK, function() {grad_btn.rotation += 10;} );
min_rot.addEventListener(MouseEvent.CLICK, function() {grad_btn.rotation -= 10;} );
"plus_x", "min_x", etc. are simply the AS3 instances of the arrow buttons that you can see in the screenshot above. Each of these buttons is associated with an event listener function that is being called on mouse click (easy as that :wink:).

If you are interested in the FLA source file, there you go :)

Cheers
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
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 »

hi

like binary demos :)

Code: Select all

<< vektrix 0.1.0 started >>
<< Codename: Valus >>
Added ShapeFactory 'Default'.
Added TextureFactory 'Default'.
Added FileContainerFactory 'DefaultFileContainerFactory'.
Loading dynamic library "vektrix_AS3Plugin"
Added ScriptEngineFactory 'AS3ScriptEngine'.
Loading dynamic library "vektrix_SwfPlugin"
Added FileParser for extension ".swf".
Loading dynamic library "vektrix_XmlPlugin"
Added FileParser for extension ".xml".
Loading dynamic library "vektrix_OgrePlugin"
Added ShapeFactory 'OgreShape'.
Added TextureFactory 'OgreTexture'.
Added MovieFactory 'OgreMovableMovie'.
Added MovieFactory 'OgreTextureMovie'.
Trying to load file 'button_test2.swf'...
but demo crashes here on vista
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 »

Thanks for the bug report, accidently I still had a macro enabled on the release build (which is used for internal debugging/testing).
I have fixed the download package at sourceforge :wink:
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 4
Contact:

Re: ogreSwf/vektrix

Post by ekt »

i had the same error reported by wolfmanfx, and i confirm is fixed in your latest download
i still have a crash with directx
opengl is fine and works

Code: Select all

12:06:01: ***************************************
12:06:01: *** D3D9 : Subsystem Initialised OK ***
12:06:01: ***************************************
12:06:01: ResourceBackgroundQueue - threading disabled
12:06:01: Particle Renderer Type 'billboard' registered
12:06:01: Parsing scripts for resource group Autodetect
12:06:01: Finished parsing scripts for resource group Autodetect
12:06:01: Parsing scripts for resource group General
12:06:01: Finished parsing scripts for resource group General
12:06:01: Parsing scripts for resource group Internal
12:06:01: Finished parsing scripts for resource group Internal
12:06:03: OGRE EXCEPTION(3:RenderingAPIException): Failed to DrawPrimitive : Invalid call in D3D9RenderSystem::_render at ..\src\OgreD3D9RenderSystem.cpp (line 2915)
Last edited by ekt on Mon Jan 11, 2010 2:08 pm, edited 1 time in total.
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 »

ot: wolfman error sounds strange :)
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 4
Contact:

Re: ogreSwf/vektrix

Post by ekt »

Wolfmanfx wrote:ot: wolfman error sounds strange :)
yep sounds like a syndrome. i'll edit :)
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 »

ekt wrote:

Code: Select all

12:06:01: ***************************************
12:06:01: *** D3D9 : Subsystem Initialised OK ***
12:06:01: ***************************************
12:06:01: ResourceBackgroundQueue - threading disabled
12:06:01: Particle Renderer Type 'billboard' registered
12:06:01: Parsing scripts for resource group Autodetect
12:06:01: Finished parsing scripts for resource group Autodetect
12:06:01: Parsing scripts for resource group General
12:06:01: Finished parsing scripts for resource group General
12:06:01: Parsing scripts for resource group Internal
12:06:01: Finished parsing scripts for resource group Internal
12:06:03: OGRE EXCEPTION(3:RenderingAPIException): Failed to DrawPrimitive : Invalid call in D3D9RenderSystem::_render at ..\src\OgreD3D9RenderSystem.cpp (line 2915)
looks like something Ogre related, do you have latest graphics driver / directx runtime installed ? what graphics card are you using?
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 4
Contact:

Re: ogreSwf/vektrix

Post by ekt »

infamous Intel 945 laptop chipset
when i see this 90% is 32 bit indexing support (lacking or bad reported on this card), but i don't see why you should be using it

Code: Select all

12:06:01: -------------------------
12:06:01: D3D9 : Subsystem Initialising
12:06:01: D3D9RenderSystem::_createRenderWindow "vektrix Ogre3D Demo", 800x600 windowed  miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 gamma=false useNVPerfHUD=false vsync=false 
12:06:01: D3D9 : Created D3D9 Rendering Window 'vektrix Ogre3D Demo' : 800x600, 32bpp
12:06:01: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
12:06:01: Registering ResourceManager for type Texture
12:06:01: Registering ResourceManager for type GpuProgram
12:06:01: RenderSystem capabilities
12:06:01: -------------------------
12:06:01: RenderSystem Name: Direct3D9 Rendering Subsystem
12:06:01: GPU Vendor: intel
12:06:01: Device Name: Mobile Intel(R) 945 Express Chipset Family
12:06:01: Driver Version: 6.14.10.4926
12:06:01:  * Fixed function pipeline: yes
12:06:01:  * Hardware generation of mipmaps: no
12:06:01:  * Texture blending: yes
12:06:01:  * Anisotropic texture filtering: yes
12:06:01:  * Dot product texture operation: yes
12:06:01:  * Cube mapping: yes
12:06:01:  * Hardware stencil buffer: yes
12:06:01:    - Stencil depth: 8
12:06:01:    - Two sided stencil support: yes
12:06:01:    - Wrap stencil values: yes
12:06:01:  * Hardware vertex / index buffers: yes
12:06:01:  * Vertex programs: yes
12:06:01:  * Fragment programs: yes
12:06:01:  * Geometry programs: no
12:06:01:  * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
12:06:01:  * Texture Compression: yes
12:06:01:    - DXT: yes
12:06:01:    - VTC: no
12:06:01:  * Scissor Rectangle: yes
12:06:01:  * Hardware Occlusion Query: no
12:06:01:  * User clip planes: yes
12:06:01:  * VET_UBYTE4 vertex element type: yes
12:06:01:  * Infinite far plane projection: yes
12:06:01:  * Hardware render-to-texture: yes
12:06:01:  * Floating point textures: no
12:06:01:  * Non-power-of-two textures: yes (limited)
12:06:01:  * Volume textures: yes
12:06:01:  * Multiple Render Targets: 1
12:06:01:    - With different bit depths: no
12:06:01:  * Point Sprites: yes
12:06:01:  * Extended point parameters: yes
12:06:01:  * Max Point Size: 256
12:06:01:  * Vertex texture fetch: no
12:06:01:  * Render to Vertex Buffer : no
12:06:01:  * DirectX per stage constants: yes
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 »

In fact I'm not using 32-Bit indexing, but as I see you are not alone with this problem. Did you try to update directx / drivers?, because at least in one of those related threads it's said that this solved the problem.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 4
Contact:

Re: ogreSwf/vektrix

Post by ekt »

i was young when they last updated the drivers for this card :)
directx is the latest one (august 2009)
but don't waste time on this. if i need or find time i'll try to debug and give you more precise info
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 »

As said you could search the forums for the issue, you're not alone with this one. I heavily doubt that it's a problem originating from vektrix, but far more likely a driver problem.
Another thing to check: do the Ogre3D demos work ok for you? If you find something out and it needs fixing on my side, don't hesitate to post about it here or at the vektrix forums.

[edit]: small dev update: yesterday I added support for statically linking vektrix + plugins, and today I'm working on cmake files to add support for linux.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
ekt
Gremlin
Posts: 150
Joined: Thu Apr 01, 2004 5:55 pm
x 4
Contact:

Re: ogreSwf/vektrix

Post by ekt »

ogre demo are working fine. when travelling i'm constantly developing on this laptop and always using dx renderer
the other only known app which gives me this sort of problem is ogremax when using directx (ogl is again fine)
stoneCold wrote:If you find something out and it needs fixing on my side, don't hesitate to post about it here or at the vektrix forums.
sure if discover something i'll tell you. i suspect this card is more susceptible with vertex buffer elements order (see the last chapter).
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: ogreSwf/vektrix

Post by KungFooMasta »

stoneCold,

I downloaded and ran your demo without any problems, works well! How does the rendering work, in terms of batching? Is each button its own quad, or is the whole window a quad, and the texture of this full screen quad is computed when something changes? (ie texture caching) For example would anything change if instead of a white background, there was the Fresnel demo in the background, with the gradient and position/orientation buttons still present on top?
Creator of QuickGUI!
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 »

All necessary swf/vector shapes are rendered to a texture atlas (using cairo), this atlas texture is then applied to simple 2 polygon quads with the appropriate texture coordinates set, to display the corresponding shape. IIRC you should be able to see blit.png in the demo bin directory after you have ran it at least once. This is simply a blit of the ogre texture atlas to a file, you can have a look at it to see the rendered cairo shapes.

But this is just one way of rendering that I'm planning to support, for the future I hope to be able to provide a "complete" CPU bound rendering approach (like the one you mentioned, with 1 big quad and full texture updates/dirty rect updates) and an approach that runs as much on the GPU as possible.

[edit]: to answer the question about the background, the white background is simply the Ogre viewport background, if there was an ogrehead in the scene somewhere behind the vektrix movie pane, you could see it as expected. The movie implementation that I use for the demo simply creates a Ogre::MovableObject which is at the same time the vektrix movie, so you can automagically attach it to scenenodes, bones, etc.
But again, this is just a particular implementation, support for displaying movies inside Ogre::Textures or directly inside viewports (2D) is planned as well :wink:
Flexibility was a major concern to me when I started vektrix, and up to now I have been quite happy with it :D
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: ogreSwf/vektrix

Post by KungFooMasta »

Honestly I'm not sure which approach is better, they seem to be very scenario oriented. For example texture caching doesn't work well if you have an FPS counter window, like the Ogre one (tri count, batch count, fps, etc.).

Either way if you want to support UI elements like Windows, you will have to figure out some sort of zOrdering for your quads.

Also, I didn't see any files that show the gradient or arrow graphic, are they embedded in the .swf file? (I don't know much about flash, which is probably obvious :) )

I think this has a lot of potential! I'm curious to see more text related UI elements (ie textbox, multiple lines or single), as these are the most difficult to implement.
Creator of QuickGUI!
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 »

KungFooMasta wrote:Honestly I'm not sure which approach is better, they seem to be very scenario oriented. For example texture caching doesn't work well if you have an FPS counter window, like the Ogre one (tri count, batch count, fps, etc.).
That's exactly why I think it's good to the let the user decide which method to use, for instance you could use one vektrix widget (swf file) for your fps, batch, etc. counter with the texture atlas+quads method and other vektrix widgets with the texture caching method for the more static things.
KungFooMasta wrote:Also, I didn't see any files that show the gradient or arrow graphic, are they embedded in the .swf file?
These are really vector graphics, meaning the arrow for instance is simply stored inside the swf as 7 points + 1 color and the gradient button is 4 lines + a gradient consisting of a number of colors. These are rasterized using cairo and then copied to the texture atlas.
KungFooMasta wrote:I think this has a lot of potential! I'm curious to see more text related UI elements (ie textbox, multiple lines or single), as these are the most difficult to implement.
Thanks, these are part of the next milestones, luckily I already have some basic code lying arround for things like editboxes and such from earlier GUI experiments/projects.

Still, there's enough other work to do as well, so if someone is interested in learning more about vector graphics, GUI, rich media (video, sound, etc) and the like, I hereby invite everyone who's interested to join the effort :wink:

Together we could make scaleform cry :lol:

Cheers
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
triton
Greenskin
Posts: 138
Joined: Thu Mar 13, 2008 10:25 pm
Location: Portugal

Re: ogreSwf/vektrix

Post by triton »

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 »

Cool stuff, Adobe's takeover has definately had a good influence on the direction that Macromedia's technologies are heading.
Without the SWF file specification being released publicly I'd doubt that such cool things like Flash running inside JavaScript would have ever seen the light. :D
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
Micha
Gnoblar
Posts: 3
Joined: Sat Feb 14, 2009 7:29 am

Re: ogreSwf/vektrix

Post by Micha »

Hi stoneCold,

this is VERY impressive.
I tried to use it in a project but I've hit a few walls.

* image support. When I add an image, I get an empty screen.
* button callback. Looking at the source I know this is already possible (the code keeps track of the button state), but I'm not sure how. The documentation somewhat limited.

Using these two features I could build simple menu's in Flash.
So .. how can I help to add these functions?

And how do I hide the red cursor and the red border?
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 »

Hi Micha,
Thanks for your interest in vektrix.

I'd really appreciate if you (and others in future) could please ask your questions regarding vektrix over at the dedicated vektrix forums. Otherwise this thread will become even more huge than it already is.

But to quickly answer your questions:
*) image support: loading external images from HDD/HTTP/... already works, extracting and displaying images out of SWF is under development and will be finished with the next milestone
*) button support: has been improved as well, I'm about to commit the next revision to svn
*) last but not least, documentation is being written (but it takes time, since it's quite a time intensive task)

Cheers, see you at the vektrix forums :wink:
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
Akis
Gnoblar
Posts: 24
Joined: Fri Jul 02, 2010 8:31 pm

Re: ogreSwf/vektrix

Post by Akis »

I just find Vektrix and I was unable to run the application from the sources :-/ I followed the steps here

But, i have some questions.

I quickly look the code for the integration with Ogre, and it seems a SWF file is a vkx::Movie ? Right ?
All swf files are a movie ? Or there are others objects ?

And how I can execute a fscommand ?
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 »

Akis wrote:I followed the steps here
I'm currently working on porting the project to use CMake for building it from source, have a look at this forum post which I just created. I'm going to try to finish the CMake build system changes tomorrow and update the build instructions at the wiki as well.
Akis wrote:I quickly look the code for the integration with Ogre, and it seems a SWF file is a vkx::Movie ? Right ?
All swf files are a movie ? Or there are others objects ?

And how I can execute a fscommand ?
vtx::Movie is the class that will contain exactly one instance of a SWF file during runtime, yeah. "Movie" is just the term that I chose for representing SWF instances, since Adobe tends to call them movies as well in their documentation, etc. and it just makes sense imo :)
"fscommand" is currently not implemented. It would be quite easy to support it to be honest, but that's exactly the reason why it's not already in the code. There are far more complex things to be implemented first on my todo list for vektrix. If you have a strong need for this feature then let me know, and I'll give it a higher priority maybe.

Basically what I imagined for it:
for vtx::Movie you'll be able to register "CommandListeners"...

Code: Select all

class CommandListener
{
    virtual void fscommand(String command, String args) = 0;
};
... those listeners will be called if you call the "fscommand(...)" function inside AS3.

As said, implementing this is not that much of a big deal, if you're interested in discussing this further I'd ask you to please head over to the official vektrix forum.

See you :wink:


[edit]: the discussion continues here ... http://www.fuse-software.com/forum/view ... p?p=56#p56
Last edited by stoneCold on Sat Sep 25, 2010 6:21 am, edited 1 time in total.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
Akis
Gnoblar
Posts: 24
Joined: Fri Jul 02, 2010 8:31 pm

Re: ogreSwf/vektrix

Post by Akis »

Thanks stoneCold. I'm waiting the update :)

For fscommand, I think it's a good feature to have soon in Vektrix. Actually, I really need this feature ^^ I don't imagine how to share information between flash and c++ without that... A click button in flash to do something in c++, etc..

If you plan to implement this feature soon, I'll be happy :D Because I don't want to use gameswf.. That lib is too old and not maintain anymore :-/
User avatar
evilshadow
Kobold
Posts: 26
Joined: Sat Dec 20, 2008 4:29 pm
Location: Asia

Re: ogreSwf/vektrix

Post by evilshadow »

Together we could make scaleform cry
:D Great !!! Please carry on .... !!!
The dark side of the moon...
yuanye15978
Gnoblar
Posts: 1
Joined: Tue Dec 13, 2011 11:38 am

Re: ogreSwf/vektrix

Post by yuanye15978 »

i want to build caspin
i get caspin from github
then i run the tamarin_steup.py to get tamarin
but i meet so many errors,just like that:

2>G:/project/caspin-master/include\cspVmCore.h(62): error C2039: “findClassInPool”: 不是“avmplus::Toplevel”的成员
2> g:\project\caspin-master\tamarin\core\Toplevel.h(52) : 参见“avmplus::Toplevel”的声明
2>G:/project/caspin-master/include\cspWinPlatform.h(161): error C3861: “AvmLog”: 找不到标识符
2>G:/project/caspin-master/include\cspWinPlatform.h(186): error C3861: “AvmLog”: 找不到标识符
2>G:/project/caspin-master/include\cspWinPlatform.h(202): error C3861: “AvmLog”: 找不到标识符
2>G:/project/caspin-master/include\cspWinPlatform.h(224): error C3861: “AvmLog”: 找不到标识符

then i goto github get the tamarin-central ,but tamarin-central also lack lots of file

so how should i build caspin? where is the right version of tamarin?
thanks
Post Reply