is it still alright to use away3d in 2023 as its been quite some time since it was updated and is it compatible with todays hardware ?
Alan continues to use Away3D on a comercial project that he talked about some years ago, but still uses away.
It has been used on PI 4
https://twitter.com/gepatto/status/1641410116472676354
Away3D haxe version I believe uses OpenFL’s Stage3D which I think normally relys on OpenGL / WebGL, so that is still pretty much anywhere. OpenFL is still actively developed and OpenFL’s Stage3D is also used by Feathers, so largely Away3D haxe version is decoupled and relys on OpenFL Stage3D, font, bitmap etc… and does not directly care so much - if OpenFL/Lime tries now or in the future to use Metal or something else underneath. So it is very compatible with modern hardware but will not take advantage of all graphics cards to the same level as say something like unreal might, and with ios you may find the metal support is not there yet so apple may well mess you up in the future.
To clarify not used away3d really since as3. But have fiddled with GL in haxe can try to explain my minimal understanding of away3d abstraction.
you can see for instance here some of the geometry buffers being setup in away3d with the context and stage3d in classes like:
so it uses a texture which kind of uses a bitmap on the geom. For instance see bitmap texture here
Then you can see the renderer for instance see this one here
So largely away3d is using stage3d abstraction to manage setting up a GL context, buffers, textures, etc… to pass to the shaders.
Really if you look at lubos kha tutorials for kha based on opengl you get a low level explaination for what sort of stuff stage3d is also kind of doing.
So away3d is not really working with WebGL or OpenGL it is working with the flash style software renderer in openfl and the stage3d renderer a GL wrapper. So it partially does not actually completely care on all hardware detail, so much like Starling library renders Quads though stage3d. How stage3d works is somewhat dislocated.
So for faster 3D you can perhaps use Lime and webGL2 api ( covers opengl as well, forget the class names ) but then you have to manage the mess of dealing with attaching and disconnecting buffers, textures, attributes, mipmaps and all that mess.
Away3D → Stage3D context / Bitmaps / fonts / enterframe → WebGL/OpenGL ( metal…? )
Thanks for the shoutout @nanjizal
Yes I’m using Away3D successfully for that project and would still choose it for my current needs—mainly that it integrates with other OpenFL libaries such as FeathersUI nicely. If you are ever wanting augmented reality out of the box it may be better to use a library which supports GLTF format out of the box, such as Babylon3D. I am using GLTFTools library with Away3D for generating GLTF models.
i see , i thank both of you for the clear explanation and @Confidant does the hashlink or neko builds work on your side because the only builds working are html5 and electron
@TravelerofTheNight Sorry for the late reply—I was on vacation. Yes I am able to build for Hashlink. I haven’t tried Neko. I’m on Mac M1, using Haxe 4.1.5 for that.
My Hashlink is rather unique in that it is running on the server (including Away3d) and it uses no window. I have not actually tried viewing the Away3D rendering in Hashlink.
I don’t know if these problems still exist and would appreciate if there’s an update …?
But if not, I hope I can help prevent people getting the same headaches I got when I built for html5.
One big issue was the memory leak as the dispose() method did not work at all. No matter what I tried (also using the stage3dmanager / stage3dproxy, etc.).
Switching between 3D and pure OpenFl was not possible without watching the RAM bloating.
What I believe did work pretty good was combining Starling and Away3D (via Stage3DProxy) to switch between 2d and 3d in an older project.
Second big problem was regarding alpha blending and the depth buffer / z-sorting.
If you ever want to use transparent textures and see your 3d objects flickering into each other, the weird solution is, no joke, setting the zOffset exactly to -432.
https://github.com/away3d/away3d-core-fp11/issues/658#issuecomment-328541985
Its been a while since I’ve used Away3D - and the samples do no longer work, heaps of changes obviously in frameworks / version compatibility.
Is there any working Away3D samples that use the latest version of OpenFl/Lime/Haxe/Away3D?
Seems like its a bit broken to me. I really want to get stuck back into using Away3D, but its been maybe 8 or 9 years since last touched it.
I’ve tried to downgrade OpenFl to 3.5.3 and Lime to 2.8.3 as per the Away3D sample says for its dependencies but is giving other build errors, so thought I’d try see if theres any examples of the Stage3D sample using the latest version so I can use the latest version of the frameworks.
If you’re going to downgrade OpenFL and Lime that far, you will probably also need to downgrade Haxe to at least Haxe 3.4.7. Possibly further back than that.
The Git version works perfectly for me. I think it’s only the Haxelib release that’s out of date.
Hi @player_03 - can you please let me know the versions of openfl, lime and haxe you have? so I can have a look? did you pull the away3d framework from github, not from the packages repo (openfl install away3d) ?
Yeah, download Away3D from GitHub.
@player_03 if you get a moment, can you please let me know what versions of openfl/haxe/lime you have installed to get it working ?
I just grabbed the newest away3d and away3d-samples from GitHub. The couple of projects that I randomly tried (Particles, Tweening3D) worked correctly with Haxe 4.3.2, OpenFL 9.3.2, and Lime 8.1.1, which are the newest versions of everything at the time that I’m writing this.
Hi there, can you try the Stage3DCamera sample? thats the one I’m trying to run with issues
Versions: openfl 9.3.2, lime 8.1.1, haxe 4.3.2
Git clone GitHub - openfl/away3d-samples: Away3D sample projects
in the away3d-samples, looked at one you had working “Tweening3D”, and tried running “openfl test flash” and got so many build errors.
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/textures/Anisotropy.hx:3: characters 1-7 : Warning : (WDeprecatedEnumAbstract) `@:enum abstract` is deprecated in favor of `enum abstract`
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/managers/RTTBufferManager.hx:215: characters 4-60 : error: Int should be UInt
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/managers/RTTBufferManager.hx:215: characters 4-60 : ... have: openfl.Vector<Int>
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/managers/RTTBufferManager.hx:215: characters 4-60 : ... want: openfl.Vector<UInt>
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:525: characters 44-53 : Field set_width should be declared with 'override' since it is inherited from superclass flash.display.Sprite
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:525: characters 44-53 : Field set_width overrides parent class with different or incomplete type
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:196: characters 19-28 : ... Base field is defined here
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:525: characters 44-53 : ... error: Void should be Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:525: characters 44-53 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:525: characters 44-53 : ... want: (...) -> Float
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:576: characters 44-54 : Field set_height should be declared with 'override' since it is inherited from superclass flash.display.Sprite
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:576: characters 44-54 : Field set_height overrides parent class with different or incomplete type
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:180: characters 19-29 : ... Base field is defined here
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:576: characters 44-54 : ... error: Void should be Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:576: characters 44-54 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:576: characters 44-54 : ... want: (...) -> Float
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/render/BackgroundImageRenderer.hx:119: characters 3-61 : error: Int should be UInt
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/render/BackgroundImageRenderer.hx:119: characters 3-61 : ... have: openfl.Vector<Int>
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/core/render/BackgroundImageRenderer.hx:119: characters 3-61 : ... want: openfl.Vector<UInt>
Export/flash/haxe/ApplicationMain.hx:147: characters 3-34 : ... Called from macro here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/Scene3DEvent.hx:17: characters 19-29 : Field get_target should be declared with 'override' since it is inherited from superclass flash.events.Event
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/Scene3DEvent.hx:17: characters 19-29 : Field get_target overrides parent class with different or incomplete type
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/events/Event.hx:114: characters 19-29 : ... Base field is defined here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/Scene3DEvent.hx:17: characters 19-29 : ... error: Dynamic should be openfl.utils.Object
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/Scene3DEvent.hx:17: characters 19-29 : ... have: (...) -> Dynamic
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/Scene3DEvent.hx:17: characters 19-29 : ... want: (...) -> openfl.utils.Object
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:515: characters 44-53 : Field get_width should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:566: characters 44-54 : Field get_height should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/TouchEvent3D.hx:115: characters 15-22 : This field cannot be accessed because it is not a real variable
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/events/Event.hx:92: characters 19-48 : Add @:isVar here to enable it
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/TouchEvent3D.hx:112: characters 29-40 : Field get_bubbles should be declared with 'override' since it is inherited from superclass flash.events.Event
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/events/MouseEvent3D.hx:164: characters 29-40 : Field get_bubbles should be declared with 'override' since it is inherited from superclass flash.events.Event
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:486: characters 44-55 : Field get_filters should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:500: characters 44-55 : Field set_filters should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:500: characters 44-55 : Field set_filters overrides parent class with different or incomplete type
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:179: characters 19-30 : ... Base field is defined here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:500: characters 44-55 : ... error: Void should be Array<openfl.filters.BitmapFilter>
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:500: characters 44-55 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:500: characters 44-55 : ... want: (...) -> Array<...>
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:613: characters 44-49 : Field set_x should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:613: characters 44-49 : Field set_x overrides parent class with different or incomplete type
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:197: characters 19-24 : ... Base field is defined here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:613: characters 44-49 : ... error: Void should be Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:613: characters 44-49 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:613: characters 44-49 : ... want: (...) -> Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:632: characters 44-49 : Field set_y should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:632: characters 44-49 : Field set_y overrides parent class with different or incomplete type
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:198: characters 19-24 : ... Base field is defined here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:632: characters 44-49 : ... error: Void should be Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:632: characters 44-49 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:632: characters 44-49 : ... want: (...) -> Float
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:651: characters 44-55 : Field set_visible should be declared with 'override' since it is inherited from superclass flash.display.Sprite
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:651: characters 44-55 : Field set_visible overrides parent class with different or incomplete type
C:/HaxeToolkit/haxe/lib/openfl/9,3,2/lib/flash-externs/src/flash/display/DisplayObject.hx:195: characters 19-30 : ... Base field is defined here
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:651: characters 44-55 : ... error: Void should be Bool
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:651: characters 44-55 : ... have: (...) -> Void
C:/HaxeToolkit/haxe/lib/away3d/5,0,9/away3d/containers/View3D.hx:651: characters 44-55 : ... want: (...) -> Bool
From the error messages, you still seem to be using Away3D 5.0.9. Can you try haxelib git away3d https://github.com/openfl/away3d.git
?
Stage3DCamera from openfl-samples? Yep, works for me. At least when I clone from GitHub. I didn’t try installing openfl-samples from Haxelib.