Skip to content

Add support for depth function in spatial materials and/or shaders (GL_GREATER, …) #1298

Open
godotengine/godot
#73527
@huhund

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:

  1. A drop down selection, right next the "no depth test" flag in the material settings.
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions