Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
141 stars 2 forks source link

Add Separate Stencil Fail and Depth Fail Options #2716

Open lxw404 opened 3 months ago

lxw404 commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently in stencil based materials, there is only the option to specify what happens to the stencil buffer when both the stencil test and depth test pass, however there is no way to specify what happens in the other 2 cases:

Describe the solution you'd like

There should be two additional options for choosing what happens on these fail cases.

Describe alternatives you've considered

There are majorly difficult workarounds which require multiple stencil increments + separate depth tests to determine which combination of failure conditions occurred, but they are all super tedious to implement.

Additional Context

This came up while implementing a special effect which tries to detect when a mesh is within the mask of another mesh, but simultaneously is failing the depth test, allowing for more comprehensive and advanced cutout rendering through objects. In general this is super useful for area exclusion based effects.

This is tangential to, but related to: https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2040.

Requesters

LuxKitty

shiftyscales commented 3 months ago

Seeking input from @Geenz.