Blood Mix Shader

A shader that covers your object in blood.

Setup:

  1. Assign the blood shader as the next pass for your desired material.
  2. Set the noise texture to a new NoiseTexture2D and set the noise to a new FastNoiseLite.
  3. Set intensity to the amount of blood to cover the material.
  4. Set color to the desired blood color.
  5. Set noise_shading to the amount of desired shading from the noise texture.

Thanks to Pointblanks’ Blood Shader (2D) for inspiration.

Shader code
shader_type spatial;

render_mode depth_prepass_alpha;
render_mode diffuse_toon;
render_mode specular_toon;

uniform sampler2D noise : repeat_enable; // cutout & shading texture
uniform float noise_shading : hint_range(0.0, 1.0) = 1.0; // shading from noise
uniform float intensity : hint_range(0.0, 1.0) = 0.0; // amount of blood
uniform vec4 color : source_color = vec4(1.0, 0.0, 0.0, 1.0); // color of blood

void fragment() {
	vec4 noise_texture = texture(noise, UV);

	ALBEDO = color.rgb * mix(vec3(1.0), noise_texture.rgb, noise_shading);
	ALPHA = color.a * step(noise_texture.r, intensity);
}
Tags
blood, gore, noise
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Joyless

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments