Skip to content

Commit

Permalink
Add OIDN HDR wip state
Browse files Browse the repository at this point in the history
  • Loading branch information
StuckiSimon committed Aug 20, 2024
1 parent 059101f commit c1e27ae
Show file tree
Hide file tree
Showing 6 changed files with 2,161 additions and 67 deletions.
25 changes: 25 additions & 0 deletions strahl-lib/src/denoise-pass-shader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import denoisePassShader from "./denoise-pass-shader.wgsl?raw";

type Params = {
imageWidth: number;
imageHeight: number;
maxWorkgroupDimension: number;
maxBvhStackDepth: number;
};

const PARAM_PLACEHOLDER_MAP: Record<keyof Params, string> = {
imageWidth: "imageWidth",
imageHeight: "imageHeight",
maxWorkgroupDimension: "maxWorkgroupDimension",
maxBvhStackDepth: "maxBvhStackDepth",
};

export default function build(params: Params) {
const placeholders = Object.entries(PARAM_PLACEHOLDER_MAP) as [
keyof Params,
string,
][];
return placeholders.reduce((aggregate, [key, value]) => {
return aggregate.replaceAll(`\${${value}}`, `${params[key]}`);
}, denoisePassShader);
}
Loading

0 comments on commit c1e27ae

Please sign in to comment.