Tag: OpenFL

After my initial post about the Away3D port to OpenFL, I’ve spent quite a bit of time working through the code trying to get more and more examples working. On top of this, OpenFL was updated to 2.0 and changes were needed to re-work the Away3D port for it to function. Unfortunately, it wasn’t a simple case of renaming flash.* to openfl.* plus, other bugs kept getting in the way.

Finally I’ve got to a point where some more fundamental functionality has been implemented and works across platforms, for the most part (more on that later) and as such have marked this release as 1.0.0-alpha. There are still plenty of issues to be resolved but this represents a large subset of core functionality.

From within the project folder e.g. /development/openfl/Basic_View to build and test the application simply use the following, specifying an OpenFL target.

lime test <target>

Areas for improvement/Problems

With this release there are a number of known, but not fixed, issues but will hopefully be address when I (or someone else in the community) can get around to fixing them.

WebGL/OpenGLES

I’m not an expert in WebGL/OpenGLES and so there are situations where the generated gl commands may not be optimal and also may be problematic in some circumstances. One of these areas is the allocation of frame/render buffers when rendering to textures. There are some warnings that appear through native traces or WebGL Inspector in Chrome which I’ve not got to the bottom of yet.

RenderToTexture on iOS

Whilst the rendering to texture works across platforms there is an issue with restoring the default buffers back after the render to texture. In OpenFL 1.4, it was possible to retrieve the ID of the renderbuffer so it could be restored after a RTT. Unfortunately, that call, or specifically the ENUM used to get the buffer is commented out of the NME backend. It’s made more complicated by the fact that the type returned should be a WebGLRenderBuffer/WebGLFrameBuffer rather than an ID as was previously used. I’ve just not been able to work through the tooling required to get the development version of NME setup with Lime and then to OpenFL to try and fix this issue.

iOS Texture/Lighting issue

As you will see in the video above, there are some odd artifacts coming through in the Basic_LoadAWD example on iOS. Similarly, the colours of the lighting on the Basic_Fire demo are also too saturated.

Android Loading AWD

There is a problem reaching a premature EOF on Android with the Basic_LoadAWD demo which is proving difficult to track down at the moment.

Moving forward

Hopefully some of the above issues will get resolved soon and more examples will be added demonstrating further completeness of functionality.

If you give it a try and find any issues, please log them on GitHub for either the core library or examples and I’ll get to them when I can. Should you wish to fix the issues yourself then that would be fantastic, just fork and send a Pull Request to get your changes into the project. Your help & support is greatly encouraged.

It’s been a while….

After just over a year since my last post on the NME port of Away3Dlite here is another post on my recent developments. A lot of things have changed since the last post, including NME taking a back-end seat to the new OpenFL platform and the upgrade to Haxe 3.

Ch-ch-ch-ch-changes.

As such large changes were happening, it seemed a little futile to re-work the NME version of Away3dlite due to the effort required. In addition to this, the Away3D team had created a TypeScript port which introduced a mechanism to convert AGAL to WebGL. Another factor which influenced the decision was the development of OpenFL-stage3D which implements the Stage3D API in OpenFL.

Finally, the decision was made to go for Away3D 4 and leveraging the TypeScript code to implement a convertor in OpenFL to go from AGAL to OpenGL ES.

It’s only over 450 files – how hard can it be?

After several weeks of a combination of automated AS3 to Haxe 3 scripting followed by hundreds of compilation errors, re-compilation, more errors and so on, first glimpses of functionality can be seen in this port.

It works!

Using the demos from Away3D, initially Basic_View, followed by Basic_Shading and Basic_SkyBox, features were implemented and fixed in to functional OpenFL demos that can target CPP builds including OSX, Windows (should work but not tried it), iOS, Android, Blackberry Playbook and other native targets.

HTML5 and Flash targets are not supported at present but that might be an option going forward. Away3D-TS the TypeScript port provides a HTML/WebGL solution for the web and the original Away3D Flash library serves Flash/Adobe AIR solutions. I was more interested in targetting a number of devices such as desktop, tablet and mobile whilst not having to depend on Adobe AIR as some of my devices don’t and will never support AIR – those being older iPod Touch devices, old Android mobiles and importantly for me was the poor old Blackberry Playbook which, unfortunately will not receive the updates needed to expose Stage3D.

The Demos

Anyway, as you can see in the video, there are a range of devices used to demonstrate each of the demos – some do better than others.

The Source Code

The source code for the demos and more importantly the source for the library are available on github.

This is a very early and unstable codebase. Some of the classes have not been referenced yet so will not compile without some tweaking. Please feel free to fork and issue pull requests if you fix something – and there is still a lot to fix.

Hopefully the port will become more and more complete over the next few weeks and eventually be a complete Away3D V4.x port to OpenFL.