3DSinghVFX / animation_nodes

Node-based visual scripting system designed for motion graphics in Blender.
Other
155 stars 16 forks source link

Subframes in Simulation node? #174

Closed eTaernis closed 3 years ago

eTaernis commented 3 years ago

Hello,

tracing an object's position with simulation nodes like here https://www.youtube.com/watch?v=EKhLLys63KA (a big thank you for this video and the functionality!) works fine for lower speeds, but the paths get uneven if the traced object moves really fast.

For example, tracing a fast circular movement results in a diamond shaped trail.

It seems like the Simulation node is only executed once per frame without a concept of subframes. Is it possible to get animation nodes to sample more often to get smoother results?

3DSinghVFX commented 3 years ago

@eTaernis Hi. There are some ways to handle this:

  1. Use the Smooth Bezier Spline node.
  2. Remap the time i.e., Time Remapping feature, but after rendering you need to speed up the video accordingly.
  3. Interpolate the values between two frames.
eTaernis commented 3 years ago

Thank you, I already tried the first two: 1 does not solve the problem, the shapes are smooth but not precise and 2 is massively increasing the number of frames to render.

So there are no subframes in animation nodes? (If the traced object is moving along a curve with "follow path", the curve object can be sampled with "infinite" precision. If an object is animated between two position keyframes, the selected animation interpolation type should also return an exact position for each arbitrary point in time, right?) Can you tell me how 3. works? Why do I need to interpolate values if I have real values that just need to be sampled more often?

3DSinghVFX commented 3 years ago

Thank you, I already tried the first two: 1 does not solve the problem, the shapes are smooth but not precise and 2 is massively increasing the number of frames to render.

Okay.

So there are no subframes in animation nodes?

Yes, as far as I know.

(If the traced object is moving along a curve with "follow path", the curve object can be sampled with "infinite" precision. If an object is animated between two position keyframes, the selected animation interpolation type should also return an exact position for each arbitrary point in time, right?) Can you tell me how 3. works? Why do I need to interpolate values if I have real values that just need to be sampled more often?

I'll make an example for this. However, this shall only work properly if we can calculate the slope of the points/positions as well. Can you please attach the screenshot/file?

eTaernis commented 3 years ago

Sorry for the delay!

After pressing play in the attached blend, you will notice that the resulting trail looks more triangular than circular. Increasing the speed below 2 frames/revolution will produce a flat trail. For cases like this, a subframe setting in the Simulation node would be great. point_trace.zip

3DSinghVFX commented 3 years ago

Sorry for the delay!

It is okay.

After pressing play in the attached blend, you will notice that the resulting trail looks more triangular than circular. Increasing the speed below 2 frames/revolution will produce a flat trail. For cases like this, a subframe setting in the Simulation node would be great.

It is not that easy to implement overall Subframe Settings in Simulation Nodes. In your example, if you increase the frames for evaluation in the curve setting shall fix it to some extent. Screenshot from 2021-05-29 16-44-22

I have been working on an example for subframes but that method will not be applicable for all cases.

eTaernis commented 3 years ago

Yes, but if I increase it, the object slows down. My problem is that as the traced object's speed increases, the tracing quality goes down. Speed needs to be even higher actually. So I have to render the trails separately at a higher framerate using Time Remapping and composite all together or bake the curve somehow.

Gerstmann-Bradley commented 3 years ago

To add a note: I think Simulation Node setup already lags viewport a lot. Add "Subframe" may do no benefit but only harms in the long run for making an animation. Not to say it's being said difficult to implement.

If you are doing trails. Increasing Speed may causes illusion, just like motion-blur kind of distortion. Perhaps at some point you may choose to tolerate some level of issue.

Also if you are doing trails using simulation nodes. You may want to try bluefox's extension in which he provides a "Spline Tracer". I don't think there's subframe option or make your result better. But you may still try.

At last, there may be other workarounds which you can consider. There are trail tutorials using shader. perhaps you may take a look.

3DSinghVFX commented 3 years ago

To add a note: I think Simulation Node setup already lags viewport a lot. Add "Subframe" may do no benefit but only harms in the long run for making an animation. Not to say it's being said difficult to implement.

@Gerstmann-Bradley Thank you for the feedback. Can you please provide an example for the lags viewport, I'll try to improve the Simulation Nodes?

Gerstmann-Bradley commented 3 years ago

@Gerstmann-Bradley Thank you for the feedback. Can you please provide an example for the lags viewport, I'll try to improve the Simulation Nodes?

There's no need for a setup. Just by adding a simulation input it immediately drags FPS down half from 30 to 15. Add an output drag FPS down another half into 7. image image

3DSinghVFX commented 3 years ago

@Gerstmann-Bradley I have created a new issue for the performance of the Simulation Nodes, so let us continue there: https://github.com/3DSinghVFX/animation_nodes/issues/175