![]() |
|
Emitter's drawing priority - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Feedback (https://teamscm.co.uk/forum-9.html) +--- Forum: Suggestions and improvements (https://teamscm.co.uk/forum-11.html) +--- Thread: Emitter's drawing priority (/thread-3201.html) |
Emitter's drawing priority - The17thDoctor - 04-04-2020 I noticed using starfall emitters that if 2 2D3D cameras were created, the one that is last in the rendering hook is drawing over the original one, is there a possibility to add something in order to avoid this issue ? RE: Emitter's drawing priority - Person8880 - 05-04-2020 This happens because 3D2D rendering disables writing to the depth buffer (though still tests against it). I've added a new function, render.overrideDepthEnable() which will allow you to force depth writing to be enabled. Use this before starting a 3D2D camera with opaque drawing operations to have it properly respect depth. For example (taken from the docs):
Note that for translucent elements, this won't help. Translucent elements have to be drawn in the right order as it doesn't make sense for them to write to the depth buffer (and if you try it you'll get very strange results). RE: Emitter's drawing priority - The17thDoctor - 05-04-2020 Thank you, that will really help for what I wanted to do ![]() After trying the function, my starfall returned me : SF:.txt:11: attempt to call field 'overrideDepthEnable' (a nil value) If you have any idea on why it does that, here is my code by the way :
RE: Emitter's drawing priority - mariofludd - 05-04-2020 (05-04-2020, 03:13 PM)The17thDoctor Wrote: Thank you, that will really help for what I wanted to do maybe its the 2 true values? (yes the docs have 2, try 1, see if it works) RE: Emitter's drawing priority - Person8880 - 05-04-2020 The server needs to restart for the function to be available. I've restarted server 2 which was empty so it should be available there. RE: Emitter's drawing priority - The17thDoctor - 05-04-2020 Thank you |