First Commit
This commit is contained in:
31
shaders/taa.wgsl
Normal file
31
shaders/taa.wgsl
Normal file
@@ -0,0 +1,31 @@
|
||||
@group(0) @binding(0)
|
||||
var currentFrame : texture_2d<f32>;
|
||||
|
||||
@group(0) @binding(1)
|
||||
var historyFrame : texture_2d<f32>;
|
||||
|
||||
@group(0) @binding(2)
|
||||
var mySampler : sampler;
|
||||
|
||||
@group(0) @binding(3)
|
||||
var<uniform> blendAmount : f32;
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position : vec4<f32>,
|
||||
@location(0) uv : vec2<f32>,
|
||||
};
|
||||
|
||||
@vertex
|
||||
fn vertexMain(@location(0) position: vec3<f32>, @location(1) uv: vec2<f32>) -> VertexOutput {
|
||||
var out: VertexOutput;
|
||||
out.position = vec4<f32>(position, 1.0);
|
||||
out.uv = uv;
|
||||
return out;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragmentMain(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
||||
let current = textureSample(currentFrame, mySampler, uv);
|
||||
let history = textureSample(historyFrame, mySampler, uv);
|
||||
return mix(current, history, blendAmount);
|
||||
}
|
||||
Reference in New Issue
Block a user