rickomax / psxprev

PSXPREV - Playstation (PSX) Files Previewer/Extractor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support single-sided polygons

trigger-segfault opened this issue · comments

Many model formats provide driver information stating whether a model uses single-sided or double-sided polygons. By default, double-sided polygons are rendered by PSXPrev, but this isn't always correct, especially in cases where a flat polygon has different textures that draw on both sides.

Steps to implement:

  • The single sided setting needs to be stored for individual models. Certain models may need to be split up if they share different settings.
  • CullFace needs to be enabled, and Front or FrontAndBack needs to be enabled whether the model is single-sided or double-sided respectively.
  • An option to force drawing double-sided should be added. Because it's often convenient to look at a model from angles the game didn't intend it to be seen at.

Preview:
Figure A. A surface with separate faces on each side, but the texture on the back-side of one polygon replaces the texture that should draw on the front.
image

Figure B. What the front surface should look like with single-sided polygons.
image

This has been implemented by PR #77.