浏览代码

Rename OpaqueDownsampling and remove cast to half

/LW-DistortionPass
Matt Dean 7 年前
当前提交
e1c4f751
共有 4 个文件被更改,包括 20 次插入20 次删除
  1. 18
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 10
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs
  3. 10
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
  4. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightSampling.shader

18
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs


_8x = 8
}
public enum TextureScale
public enum Downsampling
OnePoint = 0,
HalfBilinear,
QuarterBox,
QuarterBilinear
None = 0,
_2xBilinear,
_4xBox,
_4xBilinear
}
public enum DefaultMaterialType

[SerializeField] private bool m_RequireDepthTexture = false;
[SerializeField] private bool m_RequireSoftParticles = false;
[SerializeField] private bool m_RequireOpaqueTexture = false;
[SerializeField] private TextureScale m_OpaqueTextureScale = TextureScale.HalfBilinear;
[SerializeField] private Downsampling m_OpaqueDownsampling = Downsampling._2xBilinear;
[SerializeField] private bool m_SupportsHDR = false;
[SerializeField] private MSAAQuality m_MSAA = MSAAQuality._4x;
[SerializeField] private float m_RenderScale = 1.0f;

set { m_RequireOpaqueTexture = value; }
}
public TextureScale OpaqueTextureScale
public Downsampling OpaqueDownsampling
get { return m_OpaqueTextureScale; }
set { m_OpaqueTextureScale = value; }
get { return m_OpaqueDownsampling; }
set { m_OpaqueDownsampling = value; }
}
public bool SupportsHDR

10
ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs


public static GUIContent requireOpaqueTexture = new GUIContent("Opaque Texture", "If enabled the pipeline will copy the screen to texture after opaque objects are drawn. For transparent objects this can be bound in shaders as _CameraOpaqueTexture.");
public static GUIContent opaqueTextureScale = new GUIContent("Opaque Scale", "The scale of the original screen size that is used for the opaque texture");
public static GUIContent opaqueDownsampling = new GUIContent("Opaque Downsampling", "The downsampling method that is used for the opaque texture");
public static GUIContent shadowType = new GUIContent("Type",
"Global shadow settings. Options are NO_SHADOW, HARD_SHADOWS and SOFT_SHADOWS.");

public static string[] shadowTypeOptions = {"No Shadows", "Hard Shadows", "Hard and Soft Shadows"};
public static string[] shadowCascadeOptions = {"No Cascades", "Two Cascades", "Four Cascades"};
public static string[] opaqueTextureScaleOptions = {"One (Point)", "Half (Bilinear)", "Quarter (Box)", "Quarter (Bilinear)"};
public static string[] opaqueDownsamplingOptions = {"None", "2x (Bilinear)", "4x (Box)", "4x (Bilinear)"};
}
AnimBool m_ShowSoftParticles = new AnimBool();

private SerializedProperty m_RequireDepthTextureProp;
private SerializedProperty m_RequireSoftParticlesProp;
private SerializedProperty m_RequireOpaqueTextureProp;
private SerializedProperty m_OpaqueTextureScaleProp;
private SerializedProperty m_OpaqueDownsamplingProp;
private SerializedProperty m_ShadowTypeProp;
private SerializedProperty m_ShadowNearPlaneOffsetProp;
private SerializedProperty m_ShadowDistanceProp;

m_RequireDepthTextureProp = serializedObject.FindProperty("m_RequireDepthTexture");
m_RequireSoftParticlesProp = serializedObject.FindProperty("m_RequireSoftParticles");
m_RequireOpaqueTextureProp = serializedObject.FindProperty("m_RequireOpaqueTexture");
m_OpaqueTextureScaleProp = serializedObject.FindProperty("m_OpaqueTextureScale");
m_OpaqueDownsamplingProp = serializedObject.FindProperty("m_OpaqueDownsampling");
m_ShadowTypeProp = serializedObject.FindProperty("m_ShadowType");
m_ShadowNearPlaneOffsetProp = serializedObject.FindProperty("m_ShadowNearPlaneOffset");
m_ShadowDistanceProp = serializedObject.FindProperty("m_ShadowDistance");

EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTexture);
DrawAnimatedProperty(m_RequireSoftParticlesProp, Styles.requireSoftParticles, m_ShowSoftParticles);
EditorGUILayout.PropertyField(m_RequireOpaqueTextureProp, Styles.requireOpaqueTexture);
DrawAnimatedPopup(m_OpaqueTextureScaleProp, Styles.opaqueTextureScale, Styles.opaqueTextureScaleOptions, m_ShowOpaqueTextureScale);
DrawAnimatedPopup(m_OpaqueDownsamplingProp, Styles.opaqueDownsampling, Styles.opaqueDownsamplingOptions, m_ShowOpaqueTextureScale);
EditorGUILayout.PropertyField(m_HDR, Styles.hdrContent);
EditorGUILayout.PropertyField(m_MSAA, Styles.msaaContent);

10
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


RenderTextureDescriptor opaqueDesc = CreateRTDesc(frameRenderingConfiguration, opaqueScaler);
CommandBuffer cmd = CommandBufferPool.Get("Opaque Copy");
cmd.GetTemporaryRT(CameraRenderTargetID.opaque, opaqueDesc, m_Asset.OpaqueTextureScale == TextureScale.OnePoint ? FilterMode.Point : FilterMode.Bilinear);
cmd.GetTemporaryRT(CameraRenderTargetID.opaque, opaqueDesc, m_Asset.OpaqueTextureScale == Downsampling.None ? FilterMode.Point : FilterMode.Bilinear);
case TextureScale.OnePoint:
case Downsampling.None:
case TextureScale.HalfBilinear:
case Downsampling._2xBilinear:
case TextureScale.QuarterBox:
case Downsampling._4xBox:
case TextureScale.QuarterBilinear:
case Downsampling._4xBilinear:
cmd.Blit(m_CurrCameraColorRT, CameraRenderTargetID.opaque);
break;
}

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightSampling.shader


s += (SAMPLE_TEXTURE2D(tex, samplerTex, uv + d.xw));
s += (SAMPLE_TEXTURE2D(tex, samplerTex, uv + d.zw));
return s * (1.0h * 0.25h);
return s * (1.0 * 0.25);
}
ENDHLSL

正在加载...
取消
保存