Skip to content

Optimizing light loop part 2 #2

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 30 commits into from
Apr 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
83dd52a
Saving 10% off the PrepareLightForGPU
FrancescoC-unity Mar 24, 2020
09444e6
18% decrease in cost with this
FrancescoC-unity Mar 24, 2020
22f85bf
Around 12% cost shaving off GetLightData
FrancescoC-unity Mar 24, 2020
9520b38
Around 6.5% win here
FrancescoC-unity Mar 24, 2020
6af3741
Faster View matrix flip
FrancescoC-unity Mar 25, 2020
8f573d1
Missing *=-1
FrancescoC-unity Mar 25, 2020
d1546d6
About 7% win in preprocess light data
FrancescoC-unity Mar 25, 2020
340540a
Another small batch
FrancescoC-unity Mar 25, 2020
6337d37
Small cleanup for first optimization pass
FrancescoC-unity Mar 25, 2020
04409af
Tiny bit more cleanup
FrancescoC-unity Mar 25, 2020
18f5ce0
Make UpdateShadowRequests 12% cheaper
FrancescoC-unity Mar 25, 2020
6fab90f
Address review points
FrancescoC-unity Mar 25, 2020
c7d2f8f
A bit less than 20% win in ExtractPointLightData
FrancescoC-unity Mar 25, 2020
50140cf
Add comment
FrancescoC-unity Mar 25, 2020
e6a852b
changelog
FrancescoC-unity Mar 25, 2020
9734944
25% reduction of ExtractPointLightData
FrancescoC-unity Mar 25, 2020
a032bd3
18% win in UpdateShadowRequest
FrancescoC-unity Mar 25, 2020
b89293d
Another around 11% win for UpdateShadowRequest
FrancescoC-unity Mar 26, 2020
530d2e3
Merge branch 'HDRP/optimizing-light-loop' into HDRP/optimizing-light-…
FrancescoC-unity Mar 26, 2020
bc1a292
Move matrix multiply utils to core
FrancescoC-unity Mar 26, 2020
1134251
less lighttype computation
FrancescoC-unity Mar 26, 2020
6a625d2
Ooops
FrancescoC-unity Mar 27, 2020
815e969
Merge branch 'HDRP/staging' into HDRP/optimizing-light-loop-when-shadows
FrancescoC-unity Mar 27, 2020
63766fb
fixup changelog
FrancescoC-unity Mar 27, 2020
ddde84e
TMP merge staging, will need to fix more stuff on this.
FrancescoC-unity Apr 1, 2020
cb47788
Proper merge
FrancescoC-unity Apr 1, 2020
cf4f7c6
Missing leftovers .
FrancescoC-unity Apr 1, 2020
7556895
I'll manage to submit it all one day...
FrancescoC-unity Apr 1, 2020
f6aafb9
Merge branch 'HDRP/staging' into HDRP/optimizing-light-loop-when-shadows
sebastienlagarde Apr 8, 2020
e12c64d
Merge branch 'HDRP/staging' into HDRP/optimizing-light-loop-when-shadows
sebastienlagarde Apr 17, 2020
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
Prev Previous commit
Next Next commit
Missing leftovers .
  • Loading branch information
FrancescoC-unity committed Apr 1, 2020
commit cf4f7c637028e078ff7eba8e3965011c0fba9abd
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,6 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS
cachedDataIsValid = cachedDataIsValid || (legacyLight.type == LightType.Directional);
shadowIsCached = shadowIsCached && (hasCachedSlotInAtlas && cachedDataIsValid || legacyLight.type == LightType.Directional);

bool hasOrthoMatrix = false;

for (int index = 0; index < count; index++)
{
var shadowRequest = shadowRequests[index];
Expand Down Expand Up @@ -1886,7 +1884,6 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS
);
break;
case HDLightType.Directional:
hasOrthoMatrix = true;
UpdateDirectionalShadowRequest(manager, shadowSettings, visibleLight, cullResults, viewportSize, index, lightIndex, cameraPos, shadowRequest, out invViewProjection);
break;
case HDLightType.Area:
Expand Down Expand Up @@ -1952,7 +1949,10 @@ void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight
shadowRequest.position = new Vector3(shadowRequest.view.m03, shadowRequest.view.m13, shadowRequest.view.m23);
}
else
shadowRequest.position = (ShaderConfig.s_CameraRelativeRendering != 0) ? visibleLight.GetPosition() - cameraPos : visibleLight.GetPosition();
{
var vlPos = visibleLight.GetPosition();
shadowRequest.position = (ShaderConfig.s_CameraRelativeRendering != 0) ? vlPos - cameraPos : vlPos;
}

shadowRequest.shadowToWorld = invViewProjection.transpose;
shadowRequest.zClip = (lightType != HDLightType.Directional);
Expand Down