fix: sample noise at distorted uv for visible deformation effects
This commit is contained in:
parent
d636d0f847
commit
12b8fee0b0
1 changed files with 5 additions and 5 deletions
|
|
@ -112,11 +112,11 @@ void fragment() {
|
||||||
// swirl
|
// swirl
|
||||||
uv = get_swirl_uv(uv, swirl_strength);
|
uv = get_swirl_uv(uv, swirl_strength);
|
||||||
|
|
||||||
// sample the ColorRect texture (water image if assigned, else 1x1 white)
|
// Sample the noise at the distorted UV for visible liquid variation.
|
||||||
vec4 tex = texture(TEXTURE, uv);
|
// (ColorRect has no texture, so TEXTURE is always white — this makes
|
||||||
|
// wave/ripple/swirl deformation visible by sampling noise instead.)
|
||||||
// hue-shift the base liquid colour, modulated by the texture
|
float detail = texture(noise_tex, (uv * noise_module_size / 100.0 * noise_scale + t * 0.03) * 0.5).r;
|
||||||
vec3 base_rgb = tex.rgb * liquid_color.rgb;
|
vec3 base_rgb = liquid_color.rgb * (0.85 + 0.15 * detail);
|
||||||
vec3 hsv = rgb2hsv(base_rgb);
|
vec3 hsv = rgb2hsv(base_rgb);
|
||||||
hsv.x = fract(hsv.x + t * 0.1 * hue_shift_speed);
|
hsv.x = fract(hsv.x + t * 0.1 * hue_shift_speed);
|
||||||
hsv.y = clamp(hsv.y + 0.2 * noise_val, 0.0, 1.0);
|
hsv.y = clamp(hsv.y + 0.2 * noise_val, 0.0, 1.0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue