包含9節(jié)視頻教程
這是臨摹的終極表現(xiàn)!在臨摹領域達到真實照片的級別,讓你的繪畫讓別人驚呼吧!這不是照片,真的是繪畫出來的。我們一起來學習吧!
![]()
|
![]()
Properties 屬性
Details 細節(jié)Fixed Timestep 固定時間步Fixed time stepping is very important for stable physics simulation. Not all computers are made equal, and different hardware configurations will run Unity games with varying performance. Therefore, physics must be calculated independently of the game's frame rate. Physics calculations like collision detection and Rigidbody movement are performed in discrete fixed time steps that are not dependent on frame rate. This makes the simulation more consistent across different computers or when changes in the frame rate occur. For example, the frame rate can drop due to an appearance of many game onscreen, or because the user launched another application in the background. 固定時步對穩(wěn)定的物理模擬非常重要。不同計算機的硬件配置在運行unity的游戲時有不同的性能表現(xiàn)。因此物理模擬必須獨立于幀速率進行計算。碰撞檢測和剛體運動等物理計算在離散的固定時步中執(zhí)行,與幀速率無關。這使得物理模擬在不同的計算機上或幀速率發(fā)生變化時是一致的。例如,游戲屏幕內(nèi)容的變化和用戶在后臺執(zhí)行程序都會導致幀速率下降。 Here's how the fixed time step is calculated. Before every frame is drawn onscreen, Unity advances the fixed time by fixed delta time and performs physics calculations until it reaches the current time. This directly correlates to the Fixed Timestep property. The smaller the value of Fixed Timestep, the more frequently physics will be calculated. The number of Fixed frames per second can be calculated by dividing 1 by Fixed Timestep. Therefore, 1 / 0.02 = 50 fixed frames per second and 1 / 0.05 = 20 fixed frames per second. 以下是固定時步如何計算。在每一幀圖像繪制到屏幕之前,Unity將固定時間加上固定時步,然后執(zhí)行物理計算,直到它到達當前時間。該過程與固定時步屬性直接相關。固定時步值越小,物理計算就越頻繁。將1除以固定時步可以得到每秒計算固定幀的數(shù)量。所以,1 /0.02=50固定幀每秒,1 /0.05=20固定幀每秒。 Simply put, a smaller fixed update value leads to more accurate physics simulation but is heavier on the CPU. 簡而言之,一個較小的固定更新值可以得到更準確的物理模擬,但CPU的負擔會加重。 Maximum Allowed Timestep 最大時間步Fixed time stepping ensures stable physics simulation. However it can cause negative impact on performance if game is heavy on physics and is already running slow or occasionally dips to low frame rate. Longer the frame takes to process - more fixed update steps will have to be executed for the next frame. This results in performance degradation. To prevent such scenario Unity iOS introduced Maximum Allowed Timestep which ensures that physics calculations will not run longer than specified threshold. 固定時步可以確保穩(wěn)定的物理模擬。然而,如果游戲的物理計算過多導致運行緩慢或者幀速率間或降低,會造成負面影響。幀的處理時間越長,要執(zhí)行的固定時步更新次數(shù)就越多,這會導致性能下降。為了防止這種情況,Unity iOS通過引入最大時步來確保物理計算不會超過指定的閾值。 If frame takes longer to process than time specified in Maximum Allowed Timestep, then physics will "pretend" that frame took only Maximum Allowed Timestep seconds. In other words if frame rate drops below some threshold, then rigid bodies will slow down a bit allowing CPU to catch up. 如果幀的處理時間超過了最大時步,物理引擎會"假裝"該幀只消耗了最大時步的時間。換句話說,如果幀速率下降到低于某個閾值,剛體將會放慢一點讓CPU趕上。 Maximum Allowed Timestep affects both physics calculation and FixedUpdate() events. 最大時步對物理計算和FixedUpdate()事件都有影響。 Maximum Allowed Timestep is specified in seconds as Fixed Timestep. Therefore setting 0.1 will make physics and FixedUpdate() events to slow down, if frame rate dips below 1 / 0.1 = 10 frames per second. 最大時步的單位是秒。因此設置為0.1時,如果幀速率低于1 /0.1=每秒10幀,物理計算和FixedUpdate()事件將會放慢。 Typical scenario 典型場景
Hints 提示
贊0 踩0 |
未知用戶
2005-2025 朱峰社區(qū) 版權所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved
VIP