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

52
passes/ColFFTPass.js Normal file
View File

@@ -0,0 +1,52 @@
import { RenderPass } from "/framework/RenderPass.js";
import Shader from "/framework/WebGpu.js";
export class ColFFTPass extends RenderPass {
async create( ) {
this.shader = new Shader( this.device );
await this.shader.setup( "shaders/fft_col.wgsl" );
const oceanBlock = this.pipeline.getBlockByName( "ocean" );
const rowPass = oceanBlock.getPass( "RowFFT" );
const rowReal = rowPass.shader.getBuffer( "outputReal" );
const rowImag = rowPass.shader.getBuffer( "outputImag" );
await this.shader.setBuffer( "inputReal", rowReal );
await this.shader.setBuffer( "inputImag", rowImag );
this.shader.setVariable( "outputReal", this.pipeline.memory.colReal );
this.shader.setVariable( "outputImag", this.pipeline.memory.colImag );
this.shader.setVariable( "heightField", this.pipeline.memory.heightField );
this.shader.setVariable( "params", this.pipeline.memory.computeParams );
}
bindBuffers( ) {
this.shader.setVariable( "params", this.pipeline.memory.computeParams );
}
async execute( ) {
const groups = this.pipeline.gridSize;
await this.shader.execute( groups, 1, 1 );
}
}