UE4渲染用到的Bounds

官方介绍:

Testing Visibility with an Actor's Bounds

Each Actor placed in a Level has a set of bounds using a box and a sphere that is used for various things in the Engine. One of those being specifically to test whether an it is visible or not. The bounds of an Actor is made up of two parts: a sphere and a box. The bounding sphere is used for fast collision detection with a simple distance test, and, more often than not, it's greater in size than the object it contains. On the other hand, the bounding box is a closer match to the shape of the object and provides more accurate results. 

Visualize bounds of Actors in the Level Viewport by selecting Show > Advanced > Bounds. Alternatively, in the Skeletal Mesh Editor you can select Character > Bounds and in the Static Mesh Editor, select Bounds in the main toolbar.

 

ActorBounds.png

An Actor with its bounds (sphere and box) displayed.

 

Each Static Mesh and Skeletal Mesh has its own bounding box and sphere that automatically scales to the size of the geometry when imported, or when scaled or rotated in the viewport.

 

You can edit an Actor's bounds using the following ways:

  • By setting the Bounds Scale from its Details panel when it's selected in a Level or in a Blueprint. The Bounds Scale uniformly scales the bounds of an Actor, acting as a multiplier of the original scale values.

    PerActorBoundsSettingsDetailsPanel.png

    Click image for full size.

  • By opening the Static Mesh or Skeletal Mesh Editors to apply non-uniform scaling for Positive Bounds Extension and Negative Bounds Extensions using the Details panel. 
    ActorEditorBoundsExtension.png

Increasing an Actor's bounds can potentially impact performance and shadow quality by keeping the Actor from be culled sooner than it would otherwise have been. 

 

源码解释:

/** 
     * Scales the bounds of the object.
     * This is useful when using World Position Offset to animate the vertices of the object outside of its bounds. 
     * Warning: Increasing the bounds of an object will reduce performance and shadow quality!
     * Currently only used by StaticMeshComponent and SkeletalMeshComponent.
     */
    UPROPERTY(EditAnywhere, AdvancedDisplay, Category=Rendering, meta=(UIMin = "1", UIMax = "10.0"))
    float BoundsScale;

 

使用:

玩家快速走过,相机视角可看到某物体,可以适当增加BoundsScale,但是降低性能。相机视角渲染,会根据Bounds检测是否渲染裁剪剔除。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值