Comments (13)
Indeed this would be great - especially because BabylonHx was created to be used as a 3D engine in http://gamestudiohx.com/ (which already has very powerful and complete 2D features).
But the problem is that this is not possible yet, see here openfl/openfl#35
from babylonhx.
Ok, they said it is actually possible but we have to make sure that GL is in a clean state so openfl displaylist can work.
@dazKind points us to the cleanup code used in foo3D: https://gist.github.com/dazKind/9082219
I am looking at the lost context problem and will see if I can force the cleanup… maybe the Engine will have to keep track of some IDs? I am not sure about the details…
from babylonhx.
I can make the displayList (a textearea + a bitmap) appear using the following lines after GL.flush() but then the babylon view disappear…
GL.disable(GL.CULL_FACE);
GL.useProgram(null);
GL.bindBuffer(GL.ARRAY_BUFFER, null);
GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, null);
I imagine the babylonhx context has to be restored at the beginning of the next frame.
from babylonhx.
In my opinion this is crucial. How else are we going to implement ui :) is this actually possible? I know that in away3d port you can do that. Sorry i have very basic knowledge of how gl works, im trying to understand if babylon is really fit to my current projects needs.
from babylonhx.
The latest commit allows mixing BabylonHx with OpenFl display list (tested only on Windows/C++). I've successfully added few sprites above 3D scene and some haxeui controls too. It crashes however sometimes with click/hover events on haxeui controls but I made a few very basic/dirty examles ... Anyway, consider this a VERY experimental change.
from babylonhx.
Thanks for taking this into consideration first :) i tested this on iPhone 5 and Mac(C++), both reproduces the following situation: i can add blank sprites (nothing new), but now if i draw a rect oh sprite.graphics and/or add a bitmap into it, babylonview disappears but i can see the content of the sprite. i will test on android once i get the device on my hand.
from babylonhx.
I have no such problems on win build, and neko build works too. However, I'm seeing huge difference in CPU usage - 3D+2D mix takes a lot more CPU then pure 3D on win build, neko build doesn't suffer from this problem.
The problem you have might be connected to where in the code you add 2d content. In my example, I'm placing 2d code in 'SceneLoader.Load' function, when the scene is created and loaded, right below 'scene.executeWhenReady'. Basically you add 2d stuff at the bottom - when you're done with 3d
from babylonhx.
Great,
In my tests flash.text.TextField is incompatible with particles…
When I have particles and a textfield, particles disapear and the textfield is unreadable.
When I disable particles the textfield is correctly rendered.
When I remove the textfield particles appear.
from babylonhx.
Strangely, adding a bitmap make the particles appear (but text is still unreadable white squares).
from babylonhx.
And bitmap alpha is black.
from babylonhx.
Looks like texfields or particles have some leaking state. Make sure you reset the blendfunc to SRC_ALPHA and ONE_MINUS_SRC_ALPHA. That should fix the missing alpha.
from babylonhx.
Concerning the FPS loss, I have the same experience with IOS.
Anyway using the regular openfl display list isn't a solution for games since it is mainly software based and would slow down things.
I am afraid babylonhx is missing the regular 2d accelerated stuff (bitmapfont, spritesheet, sprites, etc). It's logical since babylonjs only targets html and relies on html/css for the UI.
from babylonhx.
Sprites and 2D layers are actually on the list of Babylon features. They can be used as a starting point for building some kind of UI.
Check 'Scene #1' example in features tests on BabylonJs site.
from babylonhx.
Related Issues (20)
- Decals.hx HOT 4
- Picking with instances HOT 1
- SpriteManager update HOT 3
- Stop crazy "func" from "void" if i select scene than they are using avoid.
- jiglib dependency HOT 3
- Issue with openfl samples HOT 8
- Warning : maybe loop in static generation of com.babylonhx.math.Vector3 HOT 5
- Rotation in Space.WORLD completely buggy HOT 7
- Change gravity based on accelerometer values (on mobile) HOT 5
- Texture and Light issue HOT 9
- Default setup and test has failed in first time HOT 2
- Device Orientation Camera (mobile target) HOT 4
- Errors with Haxe 3.4.0-rc.2, Lime 3.5.2, hxcpp 3.4.2 HOT 4
- Chrome crashes on reload with some samples HOT 3
- Testing basic scene with Lime 3.7.4 and Haxe 3.4.0 HOT 2
- Pointlight & Shadows
- NME 6 compatibility
- Type not found : PerlinNoise HOT 2
- Type not found: lime.Assets HOT 2
- Dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylonhx.