How appropriate is OpenFL for 3d programming?

I’m currently exploring OpenFL, and I see that it has an implementation of Stage3D to create 3d graphics.

I’m kinda curious about it, since using it means that I could stay on OpenFL if I move on to 3d programming. Another plus is that the interface looks pretty simple.

There are a few cons, though: first, help seems hard to find. The API docs are very good, but in this case a few more things would be needed to really know how to use Stage3D, specifically documentation for the AGAL. It probably used to be plentiful, but now that flash is dead and that the links in its docs slowly go dead too, I’m not too sure where to find help for that. All the 3d stuff in OpenFL seems to gravitate around a framework called Away3D, but I don’t want a framework in between and I do not trust the state of the project given the look of the homepage.

Finally, I see that there are quite a number of restrictions on the resources you are allowed to use, namely:

Resource	Number allowed	Total memory
Vertex buffers	4096	256 MB
Index buffers	4096	128 MB
Programs	4096	16 MB
Textures	4096	128 MB
Cube textures	4096	256 MB

AGAL limits: 200 opcodes per program.

Draw call limits: 32,768 drawTriangles() calls for each present() call.

…plus a decent amount of limits on texture sizes:

Texture	Maximum size	Total GPU memory
Normal Texture (below Baseline extended)	2048x2048	512 MB
Normal Texture (Baseline extended to Standard)	4096x4096	512 MB
Normal Texture (Standard extended and above)	4096x4096	2048 MB
Rectangular Texture (below Baseline extended)	2048x2048	512 MB
Rectangular Texture (Baseline extended to Standard)	4096x4096	512 MB
Rectangular Texture (Standard extended and above)	4096x4096	2048 MB
Cube Texture	1024x1024	256 MB

The thing is that I don’t know how big that is; I’ve never done 3d game programming before. Within these constraints, is it possible to make a decent-sized game, or will I be constantly butting my head against the limits? By the way, are those limits still in place in OpenFL, or is it just because it’s a verbatim port of the flash docs?

All in all, is OpenFL usable for 3d games, or am I way better off using something such as Kha?

I am currently using away3D in a current project and it works well. (Use the Git version not the Haxelib version.) The Haxe version seems to be fairly separate from anything related to the a AS3 version so I would not pay any attention to their website. Development on away 3-D seems to be stagnant but it is fairly feature complete in my view. Any other 3-D engines for Haxe which are more active are not related to open FL it seems. If at any point away3D becomes incompatible with a version of Haxe or openFL I will be working to solve that myself and with other partners.

1 Like

If you don’t want to use openFL or away3D you would do well to look at heaps3D or armory3D for kha because they are under active development.

1 Like

Make sure you check out the away 3-D examples repository on the OpenFL GitHub.

Away is a nice engine, far better than using Stage3D direct.

The away foundation is still active but largely focused on Typescript Away and a flash player to play old flash games, AwayFL, evolved from thier work on a TS library that did similar to OpenFL, that was called Away2D?
Rob from Away3D is focusing his team on AwayFL mostly, they are not that actively marketing thier work, I guess they are working to more feature complete release, they have some funding and some talented team-members seems a tie up with an online games portal, but still opensource.

https://awayfl.org/

I used Away3D when it was as3 quite a bit. Some greate features, and some talented members. The haxe away3d repo is fairly stagnent now, but Allan says feature complete,

If your using swf material or 2D graphics with haxe Away3D then then it’s a good engine and easy to use and suitable for complex 3D interaction.

Armory is a good solution if you want to integrate with blender it’s fast and seems popular outside haxe community, no idea if it will stay with Haxe scripting. Heaps 3D seems successful on games but likely requires reading source code more than many 3D engines.

1 Like

Definitely you will learn lots experimenting with away3D.

http://www.closier.nl/prefab/

Adobe still has archives of their Flash Player and AIR documentation on their website:

https://helpx.adobe.com/air/archived-docs-download.html

This should include documentation and articles about Stage 3D (including lower level stuff, as I recall, and not only how to use higher level frameworks like Away3D).

jacksondunstan.com has many articles on Stage3D (Flash version). I have no experience using it myself, though.

I have used away3d sharing context with away3d/feathers&starling in as3, I presume it’s similar in OpenFL, I have not really had a commercial reason to explore away3d for haxe beyound checking an early demo? I could look to create a demo if there was an interest.
Confidant is using away3d on a real project so it must be reliable, I know the as3 one was robust.

You can try embedding away3d swf…

certainly some swf’s made in haxe will run in the away3d player, and obviously you should be able to run away3d in OpenFL directly.

Haxe is likely soon moving on from swf generation.

Currently I do not believe NME supports away3D, because NME does not implement Stage3D, but it maybe viable to add to NME.