new outline shader
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
shader_type spatial;
|
||||
uniform sampler2D noise;
|
||||
|
||||
varying float pos_y;
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
pos_y = VERTEX.y;
|
||||
//pos_y = POSITION.y;
|
||||
//POSITION.y = 0.0;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
//ALBEDO = vec3(0.000275,0.0,0.665027);
|
||||
EMISSION = vec3(0.0,0.0,1.0);
|
||||
EMISSION = vec3(0.0,0.0,10.0);
|
||||
if( TIME < 1800.0 ) {
|
||||
ALBEDO = texture(noise,UV + TIME / 5.0).rgb;
|
||||
}
|
||||
else {
|
||||
ALBEDO = texture(noise,UV - TIME).rgb;
|
||||
ALBEDO = texture(noise,UV - TIME / 5.0).rgb;
|
||||
}
|
||||
CLEARCOAT = 5.0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ void vertex() {
|
||||
|
||||
void fragment() {
|
||||
ALBEDO = vec3(1.0,0.0,0.0);
|
||||
EMISSION = vec3(1.0,0.0,0.0);
|
||||
EMISSION = vec3(5.0,0.0,0.0);
|
||||
}
|
||||
|
||||
//void light() {
|
||||
|
||||
@@ -8,8 +8,8 @@ void fragment() {
|
||||
ALBEDO = vec3(0.5,0.5,0.5);
|
||||
METALLIC = 1.0;
|
||||
ROUGHNESS = 0.3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the material.
|
||||
|
||||
25
Shaders/outline.gdshader
Normal file
25
Shaders/outline.gdshader
Normal file
@@ -0,0 +1,25 @@
|
||||
shader_type spatial;
|
||||
render_mode cull_front, unshaded;
|
||||
|
||||
uniform bool is_active;
|
||||
|
||||
const vec3 color = vec3(0.95, 0.71, 0.01);
|
||||
const float thickness = 0.1;
|
||||
|
||||
void vertex() {
|
||||
if(is_active) {
|
||||
VERTEX += NORMAL * thickness;
|
||||
}
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
if (is_active) {
|
||||
ALBEDO = color;
|
||||
ALPHA = 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the material.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
1
Shaders/outline.gdshader.uid
Normal file
1
Shaders/outline.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c08eg1piwoy3t
|
||||
Reference in New Issue
Block a user