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

Updates to shader hooks for 2.0 #7432

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Updates to shader hooks for 2.0 #7432

merged 5 commits into from
Dec 18, 2024

Conversation

davepagurek
Copy link
Contributor

@davepagurek davepagurek commented Dec 18, 2024

Problems this aims to address:

  • Currently, you have to multiply all color channels by the alpha channel in your shader. That's super easy to forget and confusing when it happens!
  • Currently in fragment shaders, in one hook, you can adjust color based on the normal, the normal based on the color, or whatever you want, because you can modify all the inputs at once in a hook. The vertex shaders, meanwhile, force you to update position before normal before color, which means that you can't update the position based on the normal if you wanted

Changes

  • Rearranges where premultiplied alpha happens in the shader so that shader writers don't have to worry about premultiplying any alpha
  • Update vertex shader hooks to use an input struct like fragment shader hooks so that users can change any input based on any other input
    • Put input into structs
    • Pass in normal matrix in model + camera parts so you can choose which space to work in

Screenshots of the change:

N/A

PR Checklist

@davepagurek davepagurek marked this pull request as ready for review December 18, 2024 17:05
@davepagurek davepagurek merged commit 8d68d48 into dev-2.0 Dec 18, 2024
2 checks passed
@davepagurek davepagurek deleted the hooks-updates branch December 18, 2024 17:06
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.

1 participant