找回密碼
 注冊帳號

掃一掃,訪問微社區

camera.clearflags 清除旗標

2015-1-4 03:17| 發布者: 楊炎| 查看: 2010| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: camera.layerculldistances 層消隱距離varlayerculldistances: floatdescription描述per-layer culling distances.每層的消隱距離。normally camera skips rendering of objects that are further away thanfarclipp ...

camera.layerculldistances 層消隱距離

varlayerculldistances: float[]

description描述

per-layer culling distances.

每層的消隱距離。

normally camera skips rendering of objects that are further away thanfarclipplane. you can set up some layers to use smaller culling distances using layerculldistances. this is very useful to cull small objects early on, if you put them into appropriate layers.

通常相機跳過渲染對象是遠于farclipplane,你可以使用layerculldistances設置某些層使用較小消隱距離,這如果你把它們放在合適的層級,這對于早期剔除一些小的物體對象是非常有用的。

when assigning layerculldistances, you need to assign float array that has 32 values. zero values in cull distances means "use far plane distance".

當分配layerculldistances,你需要指定的float數組有32個值。0值的消隱距離意思是使用遠剪裁屏幕距離。

參見:farclipplane.

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

void start() {

float[] distances = new float[32];

distances[10] = 15;

camera.layerculldistances = distances;

}

}

function start () {

var distances = new float[32];

// set up layer 10 to cull at 15 meters distance.

// all other layers use the far clip plane distance.

//設置層10的消隱為15米距離,其他所有層使用遠剪裁屏幕距離

distances[10] = 15;

camera.layerculldistances = distances;

}

上一篇:camera 攝像機下一篇:camera.main 主相機

相關閱讀

文章點評
相關文章
女校游泳队彩金