Add support for depth function in spatial materials and/or shaders (GL_GREATER
, …) #1298
Description
Describe the project you are working on:
A 3D 3rd person game.
Describe the problem or limitation you are having in your project:
There is no way to change the depth test function for shaders or materials. It's is not possible to change the glDepthFunc() from the default GL_LEQUAL to GL_GREATER
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
A lot of effects needs to change depth function. E.g. when Super Mario is behind an object you will see him rendered as a gray silhouette. This can easily be achieved with rendering the object in two passes, where the silhouette pass is rendered with GL_GREATER.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
- A drop down selection, right next the "no depth test" flag in the material settings.
- A "depth_mode" setting in the shader, similar to the "render_mode" setting.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It can only be implemented in the core renderer.
Is there a reason why this should be core and not an add-on in the asset library?:
It can only be implemented in the core renderer.
Activity