getDepthTest.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. return {
  2. tag = 'graphicsState',
  3. summary = 'Get the depth test mode.',
  4. description = 'Returns the current depth test settings.',
  5. arguments = {},
  6. returns = {
  7. {
  8. name = 'compareMode',
  9. type = 'CompareMode',
  10. description = 'The current comparison method for depth testing.'
  11. },
  12. {
  13. name = 'write',
  14. type = 'boolean',
  15. description = 'Whether pixels will have their z value updated when rendered to.'
  16. }
  17. },
  18. notes = [[
  19. The depth test is an advanced technique to control how 3D objects overlap each other when they
  20. are rendered. It works as follows:
  21. - Each pixel keeps track of its z value as well as its color.
  22. - If `write` is enabled when something is drawn, then any pixels that are drawn will have their
  23. z values updated.
  24. - Additionally, anything drawn will first compare the existing z value of a pixel with the new z
  25. value. The `compareMode` setting determines how this comparison is performed. If the
  26. comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't
  27. be rendered to.
  28. Smaller z values are closer to the camera.
  29. The default compare mode is `lequal`, which usually gives good results for normal 3D rendering.
  30. ]]
  31. }