用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:reflectionprobe:reflectionprobe

ReflectionProbe 反射探测器

class in UnityEngine/Inherits from: Behaviour

Description 描述

The reflection probe is used to capture the surroundings into a texture which is passed to the shaders and used for reflections.

该反射器用于捕获着色器和用于反射的环境纹理。

The properties are an exact match for the values shown in the Inspector.

该属性是在面板中显示的值的精确匹配。

This class is a script interface for a reflection probe component.

该类是反射探测器组件的脚本接口。

Reflection probes are usually just created in the Editor, but sometimes you might want to create a reflection probe from a script:

反射探测器通常仅在编辑器中被创建,但是有时你可能希望在脚本中创建一个反射探测器。

JavaScript:

function Start () {
	// Make a game object
	var probeGameObject : GameObject = new GameObject("The Reflection Probe");
 
	// Add the reflection probe component
	var probeComponent = probeGameObject.AddComponent.<ReflectionProbe>() as ReflectionProbe;
 
	// Set texture resolution
	probeComponent.resolution = 256;
 
	// Reflection will be used for objects in 10 units around the position of the probe
	probeComponent.size = Vector3(10, 10, 10);
 
	// Set the position (or any transform property)
	probeGameObject.transform.position = Vector3(0, 5, 0);
}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Start() {
        GameObject probeGameObject = new GameObject("The Reflection Probe");
        ReflectionProbe probeComponent = probeGameObject.AddComponent<ReflectionProbe>() as ReflectionProbe;
        probeComponent.resolution = 256;
        probeComponent.size = new Vector3(10, 10, 10);
        probeGameObject.transform.position = new Vector3(0, 5, 0);
    }
}

Variables 变量

backgroundColorThe color with which the texture of reflection probe will be cleared.
颜色与纹理反射探测器将会被清除。
bakedTextureReference to the baked texture of the reflection probe's surrounding.
参考反射探测器环境的烘培纹理。
blendDistanceDistance around probe used for blending (used in deferred probes).
围绕探针用于混合(用于递延探针)的距离。
boundsThe bounding volume of the reflection probe (Read Only).
反射探测器的体积边界(只读)。
boxProjectionShould this reflection probe use box projection?
这种反射探测是否使用框投影?
centerThe center of the box area in which reflections will be applied to the objects. Measured in the probes's local space.
将会应用于该对象的反射的边框区域的中心。在探针的自身空间中测量。
clearFlagsHow the reflection probe clears the background.
反射探测器如何清除背景。
cullingMaskThis is used to render parts of the reflecion probe's surrounding selectively.
这是用于有选择性的渲染反射探测器的环境的部分。
customBakedTextureReference to the baked texture of the reflection probe's surrounding. Use this to assign custom reflection texture.
参考反射探测器的环境的烘培纹理。使用该属性分配自定义反射纹理。
farClipPlaneThe far clipping plane distance when rendering the probe.
渲染探针时的远裁剪平面距离。
hdrShould this reflection probe use HDR rendering?
该反射探测是否使用高动态范围图像渲染?
importanceReflection probe importance.
反射探测器的重要性。
intensityThe intensity modifier that is applied to the texture of reflection probe in the shader.
适用于反射探头在着色器的纹理强度修饰符。
modeShould reflection probe texture be generated in the Editor (ReflectionProbeMode.Baked) or should probe use custom specified texure (ReflectionProbeMode.Custom)?
是否在编辑器中生成反射探测器(ReflectionProbeMode.Baked)或者是否该探针使用指定自定义纹理(ReflectionProbeMode.Custom)?
nearClipPlaneThe near clipping plane distance when rendering the probe.
当渲染该探针时靠近的剪裁平面。
refreshModeSets the way the probe will refresh.See Also: ReflectionProbeRefreshMode.
设置探针刷新的方式。
resolutionResolution of the underlying reflection texture in pixels.
基础反射纹理的分辨率单位像素。
shadowDistanceShadow drawing distance when rendering the probe.
探针渲染时阴影绘画的距离。
sizeThe size of the box area in which reflections will be applied to the objects. Measured in the probes's local space.
用于该对象反射的边框区域大小。在探针的本地空间中测算。
textureTexture which is passed to the shader of the objects in the vicinity of the reflection probe (Read Only).
纹理传递到邻近的反射探测器的对象的着色器中 (只读)。
timeSlicingModeSets this probe time-slicing modeSee Also: ReflectionProbeTimeSlicingMode.
设置该探针的时间切片的模式
typeReflection probe type.
反射探测器的类型。

Public Functions 公共函数

IsFinishedRenderingChecks if a probe has finished a time-sliced render.
检查探测器是否结束时间片的渲染。
RenderProbeRefreshes the probe's cubemap.
恢复探测器的立方体贴图。

Static Functions 静态函数

BlendCubemapUtility method to blend 2 cubemaps into a target render texture.
混合两个立方体贴图到一个目标渲染纹理的实用方法。
script/unityengine/classes/reflectionprobe/reflectionprobe.txt · 最后更改: 2016/08/02 05:34 (外部编辑)