Improve brush rendering
This commit is contained in:
parent
2f765a74a2
commit
99b6af57d1
2 changed files with 4 additions and 4 deletions
|
|
@ -20,11 +20,11 @@ fn fragment(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
||||||
let speciesBStrength = clamp(pow(traces.g, settings.clarity), 0, 1);
|
let speciesBStrength = clamp(pow(traces.g, settings.clarity), 0, 1);
|
||||||
let brushStrength = traces.a;
|
let brushStrength = traces.a;
|
||||||
|
|
||||||
|
let agentColor = settings.speciesColorA * speciesAStrength + settings.speciesColorB * speciesBStrength;
|
||||||
|
let agentStrength = speciesAStrength + speciesBStrength;
|
||||||
|
|
||||||
let rgbColor = sqrt(
|
let rgbColor = sqrt(
|
||||||
settings.speciesColorA * speciesAStrength +
|
mix(agentColor, settings.brushColor * brushStrength, clamp(brushStrength - agentStrength, 0, 1))
|
||||||
settings.speciesColorB * speciesBStrength +
|
|
||||||
settings.brushColor * brushStrength
|
|
||||||
);
|
);
|
||||||
return vec4(backgroundColor - rgbColor, 1);
|
return vec4(backgroundColor - rgbColor, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export const settings: GameLoopSettings &
|
||||||
diffusionRateTrails: 0.4, // inverse
|
diffusionRateTrails: 0.4, // inverse
|
||||||
decayRateTrails: 0.9, // inverse
|
decayRateTrails: 0.9, // inverse
|
||||||
diffusionRateBrush: 4, // inverse
|
diffusionRateBrush: 4, // inverse
|
||||||
decayRateBrush: 0.99, // inverse
|
decayRateBrush: 0.995, // inverse
|
||||||
|
|
||||||
brushColor: palette.blue,
|
brushColor: palette.blue,
|
||||||
speciesColorA: palette.yellow,
|
speciesColorA: palette.yellow,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue