mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 13:59:30 -07:00
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:
@@ -24,7 +24,9 @@ struct ComputeInput {
|
|||||||
var uv = (vec2<f32>(coord) + 0.5) / vec2<f32>(outputSize);
|
var uv = (vec2<f32>(coord) + 0.5) / vec2<f32>(outputSize);
|
||||||
var sum = vec4<f32>(0.0);
|
var sum = vec4<f32>(0.0);
|
||||||
for (var i = 0.0; i < config.pyramidHeight; i = i + 1.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);
|
textureStore(outputTex, coord, sum * config.bloomStrength);
|
||||||
|
|||||||
Reference in New Issue
Block a user