Closed garrett-hopper closed 7 years ago
@ncannasse hopefully this is somewhat helpful. I'm going to need some time digging into the internals to figure out the actual issue here. Thanks for any help you can provide and your excellent work in creating heaps.
@ncannasse I'm curious; were Evoland and Northgard built for release using lime or hashlink?
@Jumblemuddle Northgard is built using hashlink, thats for sure. As for the Evoland I guess it was Air
As for the Lime support, you're right Lime is missing some additional GL constants that we have added recently. There are two possibilities : one is to use #if(js || lime) so we are sure to keep GL ES compatibility, another is to submit a patch to Lime so they add support for the new constants.
Regarding HTML5/Lime, this is not necessary since you can directly compile Heaps to JS without OpenFL
After commenting out the FloatTexture constants which aren't supported by lime I was able to compile with openfl test mac
, in folder samples/build/base3D
.
Nearly. I got the following error message:
Link: ApplicationMain
Error : An error occurred compiling the shaders: ERROR: 0:1: '' : version '100' is not supported
ERROR: 0:2: 'precision' : syntax error: syntax error
(#version 100)
In the shader code for e.g. BaseMesh.hx there is no version string. How can I fix this? Has it to do with my GPU which is rather old (Nvidia 8800GTX)?
After brutally commenting out the version stuff in hxsl/GlslOut.hx
I get:
Error : An error occurred compiling the shaders: ERROR: 0:15: GLSL 110 does not allow sub- or super-matrix constructors
(transformedNormal = normalize((normal * mat3(mat4(vertexParams[0], vertexParams[1], vertexParams[2], vertexParams[3]))));)
Guessing that for older versions it has to be like this: mat3(vertexParams[0].xyz, vertexParams[1].xyz, vertexParams[2].xyz)
I think it's in h3d.shader.BaseMesh.x:59
transformedNormal = (input.normal * global.modelView.mat3()).normalize();
is transpiled to:
transformedNormal = normalize((normal * mat3(mat4(vertexParams[0], vertexParams[1], vertexParams[2], vertexParams[3]))));
Got it running :)
In h3d.shader.BaseMesh.hx
changed:
transformedNormal = (input.normal * global.modelView.mat3()).normalize();
to: transformedNormal = (input.normal * global.modelView.mat3x4()).normalize();
Ok, I know, not the right way, but after some fruitless efforts I urgently want it to run. At least I know now that there is a way.
Off-topic not really issue-related: I'm really impressed by this library. It's a huge effort. After doing 3D-Engine stuff for the last 15 years myself and finally transitioned to unity3d (with a heavy heart) and also BabylonJS (because my engine worked solely on windows, lack of cross platform capabilities). I'm looking for alternatives that could work on all platforms and your work is very promising in that regard. In fact it's more being overwhelmed - in a positive sense.
I'm writing a Pool Billard Engine with almost 100% correct physics (analytical solution, no delta time simulation) and it should run hardware-accelerated on OS X, Windows, Web, iOS and Android. I made native Applications (OpenGL/ES based) also emscripten for Web as my code base is C++, but maintenance for all platforms is hard. In process of time that leads to the situation where I only support my currently favorized platform (OS X), which is bad. I also liked DirectX (learned how to write component based C++ from DirectX ) but sadly it's only on Windows.
I will definitely dive deeper into Haxe and Heaps.
samples/build/base3D: openfl test android
-> build succeded.
but the app froze my phone :(
samples from openfl are all working on my android device (not emulator)
Lime is not officially supported, please submit a PR if you wish to see it fixed.
I figuring out that I needed to use the git version of hlsdl instead of the haxelib version for the HashLink samples to build. (While running
haxe all.hxml
) After I got the hl, swf, and js samples building, I tried to build using lime.From what I can tell the main issue is that lime doesn't implement all of the GL variables that are expected. (Similar to the errors I was seeing with haxelib's hlsdl 1.1.0) Perhaps lime hasn't been updated to some new spec in the same way that hlsdl's git version was updated?
I worked through the GL errors with lime, and I believe I've found a workaround for these errors. Though I'm definitely nieve in this regard.
https://github.com/Jumblemuddle/heaps/commit/f8d3913ccd4a44d7b56a5aee0707835ee968c317
GlDriver.hx#getChannels
, as without it I was getting an error.GL.RGBA8
,GL.RGBA32F
,GL.RGBA16F
,GL.ALPHA16F
,GL.ALPHA32F
, andGL.HALF_FLOAT
while building for lime. (Were these ever present in Lime's GL implementation?)This seemed to allow lime to build android and linux mostly, but it still failed on html5.
It should be noted that arbitrarily choosing the samples/pad example for testing. I will try others in the future. I'm assuming there isn't something specifically wrong with this sample?
HTML5
HTML5 failed with:
The getCanvas seemed to be an issue because even with
@:privateAccess
tohxd.Stage#getCanvas
(I suppose this might need to be@:access
? I can't seem to find any documentation on@:privateAccess
, even though I see it multiple times in that file.),hxd.Stage#getCanvas
only has an@:allow
forhxd
.Android
The android build mostly built, but then it threw:
It seems the
--stacktrace
flag is for the actual command to build for android, not for lime.Linux
The linux build seemed to succeed, but it seems I'm missing a libstdc++.so.6 library.