Тёмный

Rotating Objects in UE4, Benchmarked (Get better FPS!) 

Pending Kill
Подписаться 3,3 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 70   
@PendingKill
@PendingKill 4 года назад
Suggested Improvements: 1) You can make rotation with Tick frame-independent by multiplying the Rotator by the Tick event's DeltaSeconds. We've implemented this in the Github source code.
@channieonline
@channieonline 4 года назад
"omg these material-based coins are much faster to render!" of course they are, you don't spend 25ms per frame computing dynamic shadows anymore!
@legacythegame
@legacythegame 4 года назад
It would be nice to see how much the shadows cost
@PendingKill
@PendingKill 4 года назад
@@legacythegame We'll try to cover shadows in a future video!
@drummerman883
@drummerman883 4 года назад
Great video, even with seeing this through out my dev time it's nice to see the hard numbers. Definitely a reality check.
@PendingKill
@PendingKill 4 года назад
Thank you! We'll be incorporating more of these stats in our tutorials.
@antonlinden9677
@antonlinden9677 3 года назад
When you want to draw the same mesh many times, I recommend using Instanced Static Mesh Component instead of having an actor for each. It renders a single mesh on multiple positions
@fiskergaming5750
@fiskergaming5750 3 года назад
Yes, but to test framerates, this is a better solution
@OpenMawProductions
@OpenMawProductions Год назад
That's not going to work if you want to use this for pick ups.
@Mireneye
@Mireneye 10 месяцев назад
First and foremost an excellent video! Very thorough! It's not entirely true that you can't do anything about the shadow. You can give the shadow a custom shadow stencil and conceivably you could rotate that stencil. It'll never be as precise as actually casting the shadow, but for simple shapes (like a coin) you can probably cheaply model the appearance from some uv coords.
@FerlinDev
@FerlinDev 4 года назад
That is exacly why you multiply the delta time with rotation angle when using event tick 🤣
@FerlinDev
@FerlinDev 4 года назад
Nvm, you wrote that in the comments
@OpenMawProductions
@OpenMawProductions Год назад
Or, just don't use tick whenever possible because it is still the worst performer here.
@MarvelMaster
@MarvelMaster 4 года назад
Good job defenitly learned something ;)
@PendingKill
@PendingKill 4 года назад
Thank you!
@dbarr49
@dbarr49 3 года назад
I wonder how this test would differ if you used an instanced static mesh over regular static meshes. My guess is performance would probably increase dramatically for all of your tests
@Morderkainer
@Morderkainer 4 года назад
Would be good idea disable coins shadows and fake the shadow with a texture rotation on stamps.
@robinj6997
@robinj6997 8 месяцев назад
Have you done any testing in UE5.3? I've been dwelling in material to create some animation, to save on performance. Would be nice to know if there is a point to it still or if it's outdated nowadays. Like how would this compare to vertex animation?
@ZimCrusher
@ZimCrusher Год назад
how do you get his to rotate around the local axis? I have a propeller I want to spin, but it is not perfectly aligned in X,Y, or Z. It's tilted at 45 degrees. I can easily make it a child of a Scene Component, so it only rotates in Y, but the Material method does not see it this way. It still rotates it in World Y. I tried ObjectPiviotPoint, ComponentPivotLocal, Local, and I'm running out of choices.
@PendingKill
@PendingKill Год назад
On the NormalizedRotationAxis of the RotateAboutAxis material node, you'll want to specify a normalized (i.e. magnitude of 1) vector representing the axis you want the propeller to spin around. In the video, we're using a vector that represents a line pointing straight up in the Z axis (0,0,1). For your example of a 45 degree angle, you can try (0,0.707,0.707) or different combinations, as 0.707 is sin(45 degrees) and cos(45 degrees).
@ZimCrusher
@ZimCrusher Год назад
@@PendingKill yea... this still only gets me a fixed rotation. Meaning, I would have to know the object's angle in the game. I am randomly spawning fans, in a room. so... 1) trying to get the fan blade to face the correct direction. 2) (advanced) trying to get the fan blade to face the correct direction, if I have a ossolating fan. currently, If I look at the fan in the blueprint, it looks fine, but once I place it in the scene, it is locked aligned to XYZ that was set in the blue print, and it ignores the rotation of the actor in the scene.
@ZimCrusher
@ZimCrusher Год назад
@@PendingKill Got it to work. I had some help on a discord forum. Adding 2 nodes in the material that enter the RotateAboutAxis/NormalizedRotationAxis (input). Take the colored XYZ(RGB) node, plug it into a Normalize node. Add a ObjectOrientation Node. Add RotateVector node.
@PendingKill
@PendingKill Год назад
@@ZimCrusher Glad you figured it out! The ObjectOrientation node seems like the key to get it to rotate around arbitrarily placed objects in the scene. Thanks for writing this up, hopefully others will find it useful.
@QuiteDan
@QuiteDan Год назад
Do the normals also need to be rotated when using a material-based rotation?
@MrSofazocker
@MrSofazocker 2 года назад
Now, what do I have to do If I want hundreds of coins that one can pickup when they're not actors?
@littledemo3605
@littledemo3605 Год назад
so timers not that good in optimized it's any way = event tick!
@zenofar4761
@zenofar4761 Год назад
so i can use it for all my updates (tick) functions?
@momomadi2
@momomadi2 3 года назад
i wanna add if u use the material static mesh on BP - but set it as static not movable - the engine should realise it as instance (no more draw call for eatch)- and should get better performance ---- i test with another thing not ur test
@darkwere1
@darkwere1 4 года назад
Why don't you try an instantiated static meshes?
@xboxoneoldmansregret1977
@xboxoneoldmansregret1977 Год назад
What about a timeline?
@hiiammoot
@hiiammoot 4 года назад
I was under the assumption that static mesh components in actors were auto instanced. Other than that, it would be interesting to see how instanced static meshes would work with.
@PendingKill
@PendingKill 4 года назад
Typically they are auto-instanced as long as they're not moving. But once we add the Rotating Movement component or rotate the actor manually on tick, the auto-instancing no longer occurs.
@xDemorn
@xDemorn 2 года назад
hmm very interesting
@OpenMawProductions
@OpenMawProductions Год назад
Did you turn tick off when you put the material in the actor?
@OpenMawProductions
@OpenMawProductions Год назад
Seriously. I have an actor that is my base pick up actor, and I turned tick off. My FPS stayed 120 FPS with over 300 actors on screen. Turned tick back on and it halved my FPS. So the material is really the best option.
@stellarcommander3456
@stellarcommander3456 Год назад
умножь значение повората на дельта секунды, и тогда кадры в секунду не будут влиять на скорость поворота.
@cumuIonimbus
@cumuIonimbus Год назад
It is kinda weird that less FPS = slower rotation when using Tick... If you multiplied your RotationRate by DeltaTime, this shouldn't have been a problem.
@fenexj
@fenexj 4 года назад
Good stuff, follow up video on a C++ implementation?
@PendingKill
@PendingKill 4 года назад
Thanks! I believe that a C++ implementation would follow a very similar structure, especially for the Rotating Movement component. Of course, you wouldn't need C++ for the Material method.
@Wip3ou7
@Wip3ou7 2 года назад
why do the objects have a wobble? even in the preview with the sphere you can see that the sphere isnt maintaining its position perfectly
@3sgamestudio
@3sgamestudio 3 года назад
forgot to compare the "rotating movement" component. which is a native c++ component for rotating objects.
@IllyasArt
@IllyasArt 4 года назад
Really cool!
@rifat.ahammed
@rifat.ahammed Год назад
Great great . Thank you soo much for this episode. Want more optimization result comparing videos like this one.
@jonathanxdoe
@jonathanxdoe 2 года назад
I hoped the material wasn't the best. It is such a pain to code complex behavior without a graph
@Tigerzhell
@Tigerzhell 4 года назад
René Borrero Why use any of those methods when you can just make a simple animation for it. Also are these copies you made instanced?
@FerlinDev
@FerlinDev 4 года назад
Also, you should have tested Timelines and rotation lerps
@scarlindo
@scarlindo 4 года назад
was about to type that
@philzan3627
@philzan3627 4 года назад
Could've also done a recursive re-route with a delay but hey...
@ThomasBaijot
@ThomasBaijot 3 года назад
How to use a random value for the rotation rate with Rotation Movement Component ??
@liloupalomino8677
@liloupalomino8677 3 года назад
Subscribed after watching that intro
@sherifhany386
@sherifhany386 3 года назад
Yes more please, i'll even subscribe to the channel
@zz6838
@zz6838 Год назад
Great video! please make more tutorials!!
@YouWillDoAsYouAreTold
@YouWillDoAsYouAreTold 3 года назад
really great tutorial, thanks! subbed
@boundlessunrealengine9467
@boundlessunrealengine9467 Год назад
You made my day! Thanks!
@rifz42
@rifz42 4 года назад
Great new channel, please make more tutorials! : )
@bestboy007
@bestboy007 3 года назад
dude. you pro
@littledemo3605
@littledemo3605 Год назад
so witch better optimized method?
@PendingKill
@PendingKill Год назад
Doing it in the material is the fastest!
@littledemo3605
@littledemo3605 Год назад
@@PendingKill but shadow not working. how i stop cast shadow on one specified component?
@PendingKill
@PendingKill Год назад
​@@littledemo3605 I'm not sure exactly what you're trying to do, but you can try unchecking the Cast Shadows checkbox on the rotating actor.
@omri1324
@omri1324 3 года назад
Wait, so shader based rotation isn't good anymore if it's inside a BP?
@PendingKill
@PendingKill 3 года назад
Well, seems like once you put it into a blueprint, UE will treat it as separate objects and won't do auto-instancing with the static meshes. However, you're still avoiding having to rotate an object every frame, so it's substantially cheaper compared to using the RotatingMovement component (or any of the other non-shader rotation methods we discussed)
@frozengemstudio9204
@frozengemstudio9204 2 года назад
Thank you!
@dimaferox5133
@dimaferox5133 3 года назад
Wow, very great optimization tutorial! It's very interesting to optimize games, thanks! Hope you will do more tutorials for optimization and possible issues like shadows but in very optimized material
@Skyflairl2p
@Skyflairl2p 4 года назад
This obviously doesnt matter, but for reference what are the specs of the pc used for these tests? Particularly cpu/gpu setup Great info though, and excellently presented!
@PendingKill
@PendingKill 4 года назад
Thank you for the kind words! These tests were done on a somewhat dated machine, with an AMD FX-8350 processor and R9 380 GPU.
@Skyflairl2p
@Skyflairl2p 4 года назад
@@PendingKill Oh my the nostalgia, the FX-8350! how come you still run that bad boy in the year 2020? haha, with the more recent ryzen cpu's being relatively cheap that is. (unless you actually own two rigs.) I used to have one aswell. It was a beast back when it was released!
@PendingKill
@PendingKill 4 года назад
​@@Skyflairl2p Haha it's served us well, though we're planning to upgrade that one soon :) the other machine we have is a Ryzen 3600 + RTX 2080. And yeah 8 cores was a flex back in the day.
@sandromaric6226
@sandromaric6226 4 года назад
Great Video! .... Thx for this
@PendingKill
@PendingKill 4 года назад
Thank you!
Далее
#kikakim
00:10
Просмотров 12 млн
Training AI Bots to Fight (they started dancing)
15:06
Просмотров 290 тыс.
Rotating Normal Maps in Unreal Engine
19:13
Просмотров 5 тыс.
Why Solo Developers Should Use Unreal
9:51
Просмотров 388 тыс.
5 Tips to Optimize Environments in Unreal Engine 4
12:23
3D Printer Shader - Material Tutorial - [UE4]
10:21
Просмотров 14 тыс.
#kikakim
00:10
Просмотров 12 млн