Доработка. Показать функциональную схему
This commit is contained in:
17
shaders/two-color.gdshader
Normal file
17
shaders/two-color.gdshader
Normal file
@@ -0,0 +1,17 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec3 grey = vec3(0.14, 0.13, 0.13);
|
||||
uniform vec3 orange = vec3(0.95, 0.55, 0.05);
|
||||
uniform float gamma = 2.0;
|
||||
|
||||
vec3 bw_to_2color(vec3 c, vec3 dark, vec3 light)
|
||||
{
|
||||
float l = pow(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722, gamma);
|
||||
return mix(light, dark, l);
|
||||
}
|
||||
|
||||
|
||||
void fragment()
|
||||
{
|
||||
COLOR.rgb = bw_to_2color(texture(TEXTURE, UV).rgb, grey, orange);
|
||||
}
|
||||
1
shaders/two-color.gdshader.uid
Normal file
1
shaders/two-color.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://83fx15q1xlid
|
||||
Reference in New Issue
Block a user