Skip to content
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

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

Open
SugarRayLua opened this issue Nov 27, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@SugarRayLua
Copy link

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

@Luke100000
Copy link
Collaborator

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!

@SugarRayLua
Copy link
Author

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.

@SugarRayLua
Copy link
Author

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.

@Luke100000 Luke100000 added the bug Something isn't working label Mar 7, 2023
@SugarRayLua
Copy link
Author

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).

@Luke100000
Copy link
Collaborator

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.

@SugarRayLua
Copy link
Author

Understood-- thank you.

@Luke100000
Copy link
Collaborator

Fixed the errors you sent

Luke100000 added a commit that referenced this issue May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants