casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
49 stars 9 forks source link

Add `formDepthTest` and `formDepthWrite` tags to modify how bot forms interact with the depth buffer. #290

Closed Blitzy closed 1 year ago

Blitzy commented 1 year ago

Add new form modifer tags formDepthTest and formDepthWrite. These tags would modify the depthTest and depthWrite flags on all material's for a given bot's mesh-based form (cube, sphere, mesh, etc...)

Motivation

There are a number of use cases where having a bot drawn over the top of all other bots no matter where it is at in the scene is preferable. Areas where this type of control would be beneficial: Custom tools, UI elements, debugging, special effects, etc.

Other considerations

Should the input system be modified to account for depth? If botB is behind botA but botB has its depthTest tag disabled and is being drawn on top of botA, should our input system understand this and give botB the pointer events instead of botA?

References

https://threejs.org/docs/index.html?q=material#api/en/materials/Material.depthWrite https://threejs.org/docs/index.html?q=material#api/en/materials/Material.depthTest

KallynGowdy commented 1 year ago

This is implemented in v3.2.4.