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

Set vertex colour attr correctly with material system #1431

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

slipher
Copy link
Member

@slipher slipher commented Nov 10, 2024

Cherry-picked from #1406.

Before:
unvanquished-station15-vertexlight-tree

After:
unvanquished-station15-vertexlight-tree

I think this is still not complete actually, as there are also implicitly vertex lit surfaces that don't have CGEN_VERTEX set. Vertex lighting can be automatically selected when there is no lightmap. The computer console in Vega is an example. It uses an image loaded as shader.

@slipher
Copy link
Member Author

slipher commented Nov 10, 2024

The previous screenshots were with full-range overbright. Although this commit makes the material system match the standard renderer, the result is wrong (too dark).

With clamping enabled, the 'before' picture remains the same (too bright). But clamping + this commit looks just right:
unvanquished-station15-vertexlight-tree

Copy link
Member

@illwieckz illwieckz left a comment

Choose a reason for hiding this comment

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

LGTM.

The reason why it's too dark is because the overbright code is buggy, something that will be fixed with #1406. So actually getting it too dark is what is expected.

@slipher slipher marked this pull request as ready for review November 11, 2024 06:50
@slipher
Copy link
Member Author

slipher commented Nov 11, 2024

I figured out why implicitly vertex lit surfaces were unaffected. It's because the lightMapping shader forces the color attribute to always be enabled, but the generic shader doesn't. So only stages rendered with generic could suffer from the missing attribute. While implicit vertex lighting only happens for lightmapped stages.

Added a commit commenting out a part of the code that doesn't really work.

@illwieckz
Copy link
Member

What is “implicit vertex lighting”?

@slipher
Copy link
Member Author

slipher commented Nov 11, 2024

I mean when the shader does not have rgbgen vertex, but vertex lighting is selected because it's a lighting stage of a BSP surface that has no lightmap.

Copy link
Member

@illwieckz illwieckz left a comment

Choose a reason for hiding this comment

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

LGTM.

@slipher slipher merged commit 9ce4b22 into DaemonEngine:master Nov 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants