-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
TRAANode: Add velocity node source #32274
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
base: dev
Are you sure you want to change the base?
TRAANode: Add velocity node source #32274
Conversation
I would prefer to contextualize the |
|
I agree. Would the post-processing context ( |
I'll need to do some tests to be sure. Coincidentally, I was working in a global context; This should also help. It's part of this PR, but I'll separate it. |
|
That looks great. Does it replace the builder's shared context? It doesn't seem to do anything right now. |
|
I think we can try do it this way
Developers could currently use this: // There is ambiguity in the term "velocity" here, but this practice should be replaced by the global context.
traaPass = traa( beautyNode, depthNode, velocityNode, camera ).context( { velocity: customVelocity } );After the global context, it will be able to be defined at the root, so that any other node can auto use the velocity node. // alt 1
renderer.globalContext = globalContext( {
velocity: customVelocity
} );
// possibly: alt 2
renderer.globalContext.setValue( 'velocity', customVelocity ); The default |
|
Thank you for your response. Wouldn't it just be an indirect way of assigning it to tell the velocity source via Also, I would suggest storing the unjittered projection matrix in the global context (this isn't possible in the current per-material context) instead of the velocity node in that case, because some post-processing nodes will also need that matrix to unjitter the applied offset. |
Description
This PR adds
velocityNodeSourcefield toTRAANodeto specify the node that needs the original projection matrix.As context, I have a
HighpVelocityNodethat multiplies the model and view matrices on the CPU, because in large coordinates such as meter-scale ECEF, the builtinVelocityNodecannot be used as a reliable velocity source. Following the discussion in #30955, I'm fine with dealing with such use cases in user code, but without changes like in this PR it's not possible to useTRAANodein that setup.I'm not fully sure about the name
velocityNodeSource, and also there could be a better way to tell the source of velocity textures in other places. If that's the case, I'm perfectly fine with using that approach instead.