first commit

This commit is contained in:
2025-12-31 14:22:45 +01:00
commit c78a860098
73 changed files with 30137 additions and 0 deletions

44
passes/SpectrumPass.js Normal file
View File

@@ -0,0 +1,44 @@
import { RenderPass } from "/framework/RenderPass.js";
import Shader from "/framework/WebGpu.js";
export class SpectrumPass extends RenderPass {
async create( ) {
this.shader = new Shader( this.device );
await this.shader.setup( "shaders/ocean_spectrum_new.wgsl" );
this.shader.setVariable( "h0Real", this.pipeline.memory.h0Real );
this.shader.setVariable( "h0Imag", this.pipeline.memory.h0Imag );
this.shader.setVariable( "spectrumReal", this.pipeline.memory.spectrumReal );
this.shader.setVariable( "spectrumImag", this.pipeline.memory.spectrumImag );
this.shader.setVariable( "params", this.pipeline.memory.computeParams );
}
bindBuffers( ) {
const memory = this.pipeline.memory;
this.shader.setVariable( "params", memory.computeParams );
}
async execute( ) {
const groups = Math.ceil( this.pipeline.gridSize / 8 );
await this.shader.execute( groups, groups, 1 );
}
}