pmndrs / react-three-lightmap

In-browser lightmap/AO baker for react-three-fiber and ThreeJS
MIT License
131 stars 8 forks source link

scene not rendered in latest react-three/fiber #19

Open JosephClay opened 2 years ago

JosephClay commented 2 years ago

The latest version of @react-three/fiber prevents rendering

Modified the example sandbox to demonstrate

Tried solving the issue locally. There seems to be 2 issues:

unframework commented 2 years ago

Hey, thanks a lot for looking into this and reporting the specific issues. I will try to fix this in the next few days.

JosephClay commented 2 years ago

Let me know if I can help. I'm on the poimandres discord

unframework commented 2 years ago

I upgraded to latest React/r3f was able to repro the sceneRef.current issue, still figuring out a fix.

vsabinin commented 2 years ago

Hi guys, I'm having the same issue. Any idea how to fix it?

unframework commented 2 years ago

Hi Slava and others, I appreciate the long wait - a bit of a crunch at work but I should have some cycles this week to wrap this up.

nikolai-sim commented 2 years ago

Hey team any updates on this? Really keen to use this in a project. Thanks for the awesome work.

unframework commented 2 years ago

Thanks for checking in again! Yeah the last month has been really busy at work, I am hoping that time management improves in the coming week. Really appreciating the wait - suspense related issues are super finicky to try and figure out, hence why I need to dig in a bit deeper on this.

03hgryan commented 2 years ago

Hi, I am also very excited to use this in my project. Any updates? Thanks for amazing work!

unframework commented 2 years ago

Ok, so I did some cleanup work and upgraded to React 18.

As is, the main branch now works with the latest React but I had to take out the fancy logic that triggered Suspense while baking was going on. So what you'll see currently is the intermediate lightmap texture flashing briefly on the models while baking is going on.

To help with that, I added an onComplete callback - so at least one can hide the scene initially until the baking is complete.

I will try to wrap up the new work on re-adding Suspense soon, and maybe treat that as a 0.1.0 release haha.

03hgryan commented 2 years ago

Thank you so much!!!

03hgryan commented 2 years ago

The update is not yet published to npm right?

unframework commented 2 years ago

The update is not yet published to npm right?

I did not push a new version to NPM yet, this is in a temporary state until I fix suspense 😅.

03hgryan commented 2 years ago

Oh okay okay, Thanks. I did not meant to rush you btw:)

unframework commented 1 year ago

Some more work in progress here: https://github.com/pmndrs/react-three-lightmap/pull/23. I am moving the actual baking to work in a separate React root and WebGL context - this keeps logic a bit simpler (no need to clean up the temporary baker scene), and should plug into Suspense much better, because the process is completely independent of the suspended React tree.