Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop z-fighting by pushing world/view/projection multiplications onto the GPU #807

Merged
merged 1 commit into from Mar 11, 2023

Conversation

twpol
Copy link
Member

@twpol twpol commented Mar 2, 2023

Bug report: http://www.elvastower.com/forums/index.php?/topic/36606-z-fighting-issue/

This undoes some code we added ages ago to pre-multiply some of the shader matrices, I believe to reduce the amount of data being sent but turns out makes for some extra instability in the floating-point errors – and thus z-fighting is more likely.

Really, though, we should be removing the need for modellers to put objects mere millimetres apart, because this is simply not something real-time graphics pipelines are good at.

@twpol twpol self-assigned this Mar 2, 2023
twpol pushed a commit that referenced this pull request Mar 2, 2023
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
@pzgulyas
Copy link
Contributor

pzgulyas commented Mar 3, 2023

LGTM

twpol pushed a commit that referenced this pull request Mar 6, 2023
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
- Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012
@pzgulyas
Copy link
Contributor

pzgulyas commented Mar 9, 2023

Could this possibly be merged, so that I could proceed with merging this with #570 ?

twpol pushed a commit that referenced this pull request Mar 9, 2023
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
- Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012
- Pull request #810 at e2ad93e: Bug fix for AI train WP restart events don't work after save
twpol pushed a commit that referenced this pull request Mar 9, 2023
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
- Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012
- Pull request #810 at e2ad93e: Bug fix for AI train WP restart events don't work after save
- Pull request #811 at f784151: Bug fix for https://bugs.launchpad.net/or/+bug/2009842 DPU: wrong BP and MR values of helpers in display
twpol pushed a commit that referenced this pull request Mar 10, 2023
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
- Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012
- Pull request #812 at d07f812: Bug fix for https://bugs.launchpad.net/or/+bug/2009955 Missing code to rotate DMU display in 2D cabs
@cjakeman cjakeman marked this pull request as ready for review March 11, 2023 08:50
@cjakeman cjakeman marked this pull request as draft March 11, 2023 08:51
@twpol twpol marked this pull request as ready for review March 11, 2023 11:29
@twpol
Copy link
Member Author

twpol commented Mar 11, 2023

Could this possibly be merged, so that I could proceed with merging this with #570 ?

Yes, sorry, I was planning to wait a week to check nothing had been broken but forgot about it. Please feel free to approve and merge this PR so you can put #570 back into unstable.

Copy link
Contributor

@cjakeman cjakeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi James,

Looks good and so is feedback.

Approved with thanks,

Chris

@cjakeman cjakeman merged commit 3831af9 into openrails:master Mar 11, 2023
@twpol twpol deleted the bugfix/64bit-z-fighting branch April 7, 2023 11:16
@twpol twpol added the bug Something isn't working label Jul 1, 2023
@twpol twpol changed the title fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU Stop z-fighting by pushing world/view/projection multiplications onto the GPU Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants