您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
30 行
1.4 KiB
30 行
1.4 KiB
namespace UnityEngine.Experimental.Rendering.HDPipeline
|
|
{
|
|
[DisallowMultipleComponent, ExecuteInEditMode]
|
|
[RequireComponent(typeof(Camera))]
|
|
public class HDAdditionalCameraData : MonoBehaviour
|
|
{
|
|
// This struct allow to add specialized path in HDRenderPipeline (can be use to render mini map or planar reflection etc...)
|
|
public enum RenderingPath
|
|
{
|
|
Default,
|
|
Unlit, // Preset
|
|
Custom // Fine grained
|
|
};
|
|
|
|
public RenderingPath renderingPath;
|
|
public FrameSettings frameSettings = new FrameSettings();
|
|
|
|
Camera m_camera;
|
|
|
|
void OnEnable()
|
|
{
|
|
// Be sure legacy HDR option is disable on camera as it cause banding in SceneView. Yes, it is a contradiction, but well, Unity...
|
|
// When HDR option is enabled, Unity render in FP16 then convert to 8bit with a stretch copy (this cause banding as it should be convert to sRGB (or other color appropriate color space)), then do a final shader with sRGB conversion
|
|
// When LDR, unity render in 8bitSRGB, then do a final shader with sRGB conversion
|
|
// What should be done is just in our Post process we convert to sRGB and store in a linear 10bit, but require C++ change...
|
|
m_camera = GetComponent<Camera>();
|
|
m_camera.allowHDR = false;
|
|
}
|
|
}
|
|
}
|