Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Three.js outlinePass add-on not working when implemented with R3F #3305

Closed
MiguelG97 opened this issue Jul 12, 2024 · 0 comments
Closed

Three.js outlinePass add-on not working when implemented with R3F #3305

MiguelG97 opened this issue Jul 12, 2024 · 0 comments

Comments

@MiguelG97
Copy link

I'm having a hard time using the R3F -postprocessing library so I decided to use raw threejs classes:
By diving into the R3F extending third party library tutorials I managed to setup the renderPass and the outlinePass with typescript https://docs.pmnd.rs/react-three-fiber/tutorials/typescript

The code is in the following sandbox:
https://codesandbox.io/p/sandbox/r3f-outlinepass-vdvhm8

Now I wish to add a mesh to the scene and trigger the outlinePass effect on it.
I tried pushing the mesh to the selectedObjects but the Outline is not working:

    const outlinePass = ViewerModel.effectComposer!
      .passes[1] as unknown as OutlinePass;
    outlinePass.selectedObjects = [];
    outlinePass.selectedObjects.push(mesh);
@pmndrs pmndrs locked and limited conversation to collaborators Aug 10, 2024
@CodyJasonBennett CodyJasonBennett converted this issue into discussion #3327 Aug 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant