-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MainOpenfl Not Working #40
Comments
I'm having same trouble getting the MainNME to work. It builds without errors and enters the BasicScene class but does not display any meshes. Update: I got it working by un-commenting this line: new Layer("background", "assets/img/graygrad.jpg", scene, true);) I had commented it out because I did not want to go on a hunt for the image. Didn't think it would matter. What is a Layer and why is it necessary? |
OpenFL build is broken with the latest OpenFL release. Still haven't figured out why. About layer, it that particular case it behaves as a 'background image' (it shows stratched png image of radial gradient) |
I've got the OpenFL build working with the latest release with following code. package; import lime.app.Application; import openfl.display.Stage; import com.babylonhx.Engine; /**
class MainOpenfl extends Application {
} I think the problems was how the Stage got added and how the main Sprite was added to the Stage. I worked off of the new MainLime and incorporated the OpenFl components. |
This doesn't work for me (win). Do you work on Mac ? |
Hmm....I thought I was full updated, but I guess the haxelib repo wasn't updated until yesterday. When I ran haxelib update openfl today I got the following: C:/HaxeToolkit/haxe/lib/openfl/3,3,3/openfl/_internal/renderer/cairo/CairoTextField.hx:6: characters 7-40 : Type not found : lime.graphics.cairo.CairoFontFace And others if I commented out the import of CairoFontFace. Seems bad form to me to remove something without a replacement. I guess we have to wait now.... |
You need to update lime too. |
Thought I did that too.....Haxe needs a better package manager. Anyway, now I am getting this which is BHx related: com/babylonhx/tools/Tools.hx:527: lines 527-530 : img : lime.graphics.Image -> Bool should be Bool |
yes, lime has switched to futures/promises... huge update is coming in a On Tue, Sep 8, 2015 at 8:44 PM, primesoftware notifications@github.com
|
Coming from a Java background and having used the Netty project I cringe when I hear Futures/Promises......I understand the benefit but they really are a nuisance. |
I've just pushed a huge update. it should build now |
Close....the Lime errors are gone but now this: com/babylonhx/physics/plugins/OimoPlugin.hx:380: characters 92-116 : Array has no field toArray |
ok, OimoHx is updated also now :) |
com/babylonhx/physics/plugins/OimoPlugin.hx:380: characters 92-108 : For function argument 'array' Change those lines to ....#else body.getMatrix().toArray() #end; |
that's strange ... you've updated oimohx lib in the root of the project ? On Tue, Sep 8, 2015 at 10:20 PM, primesoftware notifications@github.com
|
Yes all updated. I'm targeting windows, |
Hi vujadin Just to say that I performed a git update of BabylonHx and OimoHx (so as an haxelib upgrade of lime and openfl) and I have the same result as with previous version. My pure openfl project works fine when compiling for html5 target (with the -Ddom compilation flag) but still render as a black screen (after a few milliseconds scene display) for cpp (windows or android) targets. So does the new update only fix lime futures/promises changes or was it also supposed to fix the "shader" problem? If not, could you restore your "invisible mesh dirty hack" in the Scene class and push it to the repository to see if it can temporarily fix the problem? Thanks Bytheway, looking at my android debug log, just after the message |
ramsestom, "invisible mesh dirty hack" wont work here as Lime build works fine. This is OpenFL problem. Can you get a call stack from that debug log ? If we can track down the function which makes this call, we could maybe solve this issue. |
I don't see why the "invisible mesh dirty hack" won't work as the issue is the same as with lime previously (first frame displayed then black screen). If it was fixing it for lime, why wouldn't it for openfl? Maybee it wouldn't but we can't know before having tried. So I think it is worth trying... As for the android debug log. I can't know the function that make the bad call from it unfortunately. As the error probably appear in a native opengl call, this error is not traced back to the haxe function that called it. The only way I see to try to identify the problematic function would be to put some trace flags at different points of the scene class and see between which trace calls the issue appears...
The issue reported with the latest babylonHx version is different that the one I had with the previous one (GL_INVALID_OPERATION vs GL_INVALID_ENUM with the previous one) but the symptom is still the same (first frame display then black screen) |
I just tested with the CSGDemo rather than with the BumpMap sample with openfl and it is working! So the "one frame" issue on android seems to occur only on some specific cases... Is it because CSGDemo use mesh? if so, the "invisible mesh hack" should work to make all samples to work with openfl... |
Strange enough CSGDemo shows only one frame for me :) then you set its alpha to 0.01 and in your update() function set its position in front of your camera, so it never leaves frustum. And that's it. |
Well I haven't the black box issue when rendering text in front of a babylon scene with openfl (with CSGDemo sample). However, my text is rendered as if looking in a miror and at wrong position on android. For example the following code: render as: whereas on html5: But the advantage of using openfl rather than lime is that you can use any framework built on top of openfl (I use haxeflixel and my final goal is to be able to use BabylonHx in my haxeflixel games to render 3D). |
@ramsestom How did you get "test" to show at all? Do you have a complete example? I've been trying to get a TextField to show, but no luck. I know it is there because I see the cursor change, but I don't see the text. I've also had some success in including StablexUI, but it also won't show if I add Babylon to the stage. Without rendering Babylon it works just fine. BabylonJS has a GUI called cGUI. I'm considering working on a project to get a GUI interface for BabylonHx. It would be an asset to the community. |
Yes. My example test class was pretty simple actually: package; import openfl.display.Sprite; import com.babylonhx.Engine; class Main extends Sprite {
} with CSGDemo beeing the CSGDemo class from the babylonHX example project And I am using openfl next as I couldn't make babylonHx to work with openfl legacy :( |
@ramsestom This is not working for me :( |
Something happended since then? I'm looking for a way to simply show Text over the 3D Scene, this would be fundamental for a game I think ;) |
I re-cloned the repository and tried to build the OpenFL examples. The MainOpenfl class is not working for me. It builds but all I get is gray screen if I try to load the BasicScene sample. No error messages. The MainLime builds and works fine though.
Here is my project.xml for OpenFl builds:
The text was updated successfully, but these errors were encountered: