├── .gitattributes ├── .gitignore ├── .import ├── LOGO.png-6108b2062b34ddfc2b1369087810c04e.stex ├── LOGO.png-d64952310586affc9777048ba72b1a55.stex ├── Player.png-a7ec6b491b51ec277d3e51d4ea333261.stex ├── blinds.png-f636c1eb697ef187d3cc3060691e136a.stex ├── displace.png-4dff082b10727048d4d45dceb0ac20f8.stex ├── displace.png-4e3160889698df09bfa6a9cfbd6ffa2f.stex ├── gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.etc2.stex ├── gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.s3tc.stex ├── gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.stex ├── gradient_conical.png-5b27d13923401396c17f4076b42bbd5b.stex ├── gradient_lr.png-4ba94454cb7a394ed78b01360d24affe.stex ├── grid.png-93ed6e17ea59bb8aca71b79bf1c8b0c7.stex ├── icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex ├── icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex ├── images.png-92d05d86d2155ba4354cae1e03de1e9e.stex ├── images.png-b603883770f213c0c175102e3045df3b.stex ├── norm-b-0001.png-670d92fb8b62ac816ce9ad7f0f3fe7a6.stex ├── rect.png-882c5f598ef3c0ff6ec0d2fdb0fd0a18.stex ├── square.png-03a6d7a416e72c19b2f7cb977484b6e9.stex ├── test.jpg-9749594d239548b4ba73243ea232d489.stex ├── test.jpg-9d4b503311ff240dffffa97afd5b127a.stex ├── test.png-445d7f8d1cba1c76aca7143ccb62e8b6.stex └── theicon.png-5e3251ca5e204db4471b90326440eec7.stex ├── LICENSE ├── Materials ├── bendmat.tres ├── displacemat.tres ├── linesmat.tres └── outline.tres ├── README.md ├── Scenes ├── additive.tscn ├── base.tscn ├── bend.tscn ├── level.tscn ├── outline.tscn └── transition.tscn ├── Scripts ├── outline_setup.gd ├── shader_test.gd ├── transition.gd └── transitioneffect.gd ├── Shaders ├── basic.shader ├── bend.shader ├── displace.shader ├── lines.shader ├── outline.shader └── transition.shader ├── Textures ├── LOGO.png ├── LOGO.png.import ├── Player.png ├── Player.png.import ├── blinds.png ├── blinds.png.import ├── displace.png ├── displace.png.import ├── gradient_bltr.png ├── gradient_bltr.png.import ├── gradient_conical.png ├── gradient_conical.png.import ├── gradient_lr.png ├── gradient_lr.png.import ├── grid.png ├── grid.png.import ├── rect.png ├── rect.png.import ├── square.png ├── square.png.import ├── test.jpg ├── test.jpg.import ├── test.png └── test.png.import ├── icon.png ├── icon.png.import ├── project.godot ├── theicon.png └── theicon.png.import /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /.import/LOGO.png-6108b2062b34ddfc2b1369087810c04e.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/LOGO.png-6108b2062b34ddfc2b1369087810c04e.stex -------------------------------------------------------------------------------- /.import/LOGO.png-d64952310586affc9777048ba72b1a55.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/LOGO.png-d64952310586affc9777048ba72b1a55.stex -------------------------------------------------------------------------------- /.import/Player.png-a7ec6b491b51ec277d3e51d4ea333261.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/Player.png-a7ec6b491b51ec277d3e51d4ea333261.stex -------------------------------------------------------------------------------- /.import/blinds.png-f636c1eb697ef187d3cc3060691e136a.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/blinds.png-f636c1eb697ef187d3cc3060691e136a.stex -------------------------------------------------------------------------------- /.import/displace.png-4dff082b10727048d4d45dceb0ac20f8.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/displace.png-4dff082b10727048d4d45dceb0ac20f8.stex -------------------------------------------------------------------------------- /.import/displace.png-4e3160889698df09bfa6a9cfbd6ffa2f.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/displace.png-4e3160889698df09bfa6a9cfbd6ffa2f.stex -------------------------------------------------------------------------------- /.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.etc2.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.etc2.stex -------------------------------------------------------------------------------- /.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.s3tc.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.s3tc.stex -------------------------------------------------------------------------------- /.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.stex -------------------------------------------------------------------------------- /.import/gradient_conical.png-5b27d13923401396c17f4076b42bbd5b.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/gradient_conical.png-5b27d13923401396c17f4076b42bbd5b.stex -------------------------------------------------------------------------------- /.import/gradient_lr.png-4ba94454cb7a394ed78b01360d24affe.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/gradient_lr.png-4ba94454cb7a394ed78b01360d24affe.stex -------------------------------------------------------------------------------- /.import/grid.png-93ed6e17ea59bb8aca71b79bf1c8b0c7.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/grid.png-93ed6e17ea59bb8aca71b79bf1c8b0c7.stex -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /.import/images.png-92d05d86d2155ba4354cae1e03de1e9e.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/images.png-92d05d86d2155ba4354cae1e03de1e9e.stex -------------------------------------------------------------------------------- /.import/images.png-b603883770f213c0c175102e3045df3b.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/images.png-b603883770f213c0c175102e3045df3b.stex -------------------------------------------------------------------------------- /.import/norm-b-0001.png-670d92fb8b62ac816ce9ad7f0f3fe7a6.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/norm-b-0001.png-670d92fb8b62ac816ce9ad7f0f3fe7a6.stex -------------------------------------------------------------------------------- /.import/rect.png-882c5f598ef3c0ff6ec0d2fdb0fd0a18.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/rect.png-882c5f598ef3c0ff6ec0d2fdb0fd0a18.stex -------------------------------------------------------------------------------- /.import/square.png-03a6d7a416e72c19b2f7cb977484b6e9.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/square.png-03a6d7a416e72c19b2f7cb977484b6e9.stex -------------------------------------------------------------------------------- /.import/test.jpg-9749594d239548b4ba73243ea232d489.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/test.jpg-9749594d239548b4ba73243ea232d489.stex -------------------------------------------------------------------------------- /.import/test.jpg-9d4b503311ff240dffffa97afd5b127a.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/test.jpg-9d4b503311ff240dffffa97afd5b127a.stex -------------------------------------------------------------------------------- /.import/test.png-445d7f8d1cba1c76aca7143ccb62e8b6.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/test.png-445d7f8d1cba1c76aca7143ccb62e8b6.stex -------------------------------------------------------------------------------- /.import/theicon.png-5e3251ca5e204db4471b90326440eec7.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/.import/theicon.png-5e3251ca5e204db4471b90326440eec7.stex -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Swarnim Arun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Materials/bendmat.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Shaders/bend.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | 7 | render_priority = 0 8 | shader = ExtResource( 1 ) 9 | shader_param/factor = 1.203 10 | _sections_unfolded = [ "shader_param" ] 11 | 12 | -------------------------------------------------------------------------------- /Materials/displacemat.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Textures/test.jpg" type="Texture" id=1] 4 | 5 | [sub_resource type="Shader" id=1] 6 | 7 | code = "shader_type canvas_item; 8 | render_mode unshaded; 9 | 10 | uniform sampler2D displace : hint_albedo; 11 | uniform float dispAmt: hint_range(0,0.1); 12 | uniform float abberationAmtX: hint_range(0,0.1); 13 | uniform float abberationAmtY: hint_range(0,0.1); 14 | uniform float dispSize: hint_range(0.1, 2.0); 15 | uniform float maxAlpha : hint_range(0.1,1.0); 16 | 17 | void fragment() 18 | { 19 | //displace effect 20 | vec4 disp = texture(displace, SCREEN_UV * dispSize); 21 | vec2 newUV = SCREEN_UV + disp.xy * dispAmt; 22 | //abberation 23 | COLOR.r = texture(SCREEN_TEXTURE, newUV - vec2(abberationAmtX,abberationAmtY)).r; 24 | COLOR.g = texture(SCREEN_TEXTURE, newUV).g; 25 | COLOR.b = texture(SCREEN_TEXTURE, newUV + vec2(abberationAmtX,abberationAmtY)).b; 26 | COLOR.a = texture(SCREEN_TEXTURE, newUV).a * maxAlpha; 27 | }" 28 | 29 | [resource] 30 | 31 | render_priority = 0 32 | shader = SubResource( 1 ) 33 | shader_param/dispAmt = 0.005 34 | shader_param/abberationAmtX = 0.005 35 | shader_param/abberationAmtY = 0.006 36 | shader_param/dispSize = 0.332 37 | shader_param/maxAlpha = 1.0 38 | shader_param/displace = ExtResource( 1 ) 39 | _sections_unfolded = [ "shader_param" ] 40 | 41 | -------------------------------------------------------------------------------- /Materials/linesmat.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Textures/blinds.png" type="Texture" id=1] 4 | 5 | [sub_resource type="Shader" id=1] 6 | 7 | code = "shader_type canvas_item; 8 | render_mode unshaded; 9 | 10 | uniform sampler2D screen : hint_albedo; 11 | uniform float brightness: hint_range(0,0.1); 12 | uniform float size: hint_range(0.1,2.0); 13 | 14 | void fragment() 15 | { 16 | COLOR = texture(SCREEN_TEXTURE, SCREEN_UV); 17 | COLOR.rgb += texture(screen, SCREEN_UV * size).rgb * brightness; 18 | }" 19 | 20 | [resource] 21 | 22 | render_priority = 0 23 | shader = SubResource( 1 ) 24 | shader_param/brightness = 0.034 25 | shader_param/size = 1.942 26 | shader_param/screen = ExtResource( 1 ) 27 | _sections_unfolded = [ "shader_param" ] 28 | 29 | -------------------------------------------------------------------------------- /Materials/outline.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Shaders/outline.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | 7 | render_priority = 0 8 | shader = ExtResource( 1 ) 9 | shader_param/intensity = 37 10 | shader_param/precision = 0.015 11 | shader_param/outline_color = null 12 | _sections_unfolded = [ "shader_param" ] 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # godot-shader-tutorials 2 | Basic godot shader tutorial projects from my youtube tutorials.**(to be updated)** 3 | 4 | Date Updated: 27-04-2019 5 | 6 | Update 7 | -- 8 | _The code in the repo is not production ready(in master branch)._ 9 | 10 | > *This does not mean they aren't performant, just that we need to make them faster or add customizability by simplifying them. * 11 | 12 | The current master branch will soon be replaced by new dev branch(which is where the new shader code will be for now) 13 | 14 | TODO 15 | -- 16 | - Create new more performant,complex and ready to use shaders. 17 | - Add VisualShader examples. 18 | - Add documented tutorials for each shader to be created. (Not necessarily Video) 19 | -------------------------------------------------------------------------------- /Scenes/additive.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [sub_resource type="CubeMesh" id=1] 4 | 5 | size = Vector3( 2, 2, 2 ) 6 | subdivide_width = 0 7 | subdivide_height = 0 8 | subdivide_depth = 0 9 | 10 | [sub_resource type="Shader" id=2] 11 | 12 | code = "shader_type spatial; 13 | render_mode unshaded, blend_add; 14 | 15 | uniform vec4 color: hint_color; 16 | 17 | void vertex() 18 | { 19 | COLOR = color; 20 | } 21 | 22 | void fragment() 23 | { 24 | ALBEDO = COLOR.xyz; 25 | }" 26 | 27 | [sub_resource type="ShaderMaterial" id=3] 28 | 29 | render_priority = 0 30 | shader = SubResource( 2 ) 31 | shader_param/color = Color( 0.609375, 0.609375, 0.609375, 1 ) 32 | _sections_unfolded = [ "shader_param" ] 33 | 34 | [node name="Spatial" type="Spatial" index="0"] 35 | 36 | [node name="cube" type="MeshInstance" parent="." index="0"] 37 | 38 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.712559, -1.52225 ) 39 | layers = 1 40 | material_override = null 41 | cast_shadow = 1 42 | extra_cull_margin = 0.0 43 | use_in_baked_light = false 44 | lod_min_distance = 0.0 45 | lod_min_hysteresis = 0.0 46 | lod_max_distance = 0.0 47 | lod_max_hysteresis = 0.0 48 | mesh = SubResource( 1 ) 49 | skeleton = NodePath("..") 50 | material/0 = SubResource( 3 ) 51 | _sections_unfolded = [ "material" ] 52 | 53 | [node name="cube2" type="MeshInstance" parent="." index="1"] 54 | 55 | layers = 1 56 | material_override = null 57 | cast_shadow = 1 58 | extra_cull_margin = 0.0 59 | use_in_baked_light = false 60 | lod_min_distance = 0.0 61 | lod_min_hysteresis = 0.0 62 | lod_max_distance = 0.0 63 | lod_max_hysteresis = 0.0 64 | mesh = SubResource( 1 ) 65 | skeleton = NodePath("..") 66 | material/0 = SubResource( 3 ) 67 | _sections_unfolded = [ "material" ] 68 | 69 | [node name="cube3" type="MeshInstance" parent="." index="2"] 70 | 71 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.931039, 1.64275 ) 72 | layers = 1 73 | material_override = null 74 | cast_shadow = 1 75 | extra_cull_margin = 0.0 76 | use_in_baked_light = false 77 | lod_min_distance = 0.0 78 | lod_min_hysteresis = 0.0 79 | lod_max_distance = 0.0 80 | lod_max_hysteresis = 0.0 81 | mesh = SubResource( 1 ) 82 | skeleton = NodePath("..") 83 | material/0 = SubResource( 3 ) 84 | _sections_unfolded = [ "material" ] 85 | 86 | 87 | -------------------------------------------------------------------------------- /Scenes/base.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://Textures/LOGO.png" type="Texture" id=1] 4 | [ext_resource path="res://Materials/displacemat.tres" type="Material" id=2] 5 | [ext_resource path="res://icon.png" type="Texture" id=3] 6 | [ext_resource path="res://Materials/linesmat.tres" type="Material" id=4] 7 | 8 | [node name="base" type="Control" index="0"] 9 | 10 | anchor_left = 0.0 11 | anchor_top = 0.0 12 | anchor_right = 1.0 13 | anchor_bottom = 1.0 14 | rect_pivot_offset = Vector2( 0, 0 ) 15 | rect_clip_content = false 16 | mouse_filter = 0 17 | mouse_default_cursor_shape = 0 18 | size_flags_horizontal = 1 19 | size_flags_vertical = 1 20 | __meta__ = { 21 | "_edit_lock_": true 22 | } 23 | 24 | [node name="Sprite" type="Sprite" parent="." index="0"] 25 | 26 | position = Vector2( 510.739, 273.786 ) 27 | texture = ExtResource( 1 ) 28 | 29 | [node name="displace" type="ColorRect" parent="." index="1"] 30 | 31 | material = ExtResource( 2 ) 32 | anchor_left = 0.0 33 | anchor_top = 0.0 34 | anchor_right = 1.0 35 | anchor_bottom = 1.0 36 | rect_pivot_offset = Vector2( 0, 0 ) 37 | rect_clip_content = false 38 | mouse_filter = 0 39 | mouse_default_cursor_shape = 0 40 | size_flags_horizontal = 1 41 | size_flags_vertical = 1 42 | color = Color( 1, 1, 1, 1 ) 43 | _sections_unfolded = [ "Material" ] 44 | __meta__ = { 45 | "_edit_lock_": true 46 | } 47 | 48 | [node name="icon" type="Sprite" parent="." index="2"] 49 | 50 | position = Vector2( 550.587, 91.7941 ) 51 | scale = Vector2( 3.33717, 2.12559 ) 52 | texture = ExtResource( 3 ) 53 | 54 | [node name="BackBufferCopy" type="BackBufferCopy" parent="." index="3"] 55 | 56 | position = Vector2( 503.62, 327.761 ) 57 | scale = Vector2( 6.0362, 4.20334 ) 58 | copy_mode = 2 59 | rect = Rect2( -100, -100, 200, 200 ) 60 | __meta__ = { 61 | "_edit_lock_": true 62 | } 63 | 64 | [node name="node" type="Node" parent="BackBufferCopy" index="0"] 65 | 66 | [node name="lines" type="ColorRect" parent="BackBufferCopy/node" index="0"] 67 | 68 | material = ExtResource( 4 ) 69 | anchor_left = 0.0 70 | anchor_top = 0.0 71 | anchor_right = 1.0 72 | anchor_bottom = 1.0 73 | margin_left = -3.42081 74 | margin_top = -0.0995483 75 | margin_right = -3.42078 76 | margin_bottom = -0.0995483 77 | rect_pivot_offset = Vector2( 0, 0 ) 78 | rect_clip_content = false 79 | mouse_filter = 0 80 | mouse_default_cursor_shape = 0 81 | size_flags_horizontal = 1 82 | size_flags_vertical = 1 83 | color = Color( 1, 1, 1, 1 ) 84 | _sections_unfolded = [ "Material" ] 85 | __meta__ = { 86 | "_edit_lock_": true 87 | } 88 | 89 | 90 | -------------------------------------------------------------------------------- /Scenes/bend.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Textures/grid.png" type="Texture" id=1] 4 | [ext_resource path="res://Materials/bendmat.tres" type="Material" id=2] 5 | 6 | [node name="bend" type="Node" index="0"] 7 | 8 | [node name="grid" type="Sprite" parent="." index="0"] 9 | 10 | position = Vector2( 511.262, 302.522 ) 11 | scale = Vector2( 1.01861, 0.73704 ) 12 | texture = ExtResource( 1 ) 13 | _sections_unfolded = [ "Transform" ] 14 | 15 | [node name="effect" type="ColorRect" parent="." index="1"] 16 | 17 | material = ExtResource( 2 ) 18 | anchor_left = 0.0 19 | anchor_top = 0.0 20 | anchor_right = 1.0 21 | anchor_bottom = 1.0 22 | rect_pivot_offset = Vector2( 0, 0 ) 23 | rect_clip_content = false 24 | mouse_filter = 0 25 | mouse_default_cursor_shape = 0 26 | size_flags_horizontal = 1 27 | size_flags_vertical = 1 28 | color = Color( 1, 1, 1, 1 ) 29 | _sections_unfolded = [ "Material" ] 30 | __meta__ = { 31 | "_edit_lock_": true 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Scenes/level.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=19 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://Scripts/shader_test.gd" type="Script" id=2] 5 | [ext_resource path="res://Shaders/basic.shader" type="Shader" id=3] 6 | 7 | [sub_resource type="Shader" id=1] 8 | 9 | code = "shader_type canvas_item; 10 | render_mode unshaded; 11 | 12 | uniform vec4 color : hint_color; 13 | 14 | void fragment() 15 | { 16 | COLOR = color; 17 | //COLOR.abrg = texture(TEXTURE , UV); 18 | //COLOR.gr = vec2(1.0); 19 | }" 20 | 21 | [sub_resource type="ShaderMaterial" id=2] 22 | 23 | render_priority = 0 24 | shader = SubResource( 1 ) 25 | shader_param/color = Color( 0.589844, 0.322571, 0.322571, 1 ) 26 | _sections_unfolded = [ "shader_param" ] 27 | 28 | [sub_resource type="Shader" id=3] 29 | 30 | code = "shader_type canvas_item; 31 | render_mode unshaded; 32 | 33 | void fragment() 34 | { 35 | COLOR = vec4(1.0); 36 | }" 37 | 38 | [sub_resource type="ShaderMaterial" id=4] 39 | 40 | render_priority = 0 41 | shader = SubResource( 3 ) 42 | _sections_unfolded = [ "shader_param" ] 43 | 44 | [sub_resource type="Shader" id=5] 45 | 46 | code = "shader_type canvas_item; 47 | render_mode unshaded; 48 | 49 | //uniform vec4 color : hint_color; 50 | 51 | void fragment() 52 | { 53 | COLOR.xy = UV; 54 | COLOR.z = 0.0; 55 | }" 56 | 57 | [sub_resource type="ShaderMaterial" id=6] 58 | 59 | render_priority = 0 60 | shader = SubResource( 5 ) 61 | _sections_unfolded = [ "shader_param" ] 62 | 63 | [sub_resource type="Shader" id=7] 64 | 65 | code = "shader_type canvas_item; 66 | render_mode unshaded; 67 | 68 | //uniform vec4 color : hint_color; 69 | 70 | void fragment() 71 | { 72 | COLOR = texture(TEXTURE , UV); 73 | COLOR.xy += UV; 74 | }" 75 | 76 | [sub_resource type="ShaderMaterial" id=8] 77 | 78 | render_priority = 0 79 | shader = SubResource( 7 ) 80 | _sections_unfolded = [ "shader_param" ] 81 | 82 | [sub_resource type="ShaderMaterial" id=9] 83 | 84 | render_priority = 0 85 | shader = ExtResource( 3 ) 86 | shader_param/color = Color( 0, 0, 0, 1 ) 87 | _sections_unfolded = [ "shader_param" ] 88 | 89 | [sub_resource type="Shader" id=10] 90 | 91 | code = "shader_type canvas_item; 92 | render_mode unshaded; 93 | 94 | uniform vec4 color : hint_color; 95 | 96 | void fragment() 97 | { 98 | COLOR.rgba = texture(TEXTURE , UV); 99 | COLOR.xyz += color.xyz; 100 | }" 101 | 102 | [sub_resource type="ShaderMaterial" id=11] 103 | 104 | render_priority = 0 105 | shader = SubResource( 10 ) 106 | shader_param/color = Color( 0, 0.102539, 0.65625, 1 ) 107 | _sections_unfolded = [ "shader_param" ] 108 | 109 | [sub_resource type="Shader" id=12] 110 | 111 | code = "shader_type canvas_item; 112 | render_mode unshaded; 113 | 114 | //uniform vec4 color : hint_color; 115 | 116 | void fragment() 117 | { 118 | //COLOR = texture(TEXTURE , UV); 119 | COLOR.xy = UV; 120 | //COLOR.gr = vec2(1.0); 121 | }" 122 | 123 | [sub_resource type="ShaderMaterial" id=13] 124 | 125 | render_priority = 0 126 | shader = SubResource( 12 ) 127 | _sections_unfolded = [ "shader_param" ] 128 | 129 | [sub_resource type="Shader" id=14] 130 | 131 | code = "shader_type canvas_item; 132 | render_mode unshaded; 133 | 134 | //uniform vec4 color : hint_color; 135 | 136 | void fragment() 137 | { 138 | //COLOR = color; 139 | COLOR = texture(TEXTURE , UV); 140 | //COLOR.gr = vec2(1.0); 141 | }" 142 | 143 | [sub_resource type="ShaderMaterial" id=15] 144 | 145 | render_priority = 0 146 | shader = SubResource( 14 ) 147 | _sections_unfolded = [ "shader_param" ] 148 | 149 | [node name="level" type="Node2D" index="0"] 150 | 151 | [node name="icon" type="Sprite" parent="." index="0"] 152 | 153 | material = SubResource( 2 ) 154 | position = Vector2( 345.036, 83.5159 ) 155 | texture = ExtResource( 1 ) 156 | script = ExtResource( 2 ) 157 | _sections_unfolded = [ "Material" ] 158 | 159 | [node name="icon4" type="Sprite" parent="." index="1"] 160 | 161 | material = SubResource( 4 ) 162 | position = Vector2( 249.933, 85.6773 ) 163 | texture = ExtResource( 1 ) 164 | script = ExtResource( 2 ) 165 | _sections_unfolded = [ "Material" ] 166 | 167 | [node name="icon5" type="Sprite" parent="." index="2"] 168 | 169 | material = SubResource( 6 ) 170 | position = Vector2( 535.663, 85.8286 ) 171 | texture = ExtResource( 1 ) 172 | script = ExtResource( 2 ) 173 | _sections_unfolded = [ "Material" ] 174 | 175 | [node name="icon6" type="Sprite" parent="." index="3"] 176 | 177 | material = SubResource( 8 ) 178 | position = Vector2( 347.197, 184.563 ) 179 | texture = ExtResource( 1 ) 180 | script = ExtResource( 2 ) 181 | _sections_unfolded = [ "Material" ] 182 | 183 | [node name="icon7" type="Sprite" parent="." index="4"] 184 | 185 | material = SubResource( 9 ) 186 | position = Vector2( 446.083, 185.104 ) 187 | texture = ExtResource( 1 ) 188 | script = ExtResource( 2 ) 189 | _sections_unfolded = [ "Material" ] 190 | 191 | [node name="icon8" type="Sprite" parent="." index="5"] 192 | 193 | material = SubResource( 11 ) 194 | position = Vector2( 535.783, 184.023 ) 195 | texture = ExtResource( 1 ) 196 | script = ExtResource( 2 ) 197 | _sections_unfolded = [ "Material" ] 198 | 199 | [node name="icon2" type="Sprite" parent="." index="6"] 200 | 201 | material = SubResource( 13 ) 202 | position = Vector2( 442.841, 85.6773 ) 203 | texture = ExtResource( 1 ) 204 | script = ExtResource( 2 ) 205 | _sections_unfolded = [ "Material" ] 206 | 207 | [node name="icon3" type="Sprite" parent="." index="7"] 208 | 209 | material = SubResource( 15 ) 210 | position = Vector2( 252.042, 186.033 ) 211 | texture = ExtResource( 1 ) 212 | script = ExtResource( 2 ) 213 | _sections_unfolded = [ "Material" ] 214 | 215 | 216 | -------------------------------------------------------------------------------- /Scenes/outline.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://Textures/Player.png" type="Texture" id=1] 4 | [ext_resource path="res://Textures/rect.png" type="Texture" id=2] 5 | [ext_resource path="res://Shaders/outline.shader" type="Shader" id=3] 6 | [ext_resource path="res://Textures/test.png" type="Texture" id=4] 7 | 8 | [sub_resource type="ShaderMaterial" id=2] 9 | 10 | render_priority = 0 11 | shader = ExtResource( 3 ) 12 | shader_param/intensity = 130 13 | shader_param/precision = 0.015 14 | shader_param/outline_color = null 15 | _sections_unfolded = [ "shader_param" ] 16 | 17 | [sub_resource type="ShaderMaterial" id=3] 18 | 19 | render_priority = 0 20 | shader = ExtResource( 3 ) 21 | shader_param/intensity = 200 22 | shader_param/precision = 0.02 23 | shader_param/outline_color = Color( 0.152344, 0.0160675, 0.0160675, 1 ) 24 | _sections_unfolded = [ "shader_param" ] 25 | 26 | [sub_resource type="ViewportTexture" id=4] 27 | 28 | resource_local_to_scene = true 29 | flags = 0 30 | viewport_path = NodePath("Viewport") 31 | 32 | [node name="outline" type="Node2D" index="0"] 33 | 34 | [node name="Viewport" type="Viewport" parent="." index="0"] 35 | 36 | arvr = false 37 | size = Vector2( 600, 600 ) 38 | own_world = false 39 | world = null 40 | transparent_bg = true 41 | msaa = 0 42 | hdr = false 43 | disable_3d = false 44 | usage = 1 45 | debug_draw = 0 46 | render_target_v_flip = true 47 | render_target_clear_mode = 0 48 | render_target_update_mode = 3 49 | audio_listener_enable_2d = false 50 | audio_listener_enable_3d = false 51 | physics_object_picking = false 52 | gui_disable_input = false 53 | gui_snap_controls_to_pixels = true 54 | shadow_atlas_size = 0 55 | shadow_atlas_quad_0 = 2 56 | shadow_atlas_quad_1 = 2 57 | shadow_atlas_quad_2 = 3 58 | shadow_atlas_quad_3 = 4 59 | _sections_unfolded = [ "Render Target" ] 60 | 61 | [node name="Player" type="Sprite" parent="Viewport" index="0"] 62 | 63 | position = Vector2( 250, 250 ) 64 | scale = Vector2( 4, 4 ) 65 | texture = ExtResource( 1 ) 66 | _sections_unfolded = [ "Material", "Transform" ] 67 | 68 | [node name="see_on_startup" type="Sprite" parent="Viewport" index="1"] 69 | 70 | position = Vector2( 250, 360 ) 71 | scale = Vector2( 8, 8 ) 72 | texture = ExtResource( 2 ) 73 | _sections_unfolded = [ "Material", "Transform" ] 74 | 75 | [node name="play the game" type="Sprite" parent="." index="1"] 76 | 77 | material = SubResource( 2 ) 78 | position = Vector2( 744.44, 282.529 ) 79 | scale = Vector2( 4, 4 ) 80 | texture = ExtResource( 4 ) 81 | _sections_unfolded = [ "Material" ] 82 | 83 | [node name="antialiased square2" type="Sprite" parent="." index="2"] 84 | 85 | material = SubResource( 3 ) 86 | position = Vector2( 530.16, 426.694 ) 87 | texture = SubResource( 4 ) 88 | _sections_unfolded = [ "Material", "Transform" ] 89 | 90 | 91 | -------------------------------------------------------------------------------- /Scenes/transition.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Scripts/transition.gd" type="Script" id=1] 4 | [ext_resource path="res://icon.png" type="Texture" id=2] 5 | [ext_resource path="res://Shaders/transition.shader" type="Shader" id=3] 6 | [ext_resource path="res://Textures/gradient_bltr.png" type="Texture" id=4] 7 | [ext_resource path="res://Scripts/transitioneffect.gd" type="Script" id=5] 8 | 9 | [sub_resource type="ShaderMaterial" id=2] 10 | 11 | render_priority = 0 12 | shader = ExtResource( 3 ) 13 | shader_param/cutoff = 0.453 14 | shader_param/filter = ExtResource( 4 ) 15 | _sections_unfolded = [ "shader_param" ] 16 | 17 | [node name="transition" type="Node" index="0"] 18 | 19 | script = ExtResource( 1 ) 20 | 21 | [node name="icon" type="Sprite" parent="." index="0"] 22 | 23 | position = Vector2( 260.778, 151.534 ) 24 | scale = Vector2( 2.06205, 1.88454 ) 25 | texture = ExtResource( 2 ) 26 | 27 | [node name="icon2" type="Sprite" parent="." index="1"] 28 | 29 | position = Vector2( 536.676, 191.633 ) 30 | rotation = 1.00981 31 | scale = Vector2( 2.34882, 2.18586 ) 32 | texture = ExtResource( 2 ) 33 | 34 | [node name="icon3" type="Sprite" parent="." index="2"] 35 | 36 | position = Vector2( 773.935, 361.831 ) 37 | rotation = 2.12434 38 | scale = Vector2( 3.26381, 2.95452 ) 39 | texture = ExtResource( 2 ) 40 | 41 | [node name="effect" type="ColorRect" parent="." index="3"] 42 | 43 | material = SubResource( 2 ) 44 | anchor_left = 0.0 45 | anchor_top = 0.0 46 | anchor_right = 1.0 47 | anchor_bottom = 1.0 48 | rect_pivot_offset = Vector2( 0, 0 ) 49 | rect_clip_content = false 50 | mouse_filter = 0 51 | mouse_default_cursor_shape = 0 52 | size_flags_horizontal = 1 53 | size_flags_vertical = 1 54 | color = Color( 1, 1, 1, 1 ) 55 | script = ExtResource( 5 ) 56 | _sections_unfolded = [ "Material" ] 57 | __meta__ = { 58 | "_edit_lock_": true 59 | } 60 | 61 | [node name="tween" type="Tween" parent="." index="4"] 62 | 63 | repeat = false 64 | playback_process_mode = 1 65 | playback_speed = 1.0 66 | playback/active = false 67 | playback/repeat = false 68 | playback/speed = 1.0 69 | 70 | 71 | -------------------------------------------------------------------------------- /Scripts/outline_setup.gd: -------------------------------------------------------------------------------- 1 | extends Sprite 2 | 3 | func _ready(): 4 | var size = texture.get_data().get_size() 5 | #print(size) 6 | self.material.set_shader_param("sizex", size.x) 7 | self.material.set_shader_param("sizey", size.y) 8 | 9 | -------------------------------------------------------------------------------- /Scripts/shader_test.gd: -------------------------------------------------------------------------------- 1 | extends Sprite 2 | 3 | # class member variables go here, for example: 4 | # var a = 2 5 | # var b = "textvar" 6 | 7 | func _ready(): 8 | self.material.set("shader_param/color", Color(0.5,0.5,1.0,1.0)) 9 | pass 10 | 11 | #func _process(delta): 12 | # # Called every frame. Delta is time since last frame. 13 | # # Update game logic here. 14 | # pass 15 | -------------------------------------------------------------------------------- /Scripts/transition.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | func _ready(): 4 | $tween.interpolate_property($"effect", "cutoff", 0.0, 1.0, 2.0, Tween.TRANS_QUINT, Tween.EASE_IN_OUT) 5 | $tween.start() -------------------------------------------------------------------------------- /Scripts/transitioneffect.gd: -------------------------------------------------------------------------------- 1 | extends ColorRect 2 | 3 | var cutoff = 0.0 4 | 5 | func _process(delta): 6 | material.set("shader_param/cutoff", cutoff) -------------------------------------------------------------------------------- /Shaders/basic.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform vec4 color : hint_color; 5 | 6 | void fragment() 7 | { 8 | //COLOR = color; 9 | COLOR.abrg = texture(TEXTURE , UV); 10 | //COLOR.gr = vec2(1.0); 11 | } -------------------------------------------------------------------------------- /Shaders/bend.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform float factor: hint_range(0.1,1.3); 5 | 6 | void fragment() 7 | { 8 | vec2 uv = SCREEN_UV; 9 | COLOR = texture(SCREEN_TEXTURE, vec2(uv.x, abs(uv.y - 0.5) * ((0.5 - abs(uv.x - 0.5)) + factor))); 10 | } -------------------------------------------------------------------------------- /Shaders/displace.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform sampler2D displace : hint_albedo; 5 | uniform float dispAmt: hint_range(0,0.1); 6 | uniform float abberationAmtX: hint_range(0,0.1); 7 | uniform float abberationAmtY: hint_range(0,0.1); 8 | uniform float dispSize: hint_range(0.1, 2.0); 9 | uniform float maxAlpha : hint_range(0.1,1.0); 10 | 11 | void fragment() 12 | { 13 | //displace effect 14 | vec4 disp = texture(displace, SCREEN_UV * dispSize); 15 | vec2 newUV = SCREEN_UV + disp.xy * dispAmt; 16 | //abberation 17 | COLOR.r = texture(SCREEN_TEXTURE, newUV - vec2(abberationAmtX,abberationAmtY)).r; 18 | COLOR.g = texture(SCREEN_TEXTURE, newUV).g; 19 | COLOR.b = texture(SCREEN_TEXTURE, newUV + vec2(abberationAmtX,abberationAmtY)).b; 20 | COLOR.a = texture(SCREEN_TEXTURE, newUV).a * maxAlpha; 21 | } -------------------------------------------------------------------------------- /Shaders/lines.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform sampler2D screen : hint_albedo; 5 | uniform float brightness: hint_range(0,0.1); 6 | uniform float size: hint_range(0.1,2.0); 7 | 8 | void fragment() 9 | { 10 | COLOR = texture(SCREEN_TEXTURE, SCREEN_UV); 11 | COLOR.rgb += texture(screen, SCREEN_UV * size).rgb * brightness; 12 | } -------------------------------------------------------------------------------- /Shaders/outline.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform int intensity : hint_range(0,200); 5 | uniform float precision : hint_range(0,0.02); 6 | uniform vec4 outline_color : hint_color; 7 | 8 | varying vec2 o; 9 | varying vec2 f; 10 | 11 | void vertex() 12 | { 13 | o = VERTEX; 14 | vec2 uv = (UV - 0.5); 15 | VERTEX += uv * float(intensity); 16 | f = VERTEX; 17 | } 18 | 19 | void fragment() 20 | { 21 | ivec2 t = textureSize(TEXTURE, 0); 22 | vec2 regular_uv; 23 | regular_uv.x = UV.x + (f.x - o.x)/float(t.x); 24 | regular_uv.y = UV.y + (f.y - o.y)/float(t.y); 25 | 26 | vec4 regular_color = texture(TEXTURE, regular_uv); 27 | if((regular_uv.x < 0.0 || regular_uv.x > 1.0) || (regular_uv.y < 0.0 || regular_uv.y > 1.0) || regular_color.a <=0.25){ 28 | regular_color = vec4(0.0); 29 | } 30 | 31 | vec2 ps = TEXTURE_PIXEL_SIZE * float(intensity) * precision; 32 | 33 | vec4 final_color = regular_color; 34 | if (regular_color.a <= 0.0) 35 | { 36 | for(int x = -1; x <= 1; x += 1){ 37 | for(int y = -1; y <= 1; y += 1){ 38 | //Get the X and Y offset from this 39 | if (x==0 && y==0) 40 | continue; 41 | 42 | vec2 outline_uv = regular_uv + vec2(float(x) * ps.x, float(y) * ps.y); 43 | 44 | //Sample here, if we are out of bounds then fail 45 | vec4 outline_sample = texture(TEXTURE, outline_uv); 46 | if((outline_uv.x < 0.0 || outline_uv.x > 1.0) || (outline_uv.y < 0.0 || outline_uv.y > 1.0)){ 47 | //We aren't a real color 48 | outline_sample = vec4(0); 49 | } 50 | 51 | //Is our sample empty? Is there something nearby? 52 | if(outline_sample.a > final_color.a){ 53 | final_color = outline_color; 54 | } 55 | } 56 | } 57 | } 58 | COLOR = final_color; 59 | } -------------------------------------------------------------------------------- /Shaders/transition.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode unshaded; 3 | 4 | uniform float cutoff : hint_range(0,1.0); 5 | uniform sampler2D filter : hint_albedo; 6 | 7 | void fragment() 8 | { 9 | COLOR = texture(SCREEN_TEXTURE, SCREEN_UV); 10 | vec4 tex = texture(filter, SCREEN_UV); 11 | if (tex.r < cutoff || cutoff > 0.999) 12 | { 13 | COLOR.rgb = vec3(0.0); 14 | } 15 | } -------------------------------------------------------------------------------- /Textures/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/LOGO.png -------------------------------------------------------------------------------- /Textures/LOGO.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/LOGO.png-6108b2062b34ddfc2b1369087810c04e.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/LOGO.png" 10 | source_md5="4523e0383718dc4210d6cb1a99374a48" 11 | 12 | dest_files=[ "res://.import/LOGO.png-6108b2062b34ddfc2b1369087810c04e.stex" ] 13 | dest_md5="31e875e93906411e0ca08e4ad7c351f7" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/Player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/Player.png -------------------------------------------------------------------------------- /Textures/Player.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Player.png-a7ec6b491b51ec277d3e51d4ea333261.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/Player.png" 10 | source_md5="fef8338b237e417cd7bedef15697f8d4" 11 | 12 | dest_files=[ "res://.import/Player.png-a7ec6b491b51ec277d3e51d4ea333261.stex" ] 13 | dest_md5="53cc4c0976f47c502b0c71810420b972" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=false 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/blinds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/blinds.png -------------------------------------------------------------------------------- /Textures/blinds.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/blinds.png-f636c1eb697ef187d3cc3060691e136a.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/blinds.png" 10 | source_md5="20eef34a169e4c0616eb3a5b1d43b37a" 11 | 12 | dest_files=[ "res://.import/blinds.png-f636c1eb697ef187d3cc3060691e136a.stex" ] 13 | dest_md5="96c4e5cbe3315da1f7b2e5f9653640fa" 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=1 22 | flags/filter=false 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=1 26 | process/fix_alpha_border=false 27 | process/premult_alpha=true 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/displace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/displace.png -------------------------------------------------------------------------------- /Textures/displace.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/displace.png-4dff082b10727048d4d45dceb0ac20f8.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/displace.png" 10 | source_md5="d908e3b64d08f58580852880553f9696" 11 | 12 | dest_files=[ "res://.import/displace.png-4dff082b10727048d4d45dceb0ac20f8.stex" ] 13 | dest_md5="58b3c1daba7d27d1f2e8a8c771aedc57" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/gradient_bltr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/gradient_bltr.png -------------------------------------------------------------------------------- /Textures/gradient_bltr.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/gradient_bltr.png" 10 | source_md5="b5330d08baf3f7b09e308d0c38c56b3b" 11 | 12 | dest_files=[ "res://.import/gradient_bltr.png-7b1e875b7abc9a0d940e4118603c4d4e.stex" ] 13 | dest_md5="95ff03c553c376c75180a2b63ad05e82" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/gradient_conical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/gradient_conical.png -------------------------------------------------------------------------------- /Textures/gradient_conical.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/gradient_conical.png-5b27d13923401396c17f4076b42bbd5b.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/gradient_conical.png" 10 | source_md5="27fe203766ea521bf93d9472ca443359" 11 | 12 | dest_files=[ "res://.import/gradient_conical.png-5b27d13923401396c17f4076b42bbd5b.stex" ] 13 | dest_md5="e7c139a360aa707fc174f8db5ab258e8" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/gradient_lr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/gradient_lr.png -------------------------------------------------------------------------------- /Textures/gradient_lr.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/gradient_lr.png-4ba94454cb7a394ed78b01360d24affe.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/gradient_lr.png" 10 | source_md5="b7059ed2ada4a57d16ff434a3a39a731" 11 | 12 | dest_files=[ "res://.import/gradient_lr.png-4ba94454cb7a394ed78b01360d24affe.stex" ] 13 | dest_md5="cae3ccf19b80588c528ef9310855e73a" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/grid.png -------------------------------------------------------------------------------- /Textures/grid.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grid.png-93ed6e17ea59bb8aca71b79bf1c8b0c7.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/grid.png" 10 | source_md5="38fd66fd430fa4fb225e436d927c095a" 11 | 12 | dest_files=[ "res://.import/grid.png-93ed6e17ea59bb8aca71b79bf1c8b0c7.stex" ] 13 | dest_md5="910536cb7df7f654bbf6d817c9cde723" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/rect.png -------------------------------------------------------------------------------- /Textures/rect.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/rect.png-882c5f598ef3c0ff6ec0d2fdb0fd0a18.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/rect.png" 10 | source_md5="c755246a407f22a52148caa1e2a78c0a" 11 | 12 | dest_files=[ "res://.import/rect.png-882c5f598ef3c0ff6ec0d2fdb0fd0a18.stex" ] 13 | dest_md5="820ece89b2bad2286d829ee2c9a5a1ba" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=false 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/square.png -------------------------------------------------------------------------------- /Textures/square.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/square.png-03a6d7a416e72c19b2f7cb977484b6e9.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/square.png" 10 | source_md5="9535b208d94934210453aff642d6c61b" 11 | 12 | dest_files=[ "res://.import/square.png-03a6d7a416e72c19b2f7cb977484b6e9.stex" ] 13 | dest_md5="f12a62d5252f490c3681d0e91f5d8e41" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/test.jpg -------------------------------------------------------------------------------- /Textures/test.jpg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/test.jpg-9749594d239548b4ba73243ea232d489.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/test.jpg" 10 | source_md5="41484b18d115edb1bf4a1d3ce03b1624" 11 | 12 | dest_files=[ "res://.import/test.jpg-9749594d239548b4ba73243ea232d489.stex" ] 13 | dest_md5="f86605c0edf57b3efeef26617ae77e78" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /Textures/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/Textures/test.png -------------------------------------------------------------------------------- /Textures/test.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/test.png-445d7f8d1cba1c76aca7143ccb62e8b6.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://Textures/test.png" 10 | source_md5="d8fd91fdee569e871dc59e57afeace30" 11 | 12 | dest_files=[ "res://.import/test.png-445d7f8d1cba1c76aca7143ccb62e8b6.stex" ] 13 | dest_md5="b4de1a02a047dd2fc895986980b669b0" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=false 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | source_md5="ae7e641067601e2184afcade49abd283" 11 | 12 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 13 | dest_md5="36581b1207b7668eb82fe26c5ade1696" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=1 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=false 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=3 10 | 11 | [application] 12 | 13 | config/name="Shaders-Tutorials" 14 | config/icon="res://theicon.png" 15 | -------------------------------------------------------------------------------- /theicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steincodes/godot-shader-tutorials/961410b4584d06cf2777b57ef7df7f098ceb19a1/theicon.png -------------------------------------------------------------------------------- /theicon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/theicon.png-5e3251ca5e204db4471b90326440eec7.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://theicon.png" 10 | source_md5="e5b7ebe5abfa344dd061c597156593c8" 11 | 12 | dest_files=[ "res://.import/theicon.png-5e3251ca5e204db4471b90326440eec7.stex" ] 13 | dest_md5="0b307c44e49b4ff68608ccc6908cd667" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | --------------------------------------------------------------------------------