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

Fix #3320: Incorrect colors for 3D draws #3321

Merged
merged 9 commits into from
Apr 5, 2024

Conversation

Nico8340
Copy link
Contributor

@Nico8340 Nico8340 commented Feb 21, 2024

Fixes #3320 (an old bug caused by an incomplete, unfinished piece of code)

@tederis
Copy link
Collaborator

tederis commented Feb 22, 2024

Although I assume it works, the origin of these coefficients isn't clear for me. Can you elaborate on how they were found?

@Nico8340
Copy link
Contributor Author

Nico8340 commented Feb 22, 2024

Although I assume it works, the origin of these coefficients isn't clear for me. Can you elaborate on how they were found?

The bug only appears for 3D lines, not for 3D material lines, because the code was already there. The solution comes from the code of 3D material lines.
@tederis

@tederis
Copy link
Collaborator

tederis commented Feb 22, 2024

Although I assume it works, the origin of these coefficients isn't clear for me. Can you elaborate on how they were found?

The bug only appears for 3D lines, not for 3D material lines, because the code was already there. The solution comes from the code of 3D material lines. @tederis

I see now, you just copied the behaviour from CMaterialLine3DBatcher. But I still cannot understand how exactly it fixes the problem. Why should it be divided by two? This is not directed at you, I just want to comprehend.

@Nico8340
Copy link
Contributor Author

I see now, you just copied the behaviour from CMaterialLine3DBatcher. But I still cannot understand how exactly it fixes the problem. Why should it be divided by two? This is not directed at you, I just want to comprehend.

This is a very good question, because if we draw as a postGUI, then this is not necessary. This is probably caused by a bug / behavior of DirectX.
@tederis

@tederis
Copy link
Collaborator

tederis commented Feb 23, 2024

After a little research I have found that the problem is indeed comes from the color correction pass (as I pointed out in #3320). This pass isn't fixed and it changes the colors every frame. So you can see that the division by 2 doesn't fix that, but only masks the problem. Moreovere, there is no constant that can fix it.
Colors

That means that 3D material lines still experience the problem. I think that the division should be removed from CMaterialLine3DBatcher as it makes colors inconsistent with other dx functuin and makes it difficult to correct colors using getColorFilter function. Unfortunately this PR also doesn't fix the issue.

@tederis tederis mentioned this pull request Feb 23, 2024
1 task
@Nico8340
Copy link
Contributor Author

Nico8340 commented Feb 25, 2024

I removed the division from both batchers.

@Dutchman101 Dutchman101 merged commit 1f2c6e7 into multitheftauto:master Apr 5, 2024
6 checks passed
MTABot pushed a commit that referenced this pull request Apr 5, 2024
1f2c6e7 Fix #3320: Incorrect colors for 3D draws (#3321)
2e43c10 Update client en_US pot
@Nico8340 Nico8340 deleted the line branch April 5, 2024 14:53
@Einheit-101
Copy link

Finally no more getColorFilter to fix the dx rendering? Nice.

@Nico8340
Copy link
Contributor Author

Nico8340 commented Apr 9, 2024

Finally no more getColorFilter to fix the dx rendering? Nice.

This patch only removes divide by two from the line batcher, so it doesn't provide a real solution to the problem, it can be used uniformly and correctly with getColorFilter, but a future patch may include a real solution to the problem.

@TheNormalnij TheNormalnij added this to the 1.6.1 milestone May 25, 2024
@TheNormalnij TheNormalnij added the bugfix Solution to a bug of any kind label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Solution to a bug of any kind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect colors for 3D draws
5 participants