Why faking 3D nowadays?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Wed Apr 04, 2018 8:44 pm

Davidobot wrote:
Wed Apr 04, 2018 8:07 pm
While your matrix that works is:

Code: Select all

{
     1.3,    0,  0,  0,
       0,    0,  1,  1,
       0, -1.7,  0,  0,
    -450, -120, 50, 50,
  }
Ahh, okay, I get it now. You're referring to the first demo. In the first demo I didn't follow any particular convention, I just played with the distance, height and a 90° rotation until I got the image visible. I can't remember how exactly I generated it, but probably the Z rotation is eliminated and there's some Y and Z displacement (or X and Z). I'm not even sure how Löve generates the geometry; it's probably a rectangle on X and Y with Z=0 but I didn't care that much.

In the second demo, I paid close attention to being consistent in my conventions for the axes and the rotations I was applying, so that everything made sense. If you want to know what you're doing, I suggest you use the second demo as a basis, placing the objects in 3D coordinates that you have full control of.

User avatar
4aiman
Party member
Posts: 236
Joined: Sat Jan 16, 2016 10:30 am

Re: Why faking 3D nowadays?

Post by 4aiman » Sun Apr 08, 2018 11:36 am

Wow! So many examples and even demos :)
Too bad neither one works on my Android device the way it does on Linux Desktop.
Seems strange that Adreno530 is incapable to understand the shaders.
But I want to thank you for your time anyway.
Maybe I'll try to target desktop first and then sort it out for Android.

Regards!

User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Sun Apr 08, 2018 2:21 pm

4aiman wrote:
Sun Apr 08, 2018 11:36 am
Wow! So many examples and even demos :)
Too bad neither one works on my Android device the way it does on Linux Desktop.
What's wrong with it? Does any program that uses hardware-accelerated 3D work in that device at all, like, say, Minetest?

User avatar
4aiman
Party member
Posts: 236
Joined: Sat Jan 16, 2016 10:30 am

Re: Why faking 3D nowadays?

Post by 4aiman » Mon Apr 16, 2018 9:26 pm

It gives me errors on lines 54, 55 95 etc.
"Wrong operand types", "no matched overloaded function found" for "sqrt" invocation etc.

I haven't had any issues with any 3d app until I tried to use some shaders in love2d on Android.
Anyway, what does Minetest have to do with love2d or shaders? When I checked last time, mobile version had broken shaders on mobile devices.
If you want exact error message I'm getting - feel free to ask ^_^

User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Mon Apr 16, 2018 10:58 pm

4aiman wrote:
Mon Apr 16, 2018 9:26 pm
It gives me errors on lines 54, 55 95 etc.
"Wrong operand types", "no matched overloaded function found" for "sqrt" invocation etc.

I haven't had any issues with any 3d app until I tried to use some shaders in love2d on Android.
Ah, okay. So I guess even the default shader errs out.

Code: Select all

love.graphics.setShader(love.graphics.newShader[[
vec4 position(mat4 transform_projection, vec4 vertex_position)
{
    // The order of operations matters when doing matrix multiplication.
    return transform_projection * vertex_position;
}
]])
(from https://love2d.org/wiki/love.graphics.newShader)

If so, that would be a compatibility problem with the internal code added by Löve to the shader. Maybe the developers are interested, in case you feel like helping.

4aiman wrote:
Mon Apr 16, 2018 9:26 pm
Anyway, what does Minetest have to do with love2d or shaders? When I checked last time, mobile version had broken shaders on mobile devices.
Never mind that. I misunderstood where the issue was.

4aiman wrote:
Mon Apr 16, 2018 9:26 pm
If you want exact error message I'm getting - feel free to ask ^_^
I'm curious to see it. If you want to file an issue in the issue tracker, that information will be valuable in tracking it down. https://bitbucket.org/rude/love/issues

User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Mon Apr 30, 2018 11:17 am

4aiman wrote:
Mon Apr 16, 2018 9:26 pm
It gives me errors on lines 54, 55 95 etc.
"Wrong operand types", "no matched overloaded function found" for "sqrt" invocation etc.

I haven't had any issues with any 3d app until I tried to use some shaders in love2d on Android.
Anyway, what does Minetest have to do with love2d or shaders? When I checked last time, mobile version had broken shaders on mobile devices.
If you want exact error message I'm getting - feel free to ask ^_^
I've created another version (attached) that passes raw code to the shader, rather than letting LÖVE create the code.

I'd appreciate if you can test it and tell me the error message(s) you get. I'd expect the line numbers to be lower in this case. The attached program works in my desktop and in my Android phone. This should narrow down whether the issue is in the LÖVE side or in the phone side.
Attachments
demo3d4.love
(69.32 KiB) Downloaded 21 times

tlcarus
Prole
Posts: 4
Joined: Wed Mar 28, 2018 2:54 pm

Re: Why faking 3D nowadays?

Post by tlcarus » Mon May 14, 2018 8:25 am

pgimeno wrote:
Mon Apr 30, 2018 11:17 am
4aiman wrote:
Mon Apr 16, 2018 9:26 pm
It gives me errors on lines 54, 55 95 etc.
"Wrong operand types", "no matched overloaded function found" for "sqrt" invocation etc.

I haven't had any issues with any 3d app until I tried to use some shaders in love2d on Android.
Anyway, what does Minetest have to do with love2d or shaders? When I checked last time, mobile version had broken shaders on mobile devices.
If you want exact error message I'm getting - feel free to ask ^_^
I've created another version (attached) that passes raw code to the shader, rather than letting LÖVE create the code.

I'd appreciate if you can test it and tell me the error message(s) you get. I'd expect the line numbers to be lower in this case. The attached program works in my desktop and in my Android phone. This should narrow down whether the issue is in the LÖVE side or in the phone side.
hi just came across this thread, good stuff, although the most recent .love you uploaded gives me

Code: Select all

Error

Cannot link shader program object:
ERROR: Error: Linking ES shaders with non-ES shaders is not supported.

Traceback

[C]: in function 'newShader'
main.lua:46: in function 'newRawShader'
main.lua:69: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
I was also wondering, how hard would it be to change the pitch and roll in addition to the yaw of the camera? would that just be a whole different level of complexity?
Last edited by tlcarus on Mon May 14, 2018 8:45 am, edited 1 time in total.

User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Mon May 14, 2018 8:43 am

Thanks for the heads-up. The last one was just a test for 4aiman to check if it works in their mobile phone, to try to narrow down their problem, but it's good to know there's a hardware in which it doesn't work. What are your specs? Mobile, desktop? Which OS/graphics card?

Please refer to rctest2 rctest3 for the latest working example.

User avatar
4aiman
Party member
Posts: 236
Joined: Sat Jan 16, 2016 10:30 am

Re: Why faking 3D nowadays?

Post by 4aiman » Thu May 17, 2018 6:05 pm

Sorry for the delay. Haven't been able to test this stuff earlier.
I dont' know how to name the issue let alone properly report it.

Anyhow, I've got the latest 11.1 apk and ran the demo3d4.love file.

Code: Select all

Cannot link shader program object:
Error: shader version mismatch

Traceback

[C]: in function 'newShader'
main.lua:46: in function 'newRawShader'
main.lua:69: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
I also ran some older demos agains the latest apk and...

User avatar
pgimeno
Party member
Posts: 1065
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why faking 3D nowadays?

Post by pgimeno » Thu May 17, 2018 6:37 pm

4aiman wrote:
Thu May 17, 2018 6:05 pm
Sorry for the delay. Haven't been able to test this stuff earlier.
I dont' know how to name the issue let alone properly report it.
No worries. Thanks for the video.

That looks to me like the projected floor is just off the screen. According to the video, only 8x6 tiles are visible, and this is what happens when I trim it to 8x6 tiles:
Flip.gif
Flip.gif (150.89 KiB) Viewed 96 times
I didn't put any effort in adjusting it for any screen size, so that's unfortunate but not unexpected.

What about rctest3.love in this post? download/file.php?id=16313 Does it work?

From your words in past posts, my impression was that you got errors compiling *any* shader of any kind; however, that one has obviously compiled without problems, and it is even very likely that it's working fine and you were just out of luck with the screen size.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests