first commit
This commit is contained in:
12
GodotRetro/Object Shaders/Debug/helloworld-2d.shader
Executable file
12
GodotRetro/Object Shaders/Debug/helloworld-2d.shader
Executable file
@@ -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;
|
||||
}
|
||||
13
GodotRetro/Object Shaders/Debug/helloworld.shader
Executable file
13
GodotRetro/Object Shaders/Debug/helloworld.shader
Executable 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;
|
||||
}
|
||||
31
GodotRetro/Object Shaders/Debug/helloworld2-2d.shader
Executable file
31
GodotRetro/Object Shaders/Debug/helloworld2-2d.shader
Executable file
@@ -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);
|
||||
}
|
||||
34
GodotRetro/Object Shaders/Debug/helloworld2.shader
Executable file
34
GodotRetro/Object Shaders/Debug/helloworld2.shader
Executable 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,41 @@
|
||||
//SHADER ORIGINALY CREADED BY "marmitoTH" FROM GITHUB
|
||||
//
|
||||
//GITHUB LINK : https://github.com/marmitoTH/godot-psx-shaders
|
||||
|
||||
shader_type spatial;
|
||||
render_mode skip_vertex_transform, cull_disabled, diffuse_lambert_wrap, specular_phong, ambient_light_disabled;
|
||||
|
||||
uniform vec4 color : hint_color;
|
||||
uniform sampler2D albedoTex : hint_albedo;
|
||||
uniform float alpha_scissor_threshold;
|
||||
uniform float specular_intensity : hint_range(0, 1);
|
||||
uniform float resolution = 256;
|
||||
uniform float cull_distance = 5;
|
||||
uniform float affine_texture_mapping_amount : hint_range(0,2);
|
||||
uniform vec2 uv_scale = vec2(1.0, 1.0);
|
||||
uniform vec2 uv_offset = vec2(.0, .0);
|
||||
|
||||
varying vec4 vertex_coordinates;
|
||||
|
||||
void vertex() {
|
||||
UV = UV * uv_scale + uv_offset;
|
||||
|
||||
float vertex_distance = length((MODELVIEW_MATRIX * vec4(VERTEX, 1.0)));
|
||||
|
||||
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
float vPos_w = (PROJECTION_MATRIX * vec4(VERTEX, 1.0)).w;
|
||||
VERTEX.xy = vPos_w * floor(resolution * VERTEX.xy / vPos_w) / resolution;
|
||||
vertex_coordinates = vec4(UV * VERTEX.z, VERTEX.z, .0);
|
||||
|
||||
if (vertex_distance > cull_distance)
|
||||
VERTEX = vec3(.0);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 tex = texture(albedoTex, mix(vertex_coordinates.xy /vertex_coordinates.z, UV.xy, affine_texture_mapping_amount));
|
||||
|
||||
ALBEDO = tex.rgb * color.rgb;
|
||||
SPECULAR = specular_intensity;
|
||||
ALPHA = tex.a;
|
||||
ALPHA_SCISSOR = alpha_scissor_threshold;
|
||||
}
|
||||
55
GodotRetro/Object Shaders/PSX Shaders/Not Working/psx_lit_reflection.shader
Executable file
55
GodotRetro/Object Shaders/PSX Shaders/Not Working/psx_lit_reflection.shader
Executable file
@@ -0,0 +1,55 @@
|
||||
//SHADER ORIGINALY CREADED BY "marmitoTH" FROM GITHUB
|
||||
//
|
||||
//GITHUB LINK : https://github.com/marmitoTH/godot-psx-shaders
|
||||
|
||||
shader_type spatial;
|
||||
render_mode skip_vertex_transform, diffuse_lambert_wrap, specular_phong, ambient_light_disabled;
|
||||
|
||||
uniform vec4 color : hint_color;
|
||||
uniform sampler2D albedoTex : hint_albedo;
|
||||
uniform samplerCube cubemap;
|
||||
uniform float reflection_intensity : hint_range(0, 1);
|
||||
uniform float specular_intensity : hint_range(0, 1);
|
||||
uniform float resolution = 256;
|
||||
uniform float cull_distance = 5;
|
||||
uniform float affine_texture_mapping_amount : hint_range(0,2);
|
||||
uniform vec2 uv_scale = vec2(1.0, 1.0);
|
||||
uniform vec2 uv_offset = vec2(.0, .0);
|
||||
|
||||
varying vec4 vertex_coordinates;
|
||||
varying vec3 reflection_coordinates;
|
||||
|
||||
void vertex() {
|
||||
UV = UV * uv_scale + uv_offset;
|
||||
|
||||
float vertex_distance = length((MODELVIEW_MATRIX * vec4(VERTEX, 1.0)));
|
||||
|
||||
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
float vPos_w = (PROJECTION_MATRIX * vec4(VERTEX, 1.0)).w;
|
||||
VERTEX.xy = vPos_w * floor(resolution * VERTEX.xy / vPos_w) / resolution;
|
||||
vertex_coordinates = vec4(UV * VERTEX.z, VERTEX.z, .0);
|
||||
|
||||
if (vertex_distance > cull_distance)
|
||||
VERTEX = vec3(.0);
|
||||
|
||||
// Get camera position
|
||||
vec4 invcamx = INV_CAMERA_MATRIX[0];
|
||||
vec4 invcamy = INV_CAMERA_MATRIX[1];
|
||||
vec4 invcamz = INV_CAMERA_MATRIX[2];
|
||||
vec4 invcamw = INV_CAMERA_MATRIX[3];
|
||||
|
||||
vec3 camera_position = -invcamw.xyz * mat3(invcamx.xyz, invcamy.xyz, invcamz.xyz);
|
||||
|
||||
// Calculate reflections
|
||||
vec3 vertex_world = (CAMERA_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
reflection_coordinates = reflect(normalize(vertex_world - camera_position), normalize(WORLD_MATRIX * vec4(NORMAL, 0.0)).xyz);
|
||||
reflection_coordinates.z *= -1.0;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 tex = texture(albedoTex, mix(vertex_coordinates.xy /vertex_coordinates.z, UV.xy, affine_texture_mapping_amount));
|
||||
vec4 cube = texture(cubemap, reflection_coordinates);
|
||||
|
||||
ALBEDO = mix(tex.rgb * color.rgb, cube.rgb, reflection_intensity);
|
||||
SPECULAR = specular_intensity;
|
||||
}
|
||||
38
GodotRetro/Object Shaders/PSX Shaders/psx_lit.shader
Executable file
38
GodotRetro/Object Shaders/PSX Shaders/psx_lit.shader
Executable file
@@ -0,0 +1,38 @@
|
||||
//SHADER ORIGINALY CREADED BY "marmitoTH" FROM GITHUB
|
||||
//
|
||||
//GITHUB LINK : https://github.com/marmitoTH/godot-psx-shaders
|
||||
|
||||
shader_type spatial;
|
||||
render_mode skip_vertex_transform, diffuse_lambert_wrap, specular_disabled, cull_disabled, depth_draw_alpha_prepass;
|
||||
|
||||
uniform vec4 color : hint_color;
|
||||
uniform sampler2D albedoTex : hint_albedo;
|
||||
uniform float specular_intensity : hint_range(0, 1);
|
||||
uniform float resolution = 256;
|
||||
uniform float cull_distance = 5;
|
||||
uniform float affine_texture_mapping_amount : hint_range(0,2);
|
||||
uniform vec2 uv_scale = vec2(1.0, 1.0);
|
||||
uniform vec2 uv_offset = vec2(.0, .0);
|
||||
|
||||
varying vec4 vertex_coordinates;
|
||||
|
||||
void vertex() {
|
||||
UV = UV * uv_scale + uv_offset;
|
||||
|
||||
float vertex_distance = length((MODELVIEW_MATRIX * vec4(VERTEX, 1.0)));
|
||||
|
||||
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
float vPos_w = (PROJECTION_MATRIX * vec4(VERTEX, 1.0)).w;
|
||||
VERTEX.xy = vPos_w * floor(resolution * VERTEX.xy / vPos_w) / resolution;
|
||||
vertex_coordinates = vec4(UV * VERTEX.z, VERTEX.z, .0);
|
||||
|
||||
if (vertex_distance > cull_distance)
|
||||
VERTEX = vec3(.0);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 tex = texture(albedoTex, mix(vertex_coordinates.xy /vertex_coordinates.z, UV.xy, affine_texture_mapping_amount));
|
||||
|
||||
ALBEDO = tex.rgb * color.rgb;
|
||||
SPECULAR = specular_intensity;
|
||||
}
|
||||
39
GodotRetro/Object Shaders/PSX Shaders/psx_unlit.shader
Executable file
39
GodotRetro/Object Shaders/PSX Shaders/psx_unlit.shader
Executable file
@@ -0,0 +1,39 @@
|
||||
//SHADER ORIGINALY CREADED BY "marmitoTH" FROM GITHUB
|
||||
//
|
||||
//GITHUB LINK : https://github.com/marmitoTH/godot-psx-shaders
|
||||
|
||||
shader_type spatial;
|
||||
render_mode skip_vertex_transform, diffuse_lambert_wrap, specular_disabled, cull_disabled, unshaded, depth_draw_alpha_prepass;
|
||||
|
||||
uniform vec4 color : hint_color;
|
||||
uniform sampler2D albedoTex : hint_albedo;
|
||||
uniform float specular_intensity : hint_range(0, 1);
|
||||
uniform float resolution = 256;
|
||||
uniform float cull_distance = 5;
|
||||
uniform float affine_texture_mapping_amount : hint_range(0,2);
|
||||
uniform vec2 uv_scale = vec2(1.0, 1.0);
|
||||
uniform vec2 uv_offset = vec2(.0, .0);
|
||||
|
||||
varying vec4 vertex_coordinates;
|
||||
|
||||
void vertex() {
|
||||
UV = UV * uv_scale + uv_offset;
|
||||
|
||||
float vertex_distance = length((MODELVIEW_MATRIX * vec4(VERTEX, 1.0)));
|
||||
|
||||
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
float vPos_w = (PROJECTION_MATRIX * vec4(VERTEX, 1.0)).w;
|
||||
VERTEX.xy = vPos_w * floor(resolution * VERTEX.xy / vPos_w) / resolution;
|
||||
vertex_coordinates = vec4(UV * VERTEX.z, VERTEX.z, .0);
|
||||
|
||||
if (vertex_distance > cull_distance)
|
||||
VERTEX = vec3(.0);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 tex = texture(albedoTex, mix(vertex_coordinates.xy /vertex_coordinates.z, UV.xy, affine_texture_mapping_amount));
|
||||
|
||||
ALBEDO = tex.rgb * color.rgb;
|
||||
ALPHA = tex.a * color.a;
|
||||
SPECULAR = specular_intensity;
|
||||
}
|
||||
Reference in New Issue
Block a user