How to make line trace with fast animations?

Hi,

Whenever I have a fast animation with line trace the line trace tends to spread a lot more. However if I have a slower animation the line trace doesn’t spread as much.

How can I fix the spread with line tracing so it can sync with my fast animation?

Thank you.

Same question…
Giant spread using linetrace and draw material on render target.

Anyone knows the solution?

Can you post a video of what it looks like? I haven’t encountered it, so it’s hard for me to know what you mean.

Leomerya12 thank you for the feedback.

Here you go:

As you can see, if i draw too fast, the material gets spread…

I see.

Okay, can you expose the FPS of your project and upload a new video? I’m unsure as to what the binding draw call is for your stylus. I imagine that if the markings are FPS-bound, that could explain why you’re getting the spread. (Kind of like how the shutter speed of a camera determines how smooth a video will be.)

I did that, it’s not about the FPS.
I’m having more than 400 fps.

I’m calling the event draw on every tick.

There’s literally no way I would have known that beforehand. Patience, please.

I’m gonna dig. Hopefully someone comes up with a solution before I do.

Oh, i didnt mean to make it agressive hehehe.

I was saying like “Nah :\ Unfortunally its not about the fps”

Thank you for all the help buddy!

1 Like

Hello, @BuracoDoOlho , let’s REZ this issue!

What do you mean by REZ? :stuck_out_tongue:

Ah, yes, “resurrect”.

Bring back from the dead.

So, it just occurred to me that this may not be something Unreal is good at. You may need to use a different engine.

Also, you mention that you’re getting 400 FPS:

But can you check to make sure that the FPS doesn’t drop when drawing occurs? It may dip every time a dot is created.

Thanks for the feedback.

Yeah, I don’t have any fps drops.
I did some research and I found the problem is tied to the framerate. The mouse refresh rate is higher than the tick so the mouse jumps to a point instead of drawing/tracing the whole line.

The only way I can think is to have some kind of checking at every tick, to trace the currentpoint-lastpoint…

Doing this with a line trace is nonsensical. Period.

The time between the trace start and any Hit Response varies based on the distance the ray has to travel.
Sure, we are talking microseconds - but what you are seeing now is only amplified at lower frame rates - which is all this engine provides.

Further, its just not how it is done in any way shape or form for anything really.

If you want to draw something, you use the mouse coordinates to do so - no traces involved.

You can potentially run the first trace, place the object you want to build or draw in the first hit position you get, build up the object from there by only using the mouse position until the button is unclicked.

Another, perhaps better but still intensive compared to reading mouse positions only approach could be to use the initial Down event to spawn a sphere, and then to move (sweep) the sphere by assigning it the correct value offset read off the mouse movement.
With the sphere being set to collide with the environment you could achieve similar effects to what you have, where the drawing wraps around objects.

Either way, not line trace related in the sense that a line trace shouldnt be in use for this at all, definitely an FPS issue, and on top of that its likely got to involve the polling rate that unreal can interpret via input on a mouse.
Unless you crack open a c++ library that exposes custom raw input for you, you will always be at the mercy of what unreal can handle as far as input speeds go - which isn’t all bad btw, but still way less than the real mouse raw input would be for any decent mouse.

Even with c++ because unreal essentially sucks, you are stuck with reading the mouse values at specific points / be it tick intervals or once each frame.
Since with a good mouse the pointer can move across 3 4k screens in about a frame (.12ms) you will always have the issue using anything resembeling the current setup…

I see.

Okay, can you expose the FPS of your project and upload a new video? I’m unsure as to what the binding draw call is for your stylus. I imagine that if the markings are FPS-bound, that could explain why you’re getting the spread. (Kind of like how the shutter speed of a camera determines how smooth a video will be.)

This is absolutely unrelated to anything I’m doing, but it’s SUPER informative. Curious to see how this plays out.

Maybe you can take a look at what this person did here:

https://www.unrealengine.com/marketplace/en-US/item/808002f091384c2b9ff15a4b258d35da

You can see it in action here:

This is, of course, assuming you haven’t already solved this issue.