sipi Posted June 5, 2025 Share Posted June 5, 2025 How would you calculate the velocity of a moving geometry (consistent topology, static camera) in screen space? 1 Quote Link to comment Share on other sites More sharing options...
haggi Posted June 5, 2025 Share Posted June 5, 2025 You have a vex function called toNDC where you can use your velocity information to transform it to normalized raster coordinates. Even if it says it's only well defined in shading context it seems to work in sop as well. 2 Quote Link to comment Share on other sites More sharing options...
sipi Posted June 5, 2025 Author Share Posted June 5, 2025 (edited) 15 minutes ago, haggi said: You have a vex function called toNDC where you can use your velocity information to transform it to normalized raster coordinates. Even if it says it's only well defined in shading context it seems to work in sop as well. yeah, i guess i have to do something with the NDC stuff, but not clear to me how Edited June 5, 2025 by sipi Quote Link to comment Share on other sites More sharing options...
Librarian Posted June 5, 2025 Share Posted June 5, 2025 (edited) @sipi maybe //box ndc vector offset = {0.5, 0.5, 0}; vector cameraScale = set(ch("camera_X"), ch("camera_Y"), 1); if (@group_near) @P = set(@P.x, @P.y, ch("near")*-1); if (!@group_near) @P = set(@P.x, @P.y, ch("far")*-1); vector xformpos = @P * maketransform(0,0, offset,{0,0,0},cameraScale,{0,0,0}); @P = fromNDC(chs("camera_path"), xformpos); Edited June 5, 2025 by Librarian 2 Quote Link to comment Share on other sites More sharing options...
sipi Posted June 5, 2025 Author Share Posted June 5, 2025 (edited) This is what I could come up with. Uses 1 qLib node (Camera Plane ql). screen_space_velocity.hiplc Edited June 5, 2025 by sipi typo 2 Quote Link to comment Share on other sites More sharing options...
sipi Posted June 11, 2025 Author Share Posted June 11, 2025 I think I have found the perfect solution. This seems 100% correct. Takes into account the camera motion as well. screen_space_velocity_2.hiplc 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.