How to refresh accumulative shadows (AccumulativeContext)? #2172
Unanswered
fabiopolimeni
asked this question in
Q&A
Replies: 1 comment
-
Ok, for anyone having similar issue, I have resolved this generating a new react component key every time. I guess this force a rerender of the component which wouldn't happen otherwise. But, I am not sure why this is needed, if someone has a better hint please let me know. <AccumulativeShadows
key={Math.random()}
uuid="scene-shadows"
position={[0, 0, 0]}
frames={frames}
alphaTest={alpha}
scale={scale}
resolution={resolution}
>
<RandomizedLight
key={Math.random()}
amount={amount}
radius={radius}
ambient={ambient}
intensity={intensity}
mapSize={resolution / 2}
position={[translation.x, translation.y, translation.z]}
/>
</AccumulativeShadows> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a project using the AccumulativeShadows component, where I want to change the shadows map resolution of the RandomizedLight from a leva component. But I noticed that when the I change the mapSize, the shadows disappear (e.g going from 512 to 1024) and they don't get recomputed. I was thinking that I may need to call the
reset()
function of the AccumulativeContext, but that is not exported. How would I go to fix this?The whole component is here in case you need to look at it
Beta Was this translation helpful? Give feedback.
All reactions