Free IVA

Free IVA

106k Downloads

Internal spaces in distant parts are visible when looking out a window

JonnyOThan opened this issue ยท 0 comments

commented

This occurs because all parts are drawn with the local space camera before all the internal spaces are drawn with the internal camera. This means that the internal spaces are drawn on top of the parts, and they can't share any depth info.

image

This is actually important when looking through a hatch between parts, so that you don't see the outer shell of the other part. But when you look out of a window, you can "see through" the parts to the internals inside, because they were drawn on top.

Possible solutions:

  • Draw the internal spaces and parts with the same camera. Might be tricky because the depth range for the local space is not suitable for internals
  • Find a way to transfer the depth buffer from the local camera to the internal one
  • Build depth mask shells around all the parts, excluding their hatches and use that to block drawing the internals from outside
  • Use the stock or provided depth masks, but use hatch cutouts on them
  • Draw the internals before the parts, and somehow prevent the parts from obscuring internals through hatches

Current Plan:

  • Generate the convex hull of the existing external depth mask mesh
  • Cut out holes in the hull for hatch props
  • Switch between the internal and external depth masks based on camera mode
  • Ensure there's a way to manually specify the internal depth mask
  • Automatically find the external depth mask based on shader assignments
  • Depth masks don't seem to have the correct initial configuration (fixed after unbuckling)