当前位置: 代码迷 >> 综合 >> unity 之 Render 二
  详细解决方案

unity 之 Render 二

热度:26   发布时间:2023-11-21 16:34:31.0

Skybox

Properties

Property: Function:
Tint Color The tint color
Exposure 调节天空盒的亮度 skybox.
Rotation 更改天空盒围绕y轴的旋转角度 skybox around the positive y axis.
Front, etc The textures used for each face of the cube used to store the skybox. Note that it is important to get these textures into the correct slot.

Details

Skyboxes 在所有不透明物体之后渲染 opaque objects;

通过 Window > Rendering> Lighting Settings 设置当前的摄像机的天空盒

如果你想覆盖原来的天空盒,给摄像机添加一个 Skybox Component组件. 每个摄像机都可以有单独的天空盒

雾的颜色也可以通过天空盒来实现,cubemap的作用,就是通过shader,比如自带的天空盒shader来使用

 

Reflection Probe

 Reflection Probe 它更像是一个摄像机,从各个方向捕捉周围环境的球面视图. 捕捉的图片被存储成一个 Cubemap,可以被带有反射材料的物体使用. 在给定的场景中可以使用多个反射探测,并且可以将对象设置为使用最近的探测生成的cubemape. 结果表明,物体上的反射会随着环境的变化而发生令人信服的变化。

A Reflection Probe showing reflections from a nearby object

Properties

Property: Function:
Type Choose whether the probe is for a Baked, Custom or Realtime setup?
Dynamic Objects (仅自定义类型)强制将未标记为静态的对象烘焙到反射中。
Cubemap (仅自定义类型)为probe.设置自定义cubemap。
Refresh Mode (Realtime type only) 选择probe在运行时刷新的条件和方式.  On Awake 首次激活时呈现一次. Every Frame 每一帧更新, Time Slicing 经常用(see below). The Via Scripting通过代码更新
Time Slicing (Realtime type only)随着时间更新, All Faces At Once (spreads update over nine frames), Individual Faces (updates over fourteen frames) and No Time Slicing (the update happens entirely within one frame). See below for further details.
Runtime settings
Importance 当一个对象在两个或多个探测范围内时,更重要的探测将优先于不太重要的探测. This setting also affects the Blending, explained here.
Intensity 修改贴图反射cubemap的亮度
.
Box Projection 选中此框以启用反射UV映射的投影。
Box Size The size of the box in which the reflection will be applied to the GameObject
. The value is not affected by the Transform of the GameObject. Also used by Box Projection.
Box Offset The center of the box in which the reflections will be applied to the GameObject. The value is relative to the position of the GameObject. Also used by Box Projection.
Cubemap capture settings
Resolution 分辨率
HDR Should High Dynamic Range rendering
be enabled for the cubemap? This also determines whether probe data is saved in OpenEXR or PNG format.
Shadow Distance Distance at which shadows are drawn when rendering the probe.
Clear Flags Option to specify how empty background areas of the cubemap will be filled. The options are Skybox
and Solid Color.
Background Background colour to which the reflection cubemap is cleared before rendering.
Culling Mask Allows objects on specified layers to be included or excluded in the reflection. See the section about the Camera’s culling mask on the Layers
page.
Use Occlusion Culling Should occlusion culling
be used when baking the probe?
Clipping Planes Near and far clipping planes
of the probe’s “camera”.

Details

下面两个工具可以修改反射器的大小

 

 

The probe’s Type property determines how the reflection data is created and updated:

  • Baked probes 在编辑器中存储烘焙生成的静态反射cubemap。
  • Custom probes store a static cubemap which can either be generated by baking or set manually by the user.
  • Realtime probes update the cubemap at runtime and can therefore react to dynamic objects in the scene.

要使用反射cubemap, 该物体必须有在 Mesh Renderer中打开 Reflection Probes ,使用一个支持反射的shader.

Mesh Renderer的 Reflection Probes 属性选择 (Siple, Blend Probes or Blend Probes and Skybox)把要渲染的probe拖到 Anchor Override 属性当中

 

How do I make a Spot Light Cookie?

灰度纹理你用来控制游戏内照明的精确外观. 这对于制造移动的云和给人一种浓密树叶的印象是非常棒的.

To create a light cookie for a spot light:

  1. 在ps里面绘制一个灰度图像, White 白色代表看的见,有灯光通过,黑色代表看不见,五灯光通过,纹理的边框需要完全是黑色的,否则光线会在聚光灯外漏出
     
  2. Texture Inspector 改变Texture Type类型为 Cookie
  3. 打开Alpha From Grayscale (通过这种方式,你可以创建一个灰度cookie, Unity会自动将其转换为alpha map )

 

 

  相关解决方案