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

autoclear and highlights implementation makes custom objects invisible in certain cases #449

Open
trusktr opened this issue Oct 5, 2021 · 0 comments

Comments

@trusktr
Copy link

trusktr commented Oct 5, 2021

This line,

this.renderer.autoClear = false;

paired with this line,

this.renderer.clear(true, true, true);

and this line,

this.highlighter.renderHighlights(this.scene, this.renderer, this.camera);

is making it difficult to stick custom objects into the Three.js scene. It makes them become invisible. I had to disable these three lines in a work project in order for Mesh (and similar) APIs to work properly.

suggestion:

I believe there is a better solution to this that doesn't cause a break in people's (three.js developer's) expectations. For example, we can implement highlights as a post-processing effect and otherwise not modify the WebGLRenderer with these lines that cause unexpected effects during conventional usage of Mesh (and similar) APIs.

Here are examples of how to do that:

Also, here is a much more robust and featureful postprocessing lib compared to what is built into Three.js: https://github.com/vanruesc/postprocessing


Sorry if I didn't explain the issue well, it's been a while, I just remember thinking of a better way to do it at the time.

@trusktr trusktr changed the title autoclear and highlights implementation makes it difficult to render custom objects. autoclear and highlights implementation makes custom objects invisible in certain cases Oct 5, 2021
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

No branches or pull requests

1 participant