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

Shader texture bias and ao fixes #4150

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Conversation

slimbuck
Copy link
Member

This PR makes the following changes to the standard material:

  • declare global textureBias uniform in non-main pass (this was causing shader compile errors in shadows etc)
  • split ambient occlusion into 'get' and 'apply' to match most other components. This change is made with a view to splitting out material front and back end.

Chunk changes:

  • ao.frag.js:
    • rename function from applyAo to getAo
    • function only calculates and sets the global dAo, doesn't also apply the resulting value to diffuse
  • added aoDiffuseOcc.frag.js
    • applies the calculated global dAo to the diffuse component

@slimbuck slimbuck added bug area: graphics Graphics related issue labels Mar 23, 2022
@slimbuck slimbuck requested a review from a team March 23, 2022 11:15
@slimbuck slimbuck self-assigned this Mar 23, 2022
@slimbuck slimbuck merged commit 976ee6d into playcanvas:main Mar 23, 2022
@slimbuck slimbuck deleted the texture-bias-fix branch March 23, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants