-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
108 additions
and
14 deletions.
There are no files selected for viewing
Binary file removed
BIN
-519 KB
addons/discord-rpc-gd/bin/windows/~discord_game_sdk_binding_debug.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Read texture from image | ||
|
||
```glsl | ||
uniform sampler2D TEXTURE; | ||
void freagment() { | ||
vec4 my_texture = texture(TEXTURE, UV); | ||
ALBEDO = my_texture.rgb; | ||
} | ||
``` | ||
|
||
## Retain color in a next pass shader | ||
|
||
```glsl | ||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; | ||
void freagment() { | ||
vec4 currentColor = textureLod(screen_texture, SCREEN_UV, 0.0); | ||
ALBEDO = currentColor.rgb; | ||
} | ||
``` | ||
|
||
## Smoothstep | ||
|
||
https://godotshaders.com/snippet/interpolation/ | ||
https://thebookofshaders.com/glossary/?search=Smoothstep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,47 @@ | ||
shader_type spatial; | ||
render_mode unshaded, cull_front; | ||
render_mode cull_front, unshaded; | ||
|
||
uniform bool enable = false; | ||
// outline costumization | ||
uniform float outline_thickness = 0.05; | ||
uniform vec4 color : source_color = vec4(0.0); | ||
uniform float outline_thickness = 0.11; | ||
uniform vec4 color : source_color = vec4(0., 1., 0., 1.); | ||
|
||
varying vec3 ver; | ||
varying vec3 old_ver; | ||
varying vec3 n; | ||
varying vec4 wrld_vertex; | ||
|
||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; | ||
uniform sampler2D outline_tex; | ||
|
||
void vertex() { | ||
if (enable) { | ||
old_ver = VERTEX; | ||
VERTEX += VERTEX * outline_thickness; | ||
float t = sin(TIME * 12.) / 2. + 1.; | ||
VERTEX += VERTEX * (outline_thickness * t); | ||
ver = VERTEX; | ||
// n = NORMAL; | ||
// wrld_vertex = MODEL_MATRIX * vec4(VERTEX, 1.0); | ||
wrld_vertex = MODEL_MATRIX * vec4(VERTEX, 1.0); | ||
} | ||
} | ||
|
||
void fragment() { | ||
if (enable) { | ||
// ALBEDO = color.rgb; | ||
ALBEDO = vec3(0.); | ||
ALPHA = 0.9; | ||
//ALBEDO = vec3(0.); | ||
//ALPHA = 0.9; | ||
vec4 aaa = texture(outline_tex, UV); | ||
|
||
vec4 currentColor = textureLod(screen_texture, SCREEN_UV, 0.0); | ||
ALBEDO = currentColor.rgb * color.rgb; | ||
//ALBEDO = color.rgb; | ||
//ALBEDO = currentColor.rgb; | ||
//ALPHA = 1. * (1. - wrld_vertex.z); | ||
//ALPHA = currentColor.a; | ||
//do not wru | ||
//ALPHA = .9; | ||
} else { | ||
ALPHA = 0.; | ||
vec4 currentColor = textureLod(screen_texture, SCREEN_UV, 0.0); | ||
ALBEDO = currentColor.rgb; | ||
} | ||
} |