View Issue Details

IDProjectCategoryView StatusLast Update
0006214The Dark ModGraphicspublic07.01.2023 11:30
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilitysometimes
Status assignedResolutionopen 
Product VersionTDM 2.11 
Target VersionTDM 2.12 
Summary0006214: Cleaning the scissors mess
DescriptionThis started as a bug for low renderscale.

When we convert renderscale from vidsize (where it is computed) to actual FBO size, we round in non-conservative way.
As the result, we can get some thin gaps between neighboring surfaces in a perfectly solid geometry.
This usually happens in axis-aligned brush geometry where visportal splits the geometry into different surfaces.

However, I think it's time to refactor the whole scissor thing to make it better:
1) Try to make idScreenRect non-inclusive on right side, aka [L..R) --- not sure that would be easy, but such representation is much better.
2) When idScreenRect is computed, it is rounded down then expanded by 1 pixels in all directions. Instead of expanding, just round properly (maybe with tolerance, but no need to expand on lower side).
3) Make a single function to convert from vidsize rectangle to currentFBO rectangle, instead of two functions GL_ScissorVidSize, GL_ViewportVidSize and third function CalcScissorParam in DepthStage. Make sure it is conservative.
4) Do the same for "Relative" case, and make sure it is conservative too.
5) Make sure r_glScissor is respected everywhere, put moving it into scissor wrappers and getting rid of direct scissor API calls.
6) Wrap scissor state into some kind of auto-restore helper to avoid state leaks (this includes both on/off and the rectangle itself).
Steps To ReproduceIt also happens on "Down and Out on Newford Road".
Execute: setviewpos -118.38 -169.18 200.25 6.5 33.5 0.0
Make sure to set RenderScale like 0.14.
TagsNo tags attached.

Activities

stgatilov

stgatilov

03.01.2023 13:08

administrator   ~0015685

Last edited: 03.01.2023 13:09

The original bug happened on Frost_Salamander's WIP map (codename FSX).
I have attached screenshots showing 1-pixel holes at the window edges.
The window contains a visportal, matching the edges exactly where the holes are.
The holes are bright-blue, because that's the color of skybox.

This issue was fixed only when I fixed rounding in CalcScissorParam in DepthStage (yeah, this shader-implemented scissor was quite hard to find).

The fix is in svn rev 10231.
Daft Mugi

Daft Mugi

07.01.2023 02:56

developer   ~0015718

r10231 made the compass disappear, at least for me.
stgatilov

stgatilov

07.01.2023 11:30

administrator   ~0015721

Fixed in svn rev 10236.

Issue History

Date Modified Username Field Change
03.01.2023 13:00 stgatilov New Issue
03.01.2023 13:00 stgatilov Status new => assigned
03.01.2023 13:00 stgatilov Assigned To => stgatilov
03.01.2023 13:08 stgatilov Note Added: 0015685
03.01.2023 13:08 stgatilov File Added: test_fsx (2023-01-03 14-06-07) (2144.25 3408.25 116.25).jpg
03.01.2023 13:08 stgatilov File Added: test_fsx (2023-01-03 14-05-32) (2144 3440 116.25).jpg
03.01.2023 13:08 stgatilov File Added: test_fsx (2023-01-03 14-05-44) (2153.58 3439.7 116.25).jpg
03.01.2023 13:09 stgatilov Note Edited: 0015685
03.01.2023 13:11 stgatilov Steps to Reproduce Updated
07.01.2023 02:56 Daft Mugi Note Added: 0015718
07.01.2023 11:30 stgatilov Note Added: 0015721