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

[Examples] Fix colors in lighting shaders #4482

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

JeffM2501
Copy link
Contributor

There is a small regression with the lighting example/shader from previous versions with the new 5.5 example,
5.0 used meshes since the batch did not support normals. This meant that the tint was passed to the shader as the 'colDiffuse' uniform.
uses shapes, since the batch system does now support normals. Shapes do't set colDiffuse from the tint, they apply the tint as vertex colors.

The example lighting fragment shader does not use the fragColor, only colDiffuse, so this means that the tint is now ignored where it was not before.

This PR fixes the example lighting shaders to use both frag and diffuse colors so they work with shapes and meshes.

@raysan5 raysan5 merged commit 10fd4de into raysan5:master Nov 11, 2024
13 checks passed
@raysan5
Copy link
Owner

raysan5 commented Nov 11, 2024

@JeffM2501 Nice! Thanks for the review!

psxdev pushed a commit to raylib4Consoles/raylib that referenced this pull request Nov 18, 2024
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.

2 participants