Closed slash9494 closed 1 month ago
It looks like you don't have a camera created on that render - are you able to share more code?
This code is created on your storybook section texture/pbr.stories.js
So other code is same with that component
I just add above code on that and remove cubeTexture component
for adding .hdr
file
So on useEffect
, i create new hdrCubeTexture
and try to convert it to .env
file
is there a camera in your <Scene .../>
? I don't know if there is a potential race condition when the callback is called (potentially too early) or if you have not created a camera.
Yeah in the scene, arcRotateCamera
is created
I could not check the scene reloaded earlier than camera when converting is succeeded
But on the babylon sandbox or pure Babylon scene, nothing is going to happen
sorry for late reply - is there any way you can repro this using something like code sandbox?
here is sample situation on code sandbox https://codesandbox.io/s/strange-sun-e824l5?file=/src/App.tsx
That method is creating a camera: https://github.com/BabylonJS/Babylon.js/blob/fdbf393d1d7699dc7cc69cec1dca0819ebd2622a/packages/dev/core/src/Misc/environmentTextureTools.ts#L252
I will see about how I can fix that. I may need a guard clause on the default render loop. I started a discussion on the forum and see if any suggestions are posted: https://forum.babylonjs.com/t/fun-with-createenvtextureasync/28901
For now you’ll need to create your own runRenderLoop (call ‘clear’ method first). I’ll make sure this is fixed for next release.
thank you for informing babylonjs of it and i will try this method on my renderLoop
Closing from inactivity. I think I solved this by checking there is a camera in render loop.
i have tried to generate '.env' file by EnvironmentTextureTools of babylonjs
after generating buffer through it, it throw error and scene is out
i just refer to "generating texture" of babylonjs sandbox and only difference is to generate after loading texture through useEffect
but i'm not sure react-babylonjs environment cause it
i have tried it on
textures/pbr.stories.js
and i also changed environment url forhdr file