chore(Convolution2DPass): fix incorrect initial render in example - #3608
chore(Convolution2DPass): fix incorrect initial render in example#3608Jo-Byr wants to merge 1 commit into
Conversation
|
Drive-by observation: this looks like a general gap rather than an example issue. For reference, VTK C++ calls it from vtk.js has the equivalent OpenGL/Renderer buildPass calling only #2536 may be the same root cause. This one looks related too: https://discourse.vtk.org/t/issues-with-lighting-and-clipping-in-multi-renderer-vtk-js-setup/15495 where the workaround was setFocusedRenderer(), which fits since only the poked renderer gets its lights updated. Might be fixable in one place, either there or by updating lights when the camera is modified. Happy to open an issue if that is useful. |
|
The issue I have is that in C++, vtkOpenGLRenderer inherits from vtkRenderer, and as such has access to UpdateLightGeometry, but in vtk-js, vtkOpenGLRenderer extends vtkViewNode. vtkOpenGLRenderer holds vtkRenderer instances indirectly through Should we call |
Isn't |
Update renderers' light geometry on every pass to fix incoherent lighting
c1cac65 to
721b360
Compare
Absolutely, I fixed it |
finetjul
left a comment
There was a problem hiding this comment.
Is the light geometry updated sufficiently often ?
i.e. is buildPass() called for each new camera position ?
Yes, maybe even too much. It's called every few ms as long as the left click is held down (in Convolution2DPass and SimpleCone examples). |
Sounds good then. |
|
Is there an example to test if #2536 is fixed ? |
finetjul
left a comment
There was a problem hiding this comment.
Apparently some test(s) are failing
Add missing renderer.updateLightsGeometryToFollowCamera() to fix incorrect initial render and the first camera interaction changing the lighting of the scene
Context
In Convolution2DPass example, the ligting of the scene changes after the first camera interaction (rotation or zoom).
Results
The lighting is correct at the first render.
Changes
Added missing
renderer.updateLightsGeometryToFollowCamera();