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

OutlinePass - Support InstancedMeshes #24440

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

TobyGilbert
Copy link
Contributor

@TobyGilbert TobyGilbert commented Aug 3, 2022

Description

The current mask material used in the outline pass does not support instanced meshes as it currently does not consider the instanced matrix, when computing its projected texture coordinates, for use when sampling the depth buffer. This small change utilises the worldpos_vertex chunk in order to do this.

@mrdoob mrdoob added this to the r144 milestone Aug 5, 2022
@mrdoob mrdoob merged commit 0b367a2 into mrdoob:dev Aug 5, 2022
@mrdoob
Copy link
Owner

mrdoob commented Aug 5, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
@walton007
Copy link
Contributor

I've encountered a bug in r144 after apply this patch, please see below image.
image

After investigation, I found that the issue is introduced by this patch fix.
image

@TobyGilbert Could you give any suggestion on how to fix it?

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 22, 2022

I don't see any issues with webgl_postprocessing_outline. How can the example be modified so the above shader compilation error occurs?

@WestLangley
Copy link
Collaborator

How can the example be modified so the above shader compilation error occurs?

renderer.shadowMap.enabled = false;

@TobyGilbert
Copy link
Contributor Author

Ok yes seems USE_SHADOWMAP is not defined otherwise and worldPosition is not set.

We could just move the instancing logic into the outline pass shader and not rely on the worldpos_vertex shader include.

@TobyGilbert
Copy link
Contributor Author

I've opened a PR to address this here #24681

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.

5 participants