mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 01:25:55 +00:00
Added shaders
This commit is contained in:
parent
45f3e9514d
commit
7414ff51c8
106 changed files with 2642 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
//SHADER GRABED FROM THE BOOK OF SHADERS
|
||||
//PORTED AND MODIFYED TO GODOT BY AHOPNESS (@ahopness)
|
||||
//LICENSE : CC0
|
||||
//SHADERTOY LINK : https://thebookofshaders.com/edit.php#03/space.frag
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
void fragment(){
|
||||
vec2 st = UV;
|
||||
vec4 final = vec4(st.x, st.y, 0.0, 1.0);
|
||||
COLOR = final;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://8as2y65btjp4
|
||||
13
Shaders/GodotRetro/Object Shaders/Debug/helloworld.gdshader
Normal file
13
Shaders/GodotRetro/Object Shaders/Debug/helloworld.gdshader
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//SHADER GRABED FROM THE BOOK OF SHADERS
|
||||
//PORTED AND MODIFYED TO GODOT BY AHOPNESS (@ahopness)
|
||||
//LICENSE : CC0
|
||||
//SHADERTOY LINK : https://thebookofshaders.com/edit.php#03/space.frag
|
||||
|
||||
shader_type spatial;
|
||||
render_mode cull_disabled, specular_disabled, diffuse_lambert;
|
||||
|
||||
void fragment(){
|
||||
vec2 st = UV;
|
||||
vec3 final = vec3(st.x, st.y, 0.0);
|
||||
ALBEDO = final;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://d2ih5u13312pd
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//SHADER GRABED FROM THE BOOK OF SHADERS
|
||||
//PORTED AND MODIFYED TO GODOT BY AHOPNESS (@ahopness)
|
||||
//LICENSE : CC0
|
||||
//SHADERTOY LINK : https://thebookofshaders.com/edit.php#06/hsb-colorwheel.frag
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
const float TWO_PI = 6.28318530718;
|
||||
|
||||
vec3 hsb2rgb( in vec3 c ){
|
||||
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),
|
||||
6.0)-3.0)-1.0,
|
||||
0.0,
|
||||
1.0 );
|
||||
rgb = rgb*rgb*(3.0-2.0*rgb);
|
||||
return c.z * mix( vec3(1.0), rgb, c.y);
|
||||
}
|
||||
|
||||
void fragment(){
|
||||
vec2 st = UV;
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
// Use polar coordinates instead of cartesian
|
||||
vec2 toCenter = vec2(0.5)-st;
|
||||
float angle = atan(toCenter.y,toCenter.x);
|
||||
float radius = length(toCenter)*2.0;
|
||||
|
||||
// Map the angle (-PI to PI) to the Hue (from 0 to 1)
|
||||
// and the Saturation to the radius
|
||||
COLOR = vec4(hsb2rgb(vec3((angle/TWO_PI)+0.5,radius,1.0)), 1);
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://d3a6phlfxob2t
|
||||
34
Shaders/GodotRetro/Object Shaders/Debug/helloworld2.gdshader
Normal file
34
Shaders/GodotRetro/Object Shaders/Debug/helloworld2.gdshader
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//SHADER GRABED FROM THE BOOK OF SHADERS
|
||||
//PORTED AND MODIFYED TO GODOT BY AHOPNESS (@ahopness)
|
||||
//LICENSE : CC0
|
||||
//SHADERTOY LINK : https://thebookofshaders.com/edit.php#06/hsb-colorwheel.frag
|
||||
|
||||
shader_type spatial;
|
||||
render_mode cull_disabled, specular_disabled, diffuse_lambert, unshaded;
|
||||
|
||||
const float TWO_PI = 6.28318530718;
|
||||
|
||||
vec3 hsb2rgb( in vec3 c ){
|
||||
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),
|
||||
6.0)-3.0)-1.0,
|
||||
0.0,
|
||||
1.0 );
|
||||
rgb = rgb*rgb*(3.0-2.0*rgb);
|
||||
return c.z * mix( vec3(1.0), rgb, c.y);
|
||||
}
|
||||
|
||||
void fragment(){
|
||||
vec2 st = UV;
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
// Use polar coordinates instead of cartesian
|
||||
vec2 toCenter = vec2(0.5)-st;
|
||||
float angle = atan(toCenter.y,toCenter.x);
|
||||
float radius = length(toCenter)*2.0;
|
||||
|
||||
// Map the angle (-PI to PI) to the Hue (from 0 to 1)
|
||||
// and the Saturation to the radius
|
||||
color = hsb2rgb(vec3((angle/TWO_PI)+0.5,radius,1.0));
|
||||
|
||||
ALBEDO = color;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://c1jm0ircxs1gf
|
||||
Loading…
Add table
Add a link
Reference in a new issue