Basic Checkpoint

I made a checkpoint shader for a game I am currently working on.

It was inspired by the red checkpoint shader in Grand Theft Auto San Andreas.

Steps To Setup:

  1. Create A MeshInstance3D.
  2. Assign it to a ShaderMaterial.
  3. Adjust the Threshold and Error Correction as needed.
  4. Colorize!

You Can Use It In Your Game and Edit It If Needed. Credit is appreciated but not required.

Shader code
shader_type spatial;
render_mode cull_disabled;

varying vec3 vert;

uniform float threshold : hint_range(-1.0, 1.0, 0.1);
uniform float error_correction : hint_range(0.0, 1.0, 0.1);
uniform vec4 color : source_color;

void vertex() {
	vert = VERTEX;
}

void fragment() {
	ALBEDO = color.rgb;
	
	if (vert.y > threshold && vert.y < error_correction) {
		ALPHA = -vert.y * color.a;
	} else {
		ALPHA = 0.;
	}
}
Live Preview
Tags
area shader, checkpoint, checkpoint shader, spatial shader
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments