FantastiqUI; Playing flash movies in irrlicht

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
mathijs_b
Posts: 2
Joined: Tue Dec 30, 2008 2:38 am

FantastiqUI; Playing flash movies in irrlicht

Post by mathijs_b »

Image
Image
Image

Hello everyone,

The above screenshots show my FantastiqUI project, which is a control aimed at using .swf movies in hardware accelerated environments like Irrlicht. This way you can use Adobe Flash to quickly build complicated user interfaces and load them into your game with just a few lines of code.
In the above screenshots you see 3 flash movies presented on a 3D billboard model and a simple interface made in flash. Full interaction (mouse/keyboard input) is possible with these billboards and the flash movies displayed on them.

This is my second post here about this project, over the past few months I completely rewrote this control, making it more optimized and fixing bugs that remained in the old control. Besides that I removed redundant code, to make the control easier to use. I will sum up some of the new and old features together with some technical details.

The idea of FantastiqUI is to use the Adobe Flash Player control through COM and render this control onto a texture so it can be used in a 3d environment. I started making this control for a 3D project I was working on that required an easy to edit GUI, since the only option for this was using scaleform, which was far too expensive to consider for that project, I started experimenting with using the Adobe Flash Player control on textures. The major advantage of this approach is that my control is much cheaper than Scaleform, yet the performance of my control is only a little bit slower than Scaleform in most situations. Besides that, full ActionScript support is retained.

Since performance is an important issue for 3D environments, I have implemented various features to increase performance. Only regions of the Flash Movie that require to be updated are redrawn to texture. For example, in a large flash movie, only the regions that actually change will be redrawn and uploaded to the videocard. Other regions will not be touched at all.

As a second measure to increase performance, flash updates are directly written from the internals of the Flash Player to the texture surface specified by the user. Therefore an intermediate windows memory surface is skipped. The code to do this copy is written in MMX/SSE2 dependant on which instruction set is available on the users processor.

Another problem I encountered when using Adobe's flash player control is that the transparency/translucency data is not 100% correct. In most cases, the alpha channel is fine, but with some movies, problems occur. These transparency glitches are also corrected by my control, in the SSE2 loop that moves the pixel data from the Flash Player Control to a texture.

When loading the flash control in a standard COM container, mouse and keyboard input will only work when the actual control is on screen. My control works around this limitation, which is very important, since when using Flash on a texture, you do not want to have the actual Flash control on screen.

The actual Flash Player runs in a secondary thread, for full communication with the flash player I implemented my own call funnel similar to the CoInterfaceStream() functions, only my implementation has different calling modes. It can either call asynchronously, returning immediately, with a return value that can be retrieved when the function call is complete. Or it can block untill the call has been made and return a value immeadiately. This is useful, since it means you can pass values (for example player position) to ActionScript without slowing done your rendering loop.

Besides that, it contains most of the usual features you see in Flash projector controls. It can load the Flash Player control from any path specified, or load the default flash control available on the system. Flash movies can be loaded from memory and from disk locations.

FantastiqUI is available for both .NET and C++ and any COM supporting language. I have made a special sample for Irrlicht, you can download it here. I fixed the bugs that were in the sample I posted earlier, and FantastiqUI should work correctly in Irrlicht now :

Irrlicht sample

For more information about this project, please take a look at http://www.fantastiqui.com

Regards,
Mathijs
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, was able to see it working. Was not easy.

Had to put the IRRlicht 1.5 DLL (32bit Visual Studio) and get your DLL from your site ("FantastiqUI.dll), they were both missing.

Can you put thoses DLL inside the archive?

Also I was assuming I would see the 3D mountains behind. From what I saw in the source you had, you commented some lines in the demo of the terrain rendering demo and used it for creating your own demo.

If you do another demo, It would be interesting to see how the FLASH elements interact with the IRRlicht stuff (3D meshes, skyboxes, etc.)
Yoran
Site Admin
Posts: 96
Joined: Fri Oct 07, 2005 8:55 am
Location: The Netherlands
Contact:

Post by Yoran »

I'm impressed! Very nice project.
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post by Frank Dodd »

It looks like a great module for anyone giving serious consideration to generating revenue from a project, especially if the flash can be obtained by the client application in the same manner as a browser.

Very nice pitch by the way.
mathijs_b
Posts: 2
Joined: Tue Dec 30, 2008 2:38 am

Post by mathijs_b »

christianclavet wrote:Hi, was able to see it working. Was not easy.

Had to put the IRRlicht 1.5 DLL (32bit Visual Studio) and get your DLL from your site ("FantastiqUI.dll), they were both missing.

Can you put thoses DLL inside the archive?

Also I was assuming I would see the 3D mountains behind. From what I saw in the source you had, you commented some lines in the demo of the terrain rendering demo and used it for creating your own demo.

If you do another demo, It would be interesting to see how the FLASH elements interact with the IRRlicht stuff (3D meshes, skyboxes, etc.)
I didnt include the dll's with the sample to prevent the download getting big. I will recompile the sample using static linking, so the compiled example will always run. Besides that, I will be working on a more advanced irrlicht sample, that will actually show the flash texture being used on 3 dimensional surfaces.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

mathijs_b wrote:I didnt include the dll's with the sample to prevent the download getting big. I will recompile the sample using static linking, so the compiled example will always run. Besides that, I will be working on a more advanced irrlicht sample, that will actually show the flash texture being used on 3 dimensional surfaces.
Cool! I can't hardly wait to see that! From the doc you provided (your library docs), there seem a way to make a communication with the flash and the main application. This could really work as a 3D interface (Nice for games and demos)
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

nice. thumb ups.
Post Reply