浏览代码

HDRenderLoop: Correct fix double sided

/main
sebastienlagarde 8 年前
当前提交
5cc2607c
共有 3 个文件被更改,包括 4 次插入11 次删除
  1. 11
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/TemplateDisneyGGX.hlsl
  2. 2
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  3. 2
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test-alpha.mat

11
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/TemplateDisneyGGX.hlsl


output.tangentToWorld[1].w = 0;
output.tangentToWorld[2].w = 0;
#ifdef SHADER_STAGE_FRAGMENT
#if defined(_DOUBLESIDED_LIGHTING_FLIP) || defined(_DOUBLESIDED_LIGHTING_MIRROR)
output.cullFace = FRONT_FACE_TYPE(0); // To avoid a warning
#endif
#endif
return PackVaryings(output);
}

#else
// Mirror the normal with the plane define by vertex normal
float3 oppositeNormalWS = reflect(surfaceData.normalWS, vertexNormalWS);
#endif
#endif
// surfaceData.normalWS = IS_FRONT_VFACE((input.cullFace >= 0.0 ? GetOdddNegativeScale() : -GetOdddNegativeScale()) >= 0.0, surfaceData.normalWS, oppositeNormalWS);
surfaceData.normalWS = IS_FRONT_VFACE((input.cullFace >= 0.0 ? GetOdddNegativeScale() : -GetOdddNegativeScale()) >= 0.0, surfaceData.normalWS, oppositeNormalWS);
surfaceData.normalWS = IS_FRONT_VFACE(input.cullFace, GetOdddNegativeScale() >= 0.0 ? surfaceData.normalWS : oppositeNormalWS, -GetOdddNegativeScale() >= 0.0 ? surfaceData.normalWS : oppositeNormalWS);
#endif
surfaceData.materialId = 0;

2
Assets/TestScenes/HDTest/HDRenderLoopTest.unity


m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1614424510}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 2.58852, y: 1.27, z: -0.944}
m_LocalPosition: {x: 2.159, y: 1.27, z: -3.323}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.2}
m_Children: []
m_Father: {fileID: 0}

2
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test-alpha.mat


m_Floats:
- first:
name: _AlphaCutoff
second: 0.309
second: 0.166
- first:
name: _AlphaCutoffEnable
second: 1

正在加载...
取消
保存