Poison Effect Shader for Any Mesh

A sickly green layer for poisoned characters and props, with a pulsing rim, a faint tint and bubbles rising up the body.

Put it on any MeshInstance3D under Geometry > Material Overlay. The mesh keeps its own material and the poison draws on top. It doesn’t need UVs because the bubbles are placed in the mesh’s local space, so it works on a character or a plain box. Animate strength from 0 to 1 when the poison kicks in. Match bubble_scale to the size of your mesh. grow pushes the layer out a little so it doesn’t z-fight.

Turn Glow on. No textures, and it looked the same on Forward+, Mobile and Compatibility in 4.4 and 4.7.

The code was written with the help of an AI coding assistant.

I wrote this as a small take on the poison in my Status Effect VFX pack for Godot 4, which also has burn, freeze, shock and petrify.
https://gennai.itch.io/status-effect-vfx-godot-4?utm_source=godotshaders&utm_medium=referral&utm_campaign=poison

Shader code
// Poison Status Overlay for Any Mesh for Godot 4
// MIT License. Copyright (c) 2026 gennai (https://gennai.itch.io)
//
// A sickly green skin for characters and props that are poisoned: a rim that pulses,
// a faint green tint over the whole surface, and bubbles that rise up the body and burst.
// Put it on a MeshInstance3D as Geometry > Material Override > Next Pass or, simpler, as
// Geometry > Material Overlay. The mesh keeps its own material and the poison is drawn
// over it. It works on any mesh, with or without UVs, because the bubbles are placed in
// the mesh's local space.
//
// Animate strength from 0 to 1 when the poison starts and back to 0 when it wears off.
// bubble_scale should match the size of the mesh: higher = smaller bubbles. grow pushes
// the skin out a little so the overlay does not fight with the mesh surface.
// No textures: the pattern is computed in the shader with sin-free hashes, so it looks
// the same on every renderer.
shader_type spatial;
render_mode blend_mix, depth_draw_never, cull_back, shadows_disabled, specular_disabled;

group_uniforms poison;
// 0 = no poison, 1 = fully poisoned. Animate this.
uniform float strength : hint_range(0.0, 1.0) = 1.0;
// Speed of the pulse in the rim.
uniform float pulse_speed : hint_range(0.0, 8.0) = 3.0;
// How wide the glowing rim is. Higher = the rim covers more of the mesh.
uniform float rim_power : hint_range(0.5, 6.0) = 2.2;
// How strongly the whole surface is tinted.
uniform float tint_amount : hint_range(0.0, 1.0) = 0.3;
// Pushes the skin out along the normals, in local units.
uniform float grow : hint_range(0.0, 0.1) = 0.012;

group_uniforms bubbles;
// Size of the bubble pattern. Higher = smaller bubbles (1 / local units).
uniform float bubble_scale : hint_range(1.0, 30.0) = 6.0;
// How fast the bubbles rise.
uniform float rise_speed : hint_range(0.0, 3.0) = 0.6;
// How many of the bubbles are shown.
uniform float bubble_amount : hint_range(0.0, 1.0) = 0.7;
// Changes the bubble pattern.
uniform float seed : hint_range(0.0, 100.0) = 0.0;

group_uniforms look;
// Colour of the tint and the dark part of the rim.
uniform vec4 poison_color : source_color = vec4(0.25, 0.8, 0.12, 1.0);
// Colour of the bright rim and the bubbles.
uniform vec4 glow_color : source_color = vec4(0.7, 1.0, 0.35, 1.0);
// Brightness of the glow. Values above 1 bloom when glow is on.
uniform float glow_energy : hint_range(0.0, 6.0) = 1.6;

varying vec3 v_local;

float ps_hash(vec3 p) {
	vec3 p3 = fract(p * 0.1031);
	p3 += dot(p3, p3.zyx + 31.32);
	return fract((p3.x + p3.y) * p3.z);
}

vec3 ps_hash3(vec3 p) {
	return vec3(ps_hash(p), ps_hash(p + 17.3), ps_hash(p + 41.9));
}

// Rising bubbles: random spheres in a 3D grid, drawn where the mesh surface cuts them.
// Returns x = ring and highlight, y = soft body.
vec2 ps_bubbles(vec3 p, float t) {
	vec3 q = p * bubble_scale + vec3(0.0, -t, 0.0);
	vec3 i = floor(q);
	vec3 f = fract(q);
	vec2 res = vec2(0.0);
	for (int z = -1; z <= 1; z++) {
		for (int y = -1; y <= 1; y++) {
			for (int x = -1; x <= 1; x++) {
				vec3 g = vec3(float(x), float(y), float(z));
				vec3 cid = i + g + seed;
				vec3 h = ps_hash3(cid);
				float rad = 0.14 + 0.2 * h.x;
				float d = length(g + h - f) / rad;
				float on = step(h.y, bubble_amount);
				float ring = (1.0 - smoothstep(0.0, 0.18, abs(d - 0.92))) * on;
				float body = (1.0 - smoothstep(0.0, 1.0, d)) * on;
				res = max(res, vec2(ring, body * 0.5));
			}
		}
	}
	return res;
}

void vertex() {
	v_local = VERTEX;
	VERTEX += NORMAL * grow;
}

void fragment() {
	float fres = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), rim_power);
	float pu = 0.6 + 0.4 * (0.5 + 0.5 * cos(TIME * pulse_speed));
	vec2 b = ps_bubbles(v_local, TIME * rise_speed);
	float rim = fres * pu;
	vec3 col = poison_color.rgb * (0.25 + 0.5 * rim);
	vec3 em = glow_color.rgb * glow_energy * (rim * 0.9 + b.x * 0.8) + poison_color.rgb * b.y * 0.6;
	float a = tint_amount + rim * 0.6 + b.x * 0.45 + b.y * 0.2;
	ALBEDO = col;
	EMISSION = em * strength;
	ALPHA = clamp(a, 0.0, 1.0) * strength;
}
Live Preview
Tags
3d, Bubbles, buff, overlay, poison, rim, rpg, status effect, toxic, vfx
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 gennai

Related shaders

Comments 0

No comments yet.