Skip to content

Commit

Permalink
update builtin types (cocos#17822)
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e authored Nov 7, 2024
1 parent 4020b32 commit c914c67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions editor/assets/default_renderpipeline/builtin-pipeline-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
*/
/* eslint-disable max-len */
import { Material, Texture2D, gfx, Vec3 } from 'cc';
import { Material, Texture2D, Vec3, gfx } from 'cc';

const { SampleCount } = gfx;

Expand Down Expand Up @@ -100,9 +100,9 @@ export interface DepthOfField {
enabled: boolean; /* false */
/* refcount */ material: Material | null;
minRange: number; /* 0 */
maxRange: number; /* 0 */
maxRange: number; /* 50 */
blurRadius: number; /* 1 */
intensity: number;
intensity: number; /* 1 */
focusPos: Vec3;
[name: string]: unknown;
}
Expand All @@ -114,7 +114,7 @@ export function makeDepthOfField(): DepthOfField {
minRange: 0,
maxRange: 50,
blurRadius: 1,
intensity: 0.2,
intensity: 1,
focusPos: new Vec3(0, 0, 0),
};
}
Expand All @@ -130,13 +130,16 @@ export function fillRequiredDepthOfField(value: DepthOfField): void {
value.minRange = 0;
}
if (value.maxRange === undefined) {
value.maxRange = 0;
value.maxRange = 50;
}
if (value.blurRadius === undefined) {
value.blurRadius = 1;
}
if (value.intensity === undefined) {
value.intensity = 1;
}
if (value.focusPos === undefined) {
value.focusPos = new Vec3();
value.focusPos = new Vec3(0, 0, 0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion editor/assets/effects/pipeline/post-process/dof1.effect
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void main() {
outColor += blur(screenTex, v_uv + offsets.zy);
outColor += blur(screenTex, v_uv + offsets.xw);
outColor += blur(screenTex, v_uv + offsets.zw);
fragColor = outColor * blurParams.w;
fragColor = outColor * blurParams.w * 0.25;
}
}%

Expand Down

0 comments on commit c914c67

Please sign in to comment.