question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3d (beta) does not handle `renderDone` correctly

See original GitHub issue

Description The 3d (beta) panel calls render done in an effect on react render. https://github.com/foxglove/studio/blob/main/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx#L615-L617

However that is not when it has actually rendered the latest frame which happens on an animation frame call triggered here and run sometime later: https://github.com/foxglove/studio/blob/main/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx#L608-L610

The intent of calling renderDone is that you indicate to the message pipeline that you have rendered the frame of messages passed to you. This is how the pipeline keeps playback in-sync across the panels.

The 3d (beta) panel should be fixed to correctly call renderDone when the equivalent render frame has been rendered - in this case when the commands have been called for rendering the messages to the engine.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jhurlimancommented, Aug 22, 2022

Reclassifying as ux since this does not appear to degrade the app experience or break functionality in a user-facing way.

As far as fixing this, the current code looks like this:

  // Render a new frame if requested
  useEffect(() => {
    if (renderer && renderRef.current.needsRender) {
      renderer.animationFrame();
      renderRef.current.needsRender = false;
    }
  });

  // Invoke the done callback once the render is complete
  useEffect(() => {
    renderDone?.();
  }, [renderDone]);

renderer.animationFrame() synchronously calls this.gl.render(this.scene, camera) which is as close as we can get to “the frame has been rendered” with WebGL. Under the hood, it’s just populating a frame buffer and the final compositing is asynchronously handled by the browser, but we don’t have access to that level of feedback. I don’t understand useEffect well enough to describe the situation reported in this ticket, where the second useEffect is called before or without the first useEffect. Can someone with a deeper useEffect understanding chime in here?

0reactions
jtbandescommented, Dec 21, 2022

Moved to Linear

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Common render problems in Blender and how to solve them
If you start a render and Blender crash and automatically close during the process it is most likely one of two reasons. Blender...
Read more >
Daz Studio Pro BETA - version 4.21.1.26! - Page 4
The crash occurs in Iray and not Daz Studio when "Transmission Color" has a map applied. To prevent the crash, remove any map...
Read more >
Blender 3.2 Beta is Here! - YouTube
Join Our 3D Weekl Blender 3.2 is now in beta and we have some impressive new features and improvements coming to blender overall...
Read more >
Overhauled 3D effects in Illustrator
3D effects are one of the most popular effects used in ... Yes, Egor is right. ... It's not in my Beta version...
Read more >
Everything posted by stusutcliffe - 3D-Coat
My pop up tool tips do not appear to work in the .6 beta ,this includes my shaders ... [Solved] Smart Material depth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found