浏览代码

Updated Debug views, Smoothness, Tangents space normal, gamma correction

/projects-TheLastStand
John Parsaie 6 年前
当前提交
430cb9f0
共有 6 个文件被更改,包括 10 次插入12 次删除
  1. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 5
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
  3. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShaderUtils.cs
  4. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl
  5. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandard.shader
  6. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Subsurface/LightweightSubsurface.shader

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


Albedo,
Normals,
Metallness,
Roughness,
All
Smoothness
};
public class LightweightPipelineAsset : RenderPipelineAsset

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


context.ExecuteCommandBuffer(setRT);
}
//TODO: Editor only?
if(!LightweightUtils.HasFlag(frameRenderingConfiguration, FrameRenderingConfiguration.DebugView))
ForwardPass(visibleLights, frameRenderingConfiguration, ref context, ref lightData, stereoEnabled);
else

case DebugViewMode.Normals:
LightweightShaderUtils.SetDebugMode(cmd, DebugViewKeyword.NORMALS);
break;
case DebugViewMode.Roughness:
LightweightShaderUtils.SetDebugMode(cmd, DebugViewKeyword.ROUGHNESS);
case DebugViewMode.Smoothness:
LightweightShaderUtils.SetDebugMode(cmd, DebugViewKeyword.SMOOTHNESS);
break;
}
context.ExecuteCommandBuffer(cmd);

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShaderUtils.cs


ALBEDO,
METALNESS,
NORMALS,
ROUGHNESS,
SMOOTHNESS,
NUM_VIEWS
}

"_DEBUG_ALBEDO",
"_DEBUG_METALNESS",
"_DEBUG_NORMALS",
"_DEBUG_ROUGHNESS"
"_DEBUG_SMOOTHNESS"
};
public static string GetShaderPath(ShaderPathID id)

6
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl


#elif defined(_DEBUG_METALNESS)
debug = surfaceData.metallic;
#elif defined(_DEBUG_NORMALS)
debug = inputData.normalWS;
#elif defined(_DEBUG_ROUGHNESS)
debug = 1.0 - surfaceData.smoothness;
debug = sqrt(surfaceData.normalTS);
#elif defined(_DEBUG_SMOOTHNESS)
debug = surfaceData.smoothness;
#endif
return half4(debug, 1);
}

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


// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_ROUGHNESS
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS
#pragma vertex LitPassVertex
#pragma fragment DebugPassFragment

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Subsurface/LightweightSubsurface.shader


// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_ROUGHNESS
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS
#pragma vertex LitPassVertex
#pragma fragment DebugPassFragment

正在加载...
取消
保存