|
|
|
|
|
|
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData); |
|
|
|
|
|
|
|
// TODO: we must not access bsdfData here, it break the genericity of the code! |
|
|
|
return float4(bsdfData.color + builtinData.emissiveColor, builtinData.opacity); |
|
|
|
float4 outColor = float4(bsdfData.color + builtinData.emissiveColor, builtinData.opacity); |
|
|
|
|
|
|
|
#ifdef DEBUG_DISPLAY |
|
|
|
// Same code in ShaderPassForwardUnlit.shader |
|
|
|
if (_DebugViewMaterial != 0) |
|
|
|
{ |
|
|
|
float3 result = float3(1.0, 0.0, 1.0); |
|
|
|
bool needLinearToSRGB = false; |
|
|
|
|
|
|
|
GetPropertiesDataDebug(_DebugViewMaterial, result, needLinearToSRGB); |
|
|
|
GetVaryingsDataDebug(_DebugViewMaterial, input, result, needLinearToSRGB); |
|
|
|
GetBuiltinDataDebug(_DebugViewMaterial, builtinData, result, needLinearToSRGB); |
|
|
|
GetBSDFDataDebug(_DebugViewMaterial, bsdfData, result, needLinearToSRGB); // TODO: This required to initialize all field from BSDFData... |
|
|
|
|
|
|
|
// TEMP! |
|
|
|
// For now, the final blit in the backbuffer performs an sRGB write |
|
|
|
// So in the meantime we apply the inverse transform to linear data to compensate. |
|
|
|
if (!needLinearToSRGB) |
|
|
|
result = SRGBToLinear(max(0, result)); |
|
|
|
|
|
|
|
outColor = float4(result, 1.0); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
return outColor; |
|
|
|
} |