Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / feature request

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 14th Oct 2019 06:08
Setobjectdepth() Ive been trying to layer objects and sprites 6 or so layers deep and its absolute chaos trying to use the swap render update mixing sprites objects text and more sprites and objects in front. ive been unsuccessful after working at it for a week or so. Not sure at the complexity or application of a command that works that way but being able to set an objects depth in front of a sprite depth would be usefull.

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 14th Oct 2019 13:12 Edited at: 14th Oct 2019 13:14
Even using SetObjectGlobalDepth() you will only get 3 layers (2Dback,3D,2DFront)

Paul has mentioned that he will reinstate the ClearDepthBuffer() for the next release of studio which will make this sort of rendering process easier. The command is still in AppGamekit classic and Is useful for mixing multiple layers of 2d and 3d.

I doubt that setting individual 2D depths for each 3D object will be implemented as it would not fit into the depth ordering in 2D at all, and would make the rendering loop pretty horrific to manage. Sprites and 3d are currently completely separate rendering processes and just will not mix at present without some considerable additional work.

There is another option though that could be used in the meantime.... You can set object depth ranges (setObjectDepthRange()) and make multiple render() calls to layer up so that you have 6 layers. It will involve moving cameras and changing view offsets between the render calls but it would work.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 15th Oct 2019 07:30
janbo found a solution manual draw of everything to a renderimage then texturing a quad and drawing interactive front layer on top after. works wonderful. seems a bit faster as well.

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Oct 2019 09:05
Great ...loads of ways of doing it!

Not sure I want to have to manually draw everything but as long as it works.

Login to post a reply

Server time is: 2024-04-19 07:53:37
Your offset time is: 2024-04-19 07:53:37