GodotCity XR/VR Shader
inspired by the movie sincity,
best to be used with a lightsource and roughness set to 0 or clearcoat enabled on the material of the objects you wish to have that red look as seen in the cover image.
This shader is supposed to be used mainly in XR/VR, follow the instructions below to get it working in Godot 4 XR/VR
1) add a MeshInstance3D node as a child of the XRCamera3D node
2) select the newly created MeshInstance3D node and under Mesh select type of QuadMesh, change it`s size on x and y to 2m
3) under GeometryInstance3D, click on Material override and create a new ShaderMaterial, now drag and drop the shader into the dropdown
Shader code
shader_type spatial;
render_mode unshaded, depth_test_disabled, cull_disabled;
uniform sampler2D screen_texture : hint_screen_texture;
uniform float intensity : hint_range(0.0, 5.0, .01) = 1.0;
uniform float redness : hint_range(0, 1) = 1.0;
void vertex(){
// needs to be 1.0
VERTEX *= 1.0;
// needs to be 1.0
POSITION = vec4(VERTEX, 1.0);
}
void fragment() {
vec2 texCoords = SCREEN_UV;
vec3 color = texture(screen_texture, SCREEN_UV).rgb;
float lum = pow(dot(color, vec3(1.0, 0, 0)), 1.2);
vec3 red = vec3(color.r * color.g * color.b)/0.1 * lum;
color = red * intensity;
if (color.r > redness) {
color.g = 0.0;
color.b = 0.0;
}
ALBEDO = color;
}