Bug/Mistake using blender camera and Picture

@pspeed said: It occurs to me that with everything in the opaque bucket... your comparator might be backwards. The opaque bucket draws front to back so you may want to reverse how order is defined if you want the background to be behind.

I think currently as it’s defined, the background always gets drawn first.

I tried to invert values in comparator… same problem and player not rendered… I tried even (just to see if I have problem on my blender scene) to erase many of complex meshes inside my scene, I kept only walls and floors… but same problem.
For example for the camera that makes me problem in some positions I saw that this even depends by camera sensor size…, for example in a determiante position, with sensor size of 32 millimeters is not working (no background is loaded), and with a sensor size of 74mm background is loaded successfully… I don’t know what to try again…
There’s no another way to force background drawing behind scene (and transparent scene) or put background between player and scene?

@Ray1184 said: I tried to invert values in comparator... same problem and player not rendered... I tried even (just to see if I have problem on my blender scene) to erase many of complex meshes inside my scene, I kept only walls and floors... but same problem. For example for the camera that makes me problem in some positions I saw that this even depends by camera sensor size.., for example in a determiante position, with sensor size of 32 millimeters is not working (no background is loaded), and with a sensor size of 74mm background is loaded successfully... I don't know what to try again... There's no another way to force background drawing behind scene (and transparent scene) or put background between player and scene?

If the comparator is working right then the background will be drawn first (return 1000000000000) and the player will be drawn last (return -10000000000) or whatever.

I’m not sure what else to way. Maybe it isn’t an ordering issue? Hard to say without putting breakpoints in the renderer.

@pspeed said: If the comparator is working right then the background will be drawn first (return 1000000000000) and the player will be drawn last (return -10000000000) or whatever.

I’m not sure what else to way. Maybe it isn’t an ordering issue? Hard to say without putting breakpoints in the renderer.

Mhh… I think I tried everything… in this way I don’t know what to do… I could keep all in this way (and put cameras only in working position) but I don’t like it… I also try to run my app in a older computer… and performances are a disaster, even with a light scene… I don’t want to to imagine what would happen with a complete release :frowning:

So… my idea is now to change totally approach… infact I read some documentaton about the “standard way” to implement pre-rendered 2D + 3D

Infact this style is thought for having a nice visual effect with the minimum use of resources… and it’s not happening in my case :smiley:

Apparently the way to calculate all 3D scene (with only depth) and draw behind the background is wrong, but the right way should be to:

1. Calculate a very very very simple 3D scene, with only the bounding box for collisions (no colors and even no depth write) 2. Render the scene and SEPARATE rendering layers for differents Z values (for example wall, a table_1 (just in front of wall) and another table_2 (in front of the other table)) 3. Assign for each layer a Z values (for example table_2 with Z-10, table_1 with Z-30 and wall with Z-50... just for understand)

Now difficult is “only”:

How to render the 3D player in front of table_2 when player Z < 10 and behind them when is greater? same stuff for others objects…

For depth (in this sense) I could simply use the distance between player and camera, and in some range render player before or after the image… now I need only to say how to do it efficiently

Hope that is possibile… probably with this system the development will be a bit longer… but sure performances will gain a lot

I don’t know. I have a hard time debugging your app from here. A background quad with no depth, a scene with only depth, and a player seemed like a really simple setup.

Good luck with the more complicated approach, though.

Yes I know that is a bit more complicated in this way… but If I have very complex object in my scene is difficult to render them in realtime 3D, infact performance are already decreasing.

Anyhow, really thank you for your time, support here is indispensable.

For new approach… if is possible to order quads and players… probably I can compare in the comparator using the current distance between player and layer (for each layer I can use a “virtual” distance), and order in rendering queue in this way… do you think It could works?