Skip to content

Commit 192d5c1

Browse files
authored
Inspector: Fix cube depth texture error (#32412)
1 parent 7505b21 commit 192d5c1

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

examples/jsm/inspector/ui/Style.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,9 +879,16 @@ export class Style {
879879
border-bottom: none;
880880
user-select: none;
881881
-webkit-user-select: none;
882+
}
883+
884+
.parameters .list-item-row {
882885
min-height: 31px;
883886
}
884887
888+
.mini-panel-content .parameters .list-item-row {
889+
min-height: 21px;
890+
}
891+
885892
.list-item-wrapper {
886893
margin-top: 2px;
887894
margin-bottom: 2px;
@@ -1178,6 +1185,7 @@ export class Style {
11781185
align-items: center;
11791186
cursor: pointer;
11801187
gap: 8px;
1188+
will-change: transform;
11811189
}
11821190
11831191
.custom-checkbox input {
@@ -1187,7 +1195,7 @@ export class Style {
11871195
.custom-checkbox .checkmark {
11881196
width: 14px;
11891197
height: 14px;
1190-
border: 1px solid var(--profiler-border);
1198+
border: 1px solid var(--accent-color);
11911199
border-radius: 3px;
11921200
display: inline-flex;
11931201
justify-content: center;
@@ -1298,11 +1306,12 @@ export class Style {
12981306
width: 12px;
12991307
height: 12px;
13001308
margin-bottom: 2px;
1309+
will-change: transform;
13011310
}
13021311
13031312
.mini-panel-content .custom-checkbox .checkmark::after {
1304-
width: 8px;
1305-
height: 8px;
1313+
width: 7px;
1314+
height: 7px;
13061315
}
13071316
13081317
.mini-panel-content .list-container.parameters .list-item-row:not(.collapsible) {

src/nodes/lighting/ShadowNode.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,15 @@ class ShadowNode extends ShadowBaseNode {
557557

558558
} ).toInspector( `${ inspectName } / Depth`, () => {
559559

560-
return textureLoad( this.shadowMap.depthTexture, uv().mul( textureSize( texture( this.shadowMap.depthTexture ) ) ) ).x.oneMinus();
560+
// TODO: Use linear depth
561+
562+
if ( this.shadowMap.texture.isCubeTexture ) {
563+
564+
return cubeTexture( this.shadowMap.texture ).r.oneMinus();
565+
566+
}
567+
568+
return textureLoad( this.shadowMap.depthTexture, uv().mul( textureSize( texture( this.shadowMap.depthTexture ) ) ) ).r.oneMinus();
561569

562570
} );
563571

0 commit comments

Comments
 (0)