harvest/game/resources/toon_surface.gdshaderinc
2026-10-07 13:41:38 -04:00

23 lines
807 B
Text

// The surface half of ToonLook's converted materials (toon.gdshader, toon_double_sided.gdshader):
// albedo color times albedo texture (times the vertex color when the source material used it),
// lit by toon_light.gdshaderinc. ToonLook copies these from each StandardMaterial3D it replaces.
uniform vec4 albedo : source_color = vec4(1.0f);
uniform sampler2D albedo_texture : source_color, filter_linear_mipmap, repeat_enable;
uniform bool use_vertex_color = false;
uniform vec3 uv1_scale = vec3(1.0f);
uniform vec3 uv1_offset = vec3(0.0f);
#include "res://game/resources/toon_light.gdshaderinc"
void vertex() {
UV = UV * uv1_scale.xy + uv1_offset.xy;
}
void fragment() {
vec3 color = albedo.rgb * texture(albedo_texture, UV).rgb;
if (use_vertex_color) {
color *= COLOR.rgb;
}
ALBEDO = color;
}