Page 1 of 2

Z Depth problem

Posted: 09 Jul 2018, 14:35
by zebialowicz
Hello.

I have 2 layers on my scene and 2 objects (Cube and Sphere). My objects are on different layers. And my problem is, i cannot set Z-Depth properly, i mean, my layers overlap. I want effect like my Shere is behind my Cube, i tried with a lot of options, like ZSort, Z-Testing but its not working properly. Its working great only if my objects are on ONE and SAME layer. But i need my objects to be on different layers. I will attach image to show u what i talking about:
ventuz.PNG
Have u any idea what can i do with that ?

Best Regards

Re: Z Depth problem

Posted: 09 Jul 2018, 16:56
by chriss0212
Hi

put it into the same layer! The layer is overwriting Z! In most cases this is a very good behavior ;)

Greetings

Christian

Re: Z Depth problem

Posted: 10 Jul 2018, 07:50
by zebialowicz
Ouch... I thought we have another solution...

In my case the problem is bigger because i have big model with a lot of elements which are separate objects, and in this case my ,,objects tree,, on the layer is complicated and impractical. But thanks, if it is only way to do that -> i will do it like u say :)

Best Regards
Szymon

Re: Z Depth problem

Posted: 10 Jul 2018, 09:11
by Dennis
you can use Groups or "Merge" all the 3D Elements and Axis into one container.. (Ctrl+M)

so you get a cleaner hierarchy...

regArts
k0s

ps: believe me i have seen a way more worse complicated and impractical tree than yours ;) 10000% :P

:ugeek:

Re: Z Depth problem

Posted: 10 Jul 2018, 09:12
by lerou
yes, unfortunately there is no way to share the depth buffer - and also not the stencil buffer. I don't agree with the word "most" in Chris' answer, but sometimes it is indeed handy to have separate buffers. Often it's not.

Try to encapsulate your complex stuff in a container. The difference to a layer is not that big.

Re: Z Depth problem

Posted: 10 Jul 2018, 09:23
by chriss0212
I don't agree with the word "most" in Chris' answer, but sometimes it is indeed handy to have separate buffers
;)

Maybe it would be great to have a bool for killing Z in a layer... Or: a normal 3D Layer always keeps Z and just a group will kill Z ;)

Greetings

Christian

Re: Z Depth problem

Posted: 10 Jul 2018, 09:29
by lerou
Well, as long as I'm not forced to separate my stuff into two layers, I don't. But it would be so much cleaner - for instance when building some UI with stencil: one layer to set up all stencil functions and then use it in the 3D layer. Especially if your stencil stuff is 2D and then you want to apply it to 3D content (which this time really is MOST of the time). Also Touch does not seperate between layers. So even if some objects on your second layer are visible, they might still be occluded by other objects in terms of touch.

Re: Z Depth problem

Posted: 11 Jul 2018, 09:13
by zebialowicz
Okay thank You everyone for help :)
Now i put all my elements on one layer, its working fine but only in 50% ^^ Because if i add any effect node (even without specific effect) on my 3D element, this element overwritting Z depth... I cannot attach image file because of NDA, but its something like:
1. I have Cube and Sphere on scene
2. Sphere is BEHIND of Cube
3. If i add any (even blank) effect on ma SPHERE, she is goint to be IN FRONT
4. If i set effect as Inactive, again my Sphere is behind the Cube.

Its soo annoying, because i spent 3 days only on work around it, how to set Z Properly. I thought its like, i added 50 elements on scene in proper hierarchy and now i can easy add some effects on elements and all will work fine, but i dont know why elements with effects are in front of rest elements (without effects)...

Re: Z Depth problem

Posted: 11 Jul 2018, 09:42
by zebialowicz
Okay i did it somehow, maybe its not best solution but is working right now ;)

Re: Z Depth problem

Posted: 11 Jul 2018, 16:21
by lerou
The FX node is an implicit render target and will therefore eliminate the depth info.