ros3djs icon indicating copy to clipboard operation
ros3djs copied to clipboard

autoclear and highlights implementation makes custom objects invisible in certain cases

Open trusktr opened this issue 4 years ago • 0 comments

This line,

https://github.com/RobotWebTools/ros3djs/blob/530f7ec63778c83eaba4382395ee68b2dbc15808/src/visualization/Viewer.js#L58

paired with this line,

https://github.com/RobotWebTools/ros3djs/blob/530f7ec63778c83eaba4382395ee68b2dbc15808/src/visualization/Viewer.js#L135

and this line,

https://github.com/RobotWebTools/ros3djs/blob/530f7ec63778c83eaba4382395ee68b2dbc15808/src/visualization/Viewer.js#L137

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:

  • https://threejs.org/examples/?q=select#webgl_postprocessing_unreal_bloom_selective
  • https://threejs.org/examples/?q=postpro#webgl_postprocessing_outline

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 avatar Oct 05 '21 01:10 trusktr