BenedictWilkins / world-of-bugs

A set of 3D environments used to test automated QA algorithms.
GNU General Public License v3.0
7 stars 1 forks source link

Geometry intersection shader for labelling geometry clipping bugs #4

Open BenedictWilkins opened 2 years ago

BenedictWilkins commented 2 years ago

The approach to labelling the GeometryClipping bug is currently to use backside rendering. This only works if we are in a first-person setting, as it essentially relies on the camera clipping through the geometry with the player.

There is currently no means to label two objects that clip into each other.

Approach (1)

One simple(ish) approach would be to do this in the collision system and mask the game objects whose geometry intersects.

Approach (2)

A better approach would be to use a shader that renders the intersection of game objects as follows:

This turns out to be more difficult than one might think. Unfortunately, it is not possible with stencil buffers/depth testing See this question

I do not have the expertise to create a shader that can accomplish this, it's related to rendering constructive solid geometry (CSG)?

BenedictWilkins commented 2 years ago

For the moment approach (1) will be implemented with potential improvement to (2) at a later date.