generated from tecMTST/modelo-godot-3.6
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from tecMTST/intro-pause-shader
Adicionado pause no tempo dos shaders
- Loading branch information
Showing
4 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[gd_resource type="Shader" format=2] | ||
|
||
[resource] | ||
code = "shader_type canvas_item; | ||
|
||
uniform vec4 shine_color : hint_color = vec4(1.0); | ||
uniform float shine_speed : hint_range(0.0, 10.0, 0.1) = 1.0; | ||
uniform float shine_size : hint_range(0.01, 1.0, 0.01) = 0.01; | ||
uniform int enabled : hint_range(0, 1) = 0; | ||
|
||
void fragment() { | ||
COLOR = texture(TEXTURE, UV); | ||
if(enabled == 1){ | ||
float shine = step(1.0 - shine_size * 0.5, 0.5 + 0.5 * sin(UV.x - UV.y + TIME * shine_speed)); | ||
COLOR.rgb = mix(COLOR.rgb, shine_color.rgb, shine * shine_color.a); | ||
} | ||
}" |
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