Skip to content

Fix erroneous tile coordinate calculations in contact shadows #4335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 @@ -206,6 +206,102 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 279522198}
m_Mesh: {fileID: 4300000, guid: 003b412a0b1ef1e4c9038104f29ee2d4, type: 3}
--- !u!1 &292124242
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 292124246}
- component: {fileID: 292124245}
- component: {fileID: 292124244}
- component: {fileID: 292124243}
m_Layer: 0
m_Name: tr
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!135 &292124243
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 292124242}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &292124244
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 292124242}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 257
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &292124245
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 292124242}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &292124246
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 292124242}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.2080444, y: 0.5135175, z: 4.82}
m_LocalScale: {x: 99.61942, y: 37.340744, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &488204068 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e,
Expand Down Expand Up @@ -300,6 +396,11 @@ PrefabInstance:
propertyPath: height
value: 480
objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
value: 8
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: ImageComparisonSettings.TargetWidth
Expand Down Expand Up @@ -985,7 +1086,7 @@ MonoBehaviour:
m_ShapeRadius: 0
m_SoftnessScale: 1
m_UseCustomSpotLightShadowCone: 0
m_CustomSpotLightShadowCone: 30
m_CustomSpotLightShadowCone: 16.6
m_MaxSmoothness: 1
m_ApplyRangeAttenuation: 1
m_DisplayAreaLightEmissiveMesh: 0
Expand Down Expand Up @@ -1049,6 +1150,7 @@ MonoBehaviour:
m_BarnDoorAngle: 90
m_BarnDoorLength: 0.05
m_preserveCachedShadow: 0
m_OnDemandShadowRenderOnPlacement: 1
m_ShadowCascadeRatios:
- 0.05
- 0.2
Expand All @@ -1064,7 +1166,6 @@ MonoBehaviour:
useOldInspector: 0
useVolumetric: 1
featuresFoldout: 1
showAdditionalSettings: 1
m_AreaLightEmissiveMeshShadowCastingMode: 0
m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
m_AreaLightEmissiveMeshLayer: -1
Expand All @@ -1089,9 +1190,9 @@ Light:
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 7957.747
m_Range: 100
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_Range: 52.09
m_SpotAngle: 36.4
m_InnerSpotAngle: 16.6
m_CookieSize: 10
m_Shadows:
m_Type: 1
Expand Down Expand Up @@ -1129,7 +1230,7 @@ Light:
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 2
m_AreaSize: {x: 1, y: 1}
m_AreaSize: {x: 0.5, y: 0.5}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -172,6 +172,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed SSR Accumulation with Offset with Viewport Rect Offset on Camera
- Fixed material Emission properties not begin animated when recording an animation (case 1328108).
- Fixed fog precision in some camera positions (case 1329603).
- Fixed contact shadows tile coordinates calculations.

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void DeferredContactShadow(uint2 groupThreadId : SV_GroupThreadID, uint2 groupId

uint2 pixelCoord = groupId * DEFERRED_SHADOW_TILE_SIZE + groupThreadId;
// There might be a mismatch between the size of a tile and the group size of this shader.
uint2 tileCoord = groupId * (DEFERRED_SHADOW_TILE_SIZE / TILE_SIZE_FPTL);
uint2 tileCoord = (groupId * DEFERRED_SHADOW_TILE_SIZE) / (TILE_SIZE_FPTL);

#ifdef ENABLE_MSAA
float depth = LOAD_TEXTURE2D_X(_CameraDepthValues, pixelCoord.xy).z;
Expand Down