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

Add helper for getting shader pass type #4424

Merged
merged 6 commits into from
Jul 12, 2022
Merged

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented Jul 12, 2022

This PR adds a helper function for categorising shader passes into pass types and uses them when building shaders.

This fixes invalid shaders in editor when rendering custom passes (specifically pass 24 used for outline rendering).

This following function is added:

ShaderPass.getType(shaderPass)

Which returns one of the following new constants:

const SHADERTYPE_FORWARD = 'forward';
const SHADERTYPE_DEPTH = 'depth';
const SHADERTYPE_PICK = 'pick';
const SHADERTYPE_SHADOW = 'shadow';

@slimbuck slimbuck added bug enhancement area: graphics Graphics related issue labels Jul 12, 2022
@slimbuck slimbuck requested a review from a team July 12, 2022 11:41
@slimbuck slimbuck self-assigned this Jul 12, 2022
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

approving, few comments need fixing.

@slimbuck slimbuck changed the title Add pass type helper Add helper for getting shader pass type Jul 12, 2022
@slimbuck slimbuck merged commit d551995 into playcanvas:main Jul 12, 2022
@slimbuck slimbuck deleted the pass-type branch July 12, 2022 13:05
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.

2 participants