-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderer: Call ID #27101
Renderer: Call ID #27101
Conversation
update after init
if ( this.isAnimating === true || this.animationLoop === null || this.nodes === null ) return; | ||
|
||
this.isAnimating = true; | ||
_init() { | ||
|
||
const update = ( time, frame ) => { | ||
|
||
this.requestId = self.requestAnimationFrame( update ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... is this correct that this function is called every frame using rAF even if animationLoop
isn't set? /ping @sunag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intentional, nodeFrame.update()
cannot be called in render()
to work correctly, this fix cases where no animationLoop
was added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it cannot be called there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to know what frame we are in to trigger NodeUpdateType.FRAME
frame events, otherwise we will only have NodeUpdateType.RENDER
call events. The frame counter makes sure which frame is in order to avoid duplicate events.
Related issue:
#26673 (comment),
https://discourse.threejs.org/t/has-anyone-noticed-any-unusual-behavior-in-the-uniform-node/56657/2
Description
This PR adds
info.call
,info.compute.call
,info.render.call
and remove the current behavior ofinfo.render.frame
.info.render.frame
is incremented every time we callrender()
but in theory one frame is the lapse of one keyframe for another, in a single frame we can have several RTT, for example. This caused confusion in the cache system and had duplicate calls in theNodeUpdateType.FRAME
settings causing overloads and in other cases had problems with bindings updates.