vujadin / BabylonHx

Port of Babylon.js 3D engine to Haxe.
http:/paradoxplay.com/babylonhx
Apache License 2.0
189 stars 43 forks source link

Testing basic scene with Lime 3.7.4 and Haxe 3.4.0 #141

Open maitag opened 7 years ago

maitag commented 7 years ago

Ahoi, on cpp (win7) basic scene sample works fine, but for html5 there is something new in Lime for webgl. It did not found Gl with ...getContext("webgl", options) here: -> https://github.com/vujadin/BabylonHx/blob/master/com/babylonhx/Engine.hx#L260 so changing it to "webgl2" it goes a little bit forward:

"Engine.hx:450: BabylonHx - Cross-Platform 3D Engine | 2017 | www.babylonhx.com | GL version: WebGL 2.0 | GL vendor: Mozilla | GL renderer: Mozilla"

but then more Errors in loading shader Assets:

[lime.utils.Assets] There is no TEXT asset with an ID of "assets/shaders/legacydefault.vertex.fx"
[lime.utils.Assets] There is no TEXT asset with an ID of "assets/shaders/legacydefault.fragment.fx"

so i tryed to copy the missing shaders from com.babylonhx/shader to assets/shader but then:

Effect.hx:361: Unable to compile effect: legacydefault Effect.hx:362: Defines:

define SPECULARTERM

define NORMAL

define LIGHT0

define HEMILIGHT0

define BonesPerMesh 0

define NUM_BONE_INFLUENCERS 0

Effect.hx:364: Error: ERROR: 0:? : '' : syntax error

i get stuck again :(

jgranick commented 7 years ago

I did a pass using a development version of Lime 4:

https://github.com/jgranick/BabylonHx/tree/lime4

It works up to the same position, in Firefox it reports a more helpful error message:

String contains the illegal character '65279'

Perhaps this is an issue with the source fragment shaders? I've never seen this error with any Lime project before

EDIT: Update, this is caused by a byte-order mark in these files, removing fixed the error. Now nothing appears to happen, so there must be a logic issue next

maitag commented 7 years ago

ah, basic scene is working again (with lime 3.7.4) -> changing text-format of legacydefault-shaders from utf-8 to ansi and it works !

Joshua, cool stuff with Lime 4 ... it looks more clean in handling gl-rendercontext. ( runs now on html5 + FF -> https://github.com/jgranick/BabylonHx/pulls :)