Messing with the weights in the WebGPU bloom pass's combine shader to better resemble what's in the regl version.

This commit is contained in:
Rezmason
2021-11-15 01:06:10 -08:00
parent b26155d20e
commit 29329aed7f

View File

@@ -24,7 +24,9 @@ struct ComputeInput {
var uv = (vec2<f32>(coord) + 0.5) / vec2<f32>(outputSize);
var sum = vec4<f32>(0.0);
for (var i = 0.0; i < config.pyramidHeight; i = i + 1.0) {
sum = sum + (1.0 - i / config.pyramidHeight) * textureSampleLevel( tex, linearSampler, uv, i + 1.0 );
var weight = (1.0 - i / config.pyramidHeight);
weight = pow(weight + 0.5, 1.0 / 3.0);
sum = sum + textureSampleLevel( tex, linearSampler, uv, i + 1.0 ) * weight;
}
textureStore(outputTex, coord, sum * config.bloomStrength);