Skip to content

Opengl Quick Fixes

Sryder requested to merge Sryder/SRB2:openglquickfixes into master

Various quick fixes so OpenGL isn't quite so bad.

  • Some basic fixes for sorting between MD2s and sprites so they aren't quite so bad at times
  • Make walls/floors that have holes in, but aren't translucent, be drawn as solids, so they don't need to be sorted manually and use the depth buffer
  • Make texture filtering not do anything on textures or flats with holes in them (they use nearest) because the added translucency can break things. If correct sorting is implemented they could use it again but would need to be sorted manually
  • Decrease the far clipping plane from it's actually absurd value to a more reasonable 32768, which is probably as far as software can see anyway. Hopefully will help with depth buffer precision
  • Optimises the screen texture setups so that they aren't redefining textures every frame if they don't need to. This gives a pretty large performance increase, especially on Intel GPUs
  • Fix screenshots and fade wipes in SDL2 for resolutions that are lower than the monitor's native resolution
  • Slightly better Fog Block colouring. Still not particularly accurate, but better
  • Stop translucent floors/ceilings from being drawn into the depth buffer
  • Match the currently used OpenGL drawing functions to the software ones. There are a few others that don't fully match still, but they also aren't currently used from what I can see, so I have no point of reference for how they should work.
  • Make the screen texture be drawn in the centre of the screen with black bars in SDL2, instead of being stretched across the entire screen
  • Update and fix a bit HWR_SplitWall so it actually works with water properly where it wasn't before.
  • Sprite Splitting with a sector's light list in OpenGL (Needed to make sprites be transformed in world space rather than screen space so this worked easier, stransform has been removed since it ended up unused)
  • The geometry being rendered was being squashed because it was always assuming that a standard resolution was being used, this has been fixed
  • Comment out the call to HWR_CorrectSWTricks. I don't think it was being used, or if it was needed it wasn't being done properly probably. If it's not needed at all, all the parts around it can probably be removed
  • A really silly fix I still don't understand, but it fixes the lighting issue in DSZ3

Merge request reports