3dreamengine/3DreamEngine

Doesn't fully render correctly all of the examples on love2d-11.4 installed on iPad iOS 16.1

SugarRayLua opened this issue · 7 comments

Hi. I'm a novice Lua mobile programmer and Love2D newbie and just found and tried out your 3DreamEngine and love it--it is amazing! I think it will help me create some amazing apps :-)

However, the 3DreamEngine doesn't seem to render correctly on my iPad iOS 16.1 installation of love2d-11.4 all of the examples included in the github repository. Most work well; however, the 3DreamEngine rendered seems to not be able to render and leave out a large portion of the scene in the firstpersongame example (see attached screenshot). On my Mac with love2d-11.4 installed, the firstpersongame is rendered beautifully and flawlessly.

I understand that the graphics capability of the iPad Pro is inferior to a Mac; however, I thought that with Love2D utilizing the same Lua and SDL libraries for the different distributions (and that the iPad Pro supports SDL) that my iPad would be able to render the firstpersongame example.

Is there something that can be changed on my end on the iPad that could get it to render the first person game example or is it an incompatibility of the 3DreamEngine with iOS?

Thanks again for developing such an amazing 3D engine to Love2D. image

Roughly related to #57
It looks to me like a reduced bit depth for the depth buffer may cause issues, I will investigate that. Thanks for the report and kind words!

Thanks for your prompt reply and checking into it :-)

(PS, I'm also going to write the love.js maintainer; I was hoping to be able to use love.js to port 3DreamEngine projects I make to the web but the port wouldn't run-- it said it couldn't find a "remote file")

I look forward to seeing what I can create with the 3DreamEngine.

Have a good rest of your weekend.

PS, @Luke100000,
One of the developers on the love2d github site that I previously asked about mobile/desktop Love graphic compatibility, wrote this tip:

"For those shaders, on mobile devices love uses OpenGL ES, whose shading language is a little more strict and limited compared to desktop OpenGL.

You can write shaders that are compatible with both as long as a few things are kept in mind. For example uniform/extern variables can't be initialized to constant values in the shader code, you have to use Shader:send instead. And there's no implicit conversion between float and int variables in OpenGL ES' shading language - typically you'd want to stick with floats most places, but when you do need to use ints you can explicitly cast between float and int:

float myFloatVariable = float(myIntVariable);
int myNewIntVariable = int(myFloatVariable);"

Not sure if some of that information might be why the 3DreamEngine works perfectly on desktop and doesn't render some things on my iOS and the Android device you mentioned. Not sure if you were intending to have the 3DreamEngine compatible with both desktop and mobile Love devices nor if it would now be difficult to modify the 3DreamEngine to be equally as compatible with iOS and Android devices running the 3Dream Engine.

Fyi and have a good rest of your week.

Thanks for working on this, @Luke100000. :-)

It sounds like from the discord forum that its working now well on your phone (android)? Unfortunately now none of the shaders seem to work on iOS (iPad). I can run the main screen but when I try and start any of the examples I get the following error:

Error

Cannot link shader program object:
WARNING: Output of vertex shader 'VaryingColor' not read by fragment shader
ERROR: Input of fragment shader 'varyingTangent' not written by vertex shader
ERROR: Input of fragment shader 'varyingBitangent' not written by vertex shader

Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newShader'
3DreamEngine/shader.lua:387: in function 'getRenderShader'
3DreamEngine/classes/scene.lua:188: in function 'addMesh'
3DreamEngine/classes/scene.lua:136: in function 'addObject'
3DreamEngine/classes/scene.lua:131: in function 'addObject'
3DreamEngine/classes/scene.lua:72: in function 'add'
3DreamEngine/render.lua:31: in function 'buildScene'
3DreamEngine/render.lua:146: in function 'render'
3DreamEngine/render.lua:342: in function 'renderFull'
3DreamEngine/render.lua:495: in function 'present'
examples/AlphaBlending/main.lua:46: in function 'draw'
run.lua:34: in function run.lua:10
[C]: in function 'xpcall'

not sure if a simple correction or actually running shader code on Android that much different than iOS. I tested the latest repository today (download from github today).

That's the curse of every glsl compiler being different :( I can fix the error you mentioned, but then something else will pop up, and I do not have access to an iOS.

Understood-- thank you.

Fixed the errors you sent