浏览代码

Initial integration of Post-FX V2 MSVO

/projects-TheLastStand
John 7 年前
当前提交
a7402091
共有 3 个文件被更改,包括 4 次插入15 次删除
  1. 5
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
  2. 8
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.hlsl
  3. 6
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShaderLibrary/InputSurface.hlsl

5
ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


if (LightweightUtils.HasFlag(frameRenderingConfiguration, FrameRenderingConfiguration.DepthPass))
{
DepthPass(ref context);
//<<< MSVO BEGIN
//>>> MSVO END
}
ForwardPass(visibleLights, frameRenderingConfiguration, ref context, ref lightData, stereoEnabled);

}
}
//<<< MSVO BEGIN
private void RenderMSVO(ref ScriptableRenderContext context)
{
if(m_CameraPostProcessLayer == null) return;

context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
//>>> MSVO END
private void ShadowPass(VisibleLight[] visibleLights, ref ScriptableRenderContext context, ref LightData lightData)
{

8
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.hlsl


half3 viewDir : TEXCOORD6;
half4 fogFactorAndVertexLight : TEXCOORD7; // x: fogFactor, yzw: vertex light
//<<< MSVO BEGIN
//>>> MSVO END
float4 clipPos : SV_POSITION;
};

half fogFactor = ComputeFogFactor(o.clipPos.z);
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
//<<< MSVO BEGIN
//TODO: flip Y based on screen params.
//Is there a function in the library to already do this?
//>>> MSVO END
return o;
}

half3 indirectDiffuse = SampleGI(IN.lightmapUVOrVertexSH, normalWS);
float fogFactor = IN.fogFactorAndVertexLight.x;
//<<< MSVO BEGIN
//>>> MSVO END
half4 color = LightweightFragmentPBR(IN.posWS.xyz, normalWS, IN.viewDir, indirectDiffuse, IN.fogFactorAndVertexLight.yzw, surfaceData.albedo, surfaceData.metallic, surfaceData.specular, surfaceData.smoothness, surfaceData.occlusion, surfaceData.emission, surfaceData.alpha);

6
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShaderLibrary/InputSurface.hlsl


half _Shininess;
CBUFFER_END
//<<< MSVO BEGIN
//Begin MSVO Params
//>>> MSVO END
//End MSVO Params
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
TEXTURE2D(_MetallicGlossMap); SAMPLER(sampler_MetallicGlossMap);

#endif
}
//<<< MSVO BEGIN
//>>> MSVO END
half3 Emission(float2 uv)
{

正在加载...
取消
保存