• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Is there limits of object's depth?

kingyo

Member
When objects depth is less than -15998, it becomes invisible. Why is this?
I read the user manual and learned that the layers depth is restricted from -16000 to 16000.
Is there the limit on the depth of the object too?
 

babyjeans

Member
I believe the 'depth' concept is the same between objects and layers. The object is at the layers depth when it is on a layer... so it's all one and the same. I'm not 100% sure though.
 

kingyo

Member
I believe the 'depth' concept is the same between objects and layers. The object is at the layers depth when it is on a layer... so it's all one and the same. I'm not 100% sure though.
It may be. I am also thinking about that possibility.
But if so, it will be invisible even when depth is over 16000.
 

icuurd12b42

TMC Founder
GMC Elder
Hmm it's not in the depth help content. perhaps @Nocturne can help clarify this...

instances are created at a depth layer now... but you can change the depth of the instance according to this
depth
not sure if that changes the layer the instance is at or if that will make a sub sort on the instance layer the instance was created on
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
When you change the depth, the instance is assigned to a "managed layer" which is a layer that GMS2 creates on the fly and will create/destroy as required. This IS mentioned on the page about "depth" in the manual, iirc... So, yes, depth will still have the limit of -16000 to 16000. Note that you can use the GPU zbuffer functions to force drawing regardless of the depth of the layer I think.
 

kingyo

Member
Hmm it's not in the depth help content. perhaps @Nocturne can help clarify this...

instances are created at a depth layer now... but you can change the depth of the instance according to this
depth
not sure if that changes the layer the instance is at or if that will make a sub sort on the instance layer the instance was created on
Thank you for reply!
I tried the following things.
・There is Layer A (depth is 0).
・Instance (depth is 16000 or more over) in Layer A --- visible
・Instance (depth is 0) in Layer A --- visible
・Instance (depth is -15998) in Layer A --- visible
・Instance (depth is -15999 or more less) in Layer A --- invisible I want to know why this is not visible.
* Maybe my English is terrible. I am sorry.
 

kingyo

Member
When you change the depth, the instance is assigned to a "managed layer" which is a layer that GMS2 creates on the fly and will create/destroy as required. This IS mentioned on the page about "depth" in the manual, iirc... So, yes, depth will still have the limit of -16000 to 16000. Note that you can use the GPU zbuffer functions to force drawing regardless of the depth of the layer I think.
I see. I understand that restrictions also apply to objects created on layers. I will devise it within limits.
Thanks to everyone.
 

icuurd12b42

TMC Founder
GMC Elder
When you change the depth, the instance is assigned to a "managed layer" which is a layer that GMS2 creates on the fly and will create/destroy as required. This IS mentioned on the page about "depth" in the manual, iirc... So, yes, depth will still have the limit of -16000 to 16000. Note that you can use the GPU zbuffer functions to force drawing regardless of the depth of the layer I think.
You should probably put something similar to that
IMPORTANT! There is a minimum and maximum layer depth of -16000 to 16000. Anything placed on a layer outside that range will not be drawn although all events will still run as normal.
in the depth content
 

Mike

nobody important
GMC Elder
Actually.... not quite true. Technically it IS drawn, it's just culled by the graphics hardware. To say it's not drawn implies we manually cull it, we don't. If you do your own camera matrix you can extend this range to whatever you like. But beware, you may start to get odd behaviour at the extremes due to floating point issues.
 

kingyo

Member
I will use your explanation as reference.
I can not understand difficult things, so I will keep the restrictions.
Thank you everyone.
 
Top