Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ float3 GetCameraRelativePositionWS(float3 positionWS)

real GetOddNegativeScale()
{
return unity_WorldTransformParams.w;
// FIXME: We should be able to just return unity_WorldTransformParams.w, but it is not
// properly set at the moment, when doing ray-tracing; once this has been fixed in cpp,
// we can revert back to the former implementation.
return unity_WorldTransformParams.w >= 0.0 ? 1.0 : -1.0;
}

float3 TransformObjectToWorld(float3 positionOS)
Expand Down
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed overused the atlas for Animated/Render Target Cookies (1259930).
- Fixed sky asserts with XR multipass
- Fixed for area light not updating baked light result when modifying with gizmo.
- Fixed robustness issue with GetOddNegativeScale() in ray tracing, which was impacting normal mapping (1261160).

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ void BuildFragInputsFromIntersection(IntersectionVertex currentVertex, float3 in
outFragInputs.color = currentVertex.color;

float3 normalWS = normalize(mul(currentVertex.normalOS, (float3x3)WorldToObject3x4()));
float4 tangentWS = float4(normalize(mul(currentVertex.tangentOS.xyz, (float3x3)WorldToObject3x4())), currentVertex.tangentOS.w);
outFragInputs.tangentToWorld = BuildTangentToWorld(tangentWS, normalWS);
float3 tangentWS = normalize(mul(currentVertex.tangentOS.xyz, (float3x3)WorldToObject3x4()));
outFragInputs.tangentToWorld = CreateTangentToWorld(normalWS, tangentWS, sign(currentVertex.tangentOS.w));

outFragInputs.isFrontFace = dot(incidentDirection, outFragInputs.tangentToWorld[2]) < 0.0f;
}