├── .gitignore ├── BattleBackgrounds ├── assets │ └── sprites │ │ └── backgrounds │ │ ├── Checkerboard.jpg │ │ ├── Checkerboard.jpg.import │ │ ├── Circles.png │ │ ├── Circles.png.import │ │ ├── Diamonds.png │ │ ├── Diamonds.png.import │ │ ├── Portal.png │ │ ├── Portal.png.import │ │ ├── Squares.png │ │ └── Squares.png.import ├── default_env.tres ├── icon.png ├── icon.png.import ├── project.godot ├── shaders │ └── Backgrounds.shader └── src │ └── battle │ └── backgrounds │ ├── animated │ ├── BGAnimated.tscn │ └── BGAnimatedFG1.tres │ ├── checkerboard │ ├── BGCheckerboard.tscn │ ├── BGCheckerboardFG1.tres │ └── BGCheckerboardFG2.tres │ ├── default │ ├── BGDefault.tscn │ ├── BGDefaultFG1.tres │ ├── BGDefaultFG2.tres │ └── FG.gd │ ├── diamonds │ ├── BGDiamonds.tscn │ └── BGDiamondsFG1.tres │ ├── portal │ ├── BGPortal.tscn │ ├── BGPortalFG1.tres │ └── BGPortalFG2.tres │ └── squares and circles │ ├── BGSquaresCircles.tscn │ ├── BGSquaresCirclesFG1.tres │ └── BGSquaresCirclesFG2.tres ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | export.cfg 5 | export_presets.cfg 6 | 7 | # Mono-specific ignores 8 | .mono/ 9 | data_*/ 10 | -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Checkerboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/assets/sprites/backgrounds/Checkerboard.jpg -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Checkerboard.jpg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Checkerboard.jpg-5fec1d5bd77d63a171e94944a8ad1278.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/sprites/backgrounds/Checkerboard.jpg" 13 | dest_files=[ "res://.import/Checkerboard.jpg-5fec1d5bd77d63a171e94944a8ad1278.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/assets/sprites/backgrounds/Circles.png -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Circles.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Circles.png-6a5975b86d6628db03c2fa8d7fb24ac7.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/sprites/backgrounds/Circles.png" 13 | dest_files=[ "res://.import/Circles.png-6a5975b86d6628db03c2fa8d7fb24ac7.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Diamonds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/assets/sprites/backgrounds/Diamonds.png -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Diamonds.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Diamonds.png-0d23f761419197831d9917a3b9a72cce.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/sprites/backgrounds/Diamonds.png" 13 | dest_files=[ "res://.import/Diamonds.png-0d23f761419197831d9917a3b9a72cce.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/assets/sprites/backgrounds/Portal.png -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Portal.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Portal.png-145edb4da96264227f5ea5a6d4072067.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/sprites/backgrounds/Portal.png" 13 | dest_files=[ "res://.import/Portal.png-145edb4da96264227f5ea5a6d4072067.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/assets/sprites/backgrounds/Squares.png -------------------------------------------------------------------------------- /BattleBackgrounds/assets/sprites/backgrounds/Squares.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Squares.png-76f0e5c3c39263862602ab837d07b83c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/sprites/backgrounds/Squares.png" 13 | dest_files=[ "res://.import/Squares.png-76f0e5c3c39263862602ab837d07b83c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /BattleBackgrounds/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3trodev/earthbound-backgrounds-shaders-godot/8eef32f69791267b77201978649903b96fa49b78/BattleBackgrounds/icon.png -------------------------------------------------------------------------------- /BattleBackgrounds/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /BattleBackgrounds/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=4 10 | 11 | [application] 12 | 13 | config/name="Battle Backgrounds" 14 | run/main_scene="res://src/battle/backgrounds/squares and circles/BGSquaresCircles.tscn" 15 | config/icon="res://icon.png" 16 | 17 | [display] 18 | 19 | window/size/width=360 20 | window/size/height=640 21 | window/stretch/mode="2d" 22 | window/stretch/aspect="keep" 23 | 24 | [importer_defaults] 25 | 26 | texture={ 27 | "compress/bptc_ldr": 0, 28 | "compress/hdr_mode": 0, 29 | "compress/lossy_quality": 0.7, 30 | "compress/mode": 0, 31 | "compress/normal_map": 0, 32 | "detect_3d": true, 33 | "flags/anisotropic": false, 34 | "flags/filter": true, 35 | "flags/mipmaps": false, 36 | "flags/repeat": 1, 37 | "flags/srgb": 2, 38 | "process/HDR_as_SRGB": false, 39 | "process/fix_alpha_border": true, 40 | "process/invert_color": false, 41 | "process/premult_alpha": false, 42 | "size_limit": 0, 43 | "stream": false, 44 | "svg/scale": 1.0 45 | } 46 | 47 | [physics] 48 | 49 | common/enable_pause_aware_picking=true 50 | 51 | [rendering] 52 | 53 | environment/default_environment="res://default_env.tres" 54 | -------------------------------------------------------------------------------- /BattleBackgrounds/shaders/Backgrounds.shader: -------------------------------------------------------------------------------- 1 | /* 2 | Earthbound battle backgrounds shader with scrolling effect and palette cycling like in the original game. 3 | @retr0_dev 4 | 5 | Apply the shader to a TextureRect or a Sprite. Use a texture with some shapes in a transparent background for best results. 6 | You can then use a ColorRect or another method to paint the background. 7 | You can use the shader on multiple TextureRects and obtain a double-buffer effect tweaking the values for each one, remember to Make Unique the shader material. 8 | */ 9 | shader_type canvas_item; 10 | 11 | uniform float screen_height = 640.0; 12 | uniform float amplitude = 0.075; 13 | uniform float frequency = 10.0; 14 | uniform float speed = 2.0; 15 | uniform float amplitude_vertical = 0.0; 16 | uniform float frequency_vertical = 0.0; 17 | uniform float speed_vertical = 0.0; 18 | uniform vec2 scroll_direction = vec2(0.0, 0.0); 19 | uniform float scrolling_speed = 0.08; 20 | uniform bool enable_palette_cycling = false; 21 | uniform bool enable_scan_lines = true; 22 | uniform sampler2D palette; 23 | uniform float palette_speed = 0.1; 24 | 25 | void fragment() 26 | { 27 | float diff_x = amplitude * sin((frequency * UV.y) + (speed * TIME)); 28 | float diff_y = amplitude_vertical * sin((frequency_vertical * UV.y) + (speed_vertical * TIME)); 29 | vec2 scroll = scroll_direction * TIME * scrolling_speed; 30 | vec4 tex = texture(TEXTURE, vec2(UV.x + diff_x, UV.y + diff_y) + scroll); 31 | float palette_swap = mod(tex.r - TIME * palette_speed, 1.0); 32 | 33 | if (enable_palette_cycling) 34 | { 35 | COLOR = vec4(texture(palette, vec2(palette_swap, 0)).rgb, tex.a); 36 | } 37 | else COLOR = tex; 38 | if (enable_scan_lines) COLOR = mix(vec4(0.0), COLOR, float(int(UV.y * screen_height) % 2)); 39 | } -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/animated/BGAnimated.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefault.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://assets/sprites/backgrounds/Circles.png" type="Texture" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/animated/BGAnimatedFG1.tres" type="Material" id=3] 6 | 7 | [sub_resource type="Animation" id=1] 8 | resource_name = "anim" 9 | length = 5.0 10 | loop = true 11 | tracks/0/type = "value" 12 | tracks/0/path = NodePath("FG1:material:shader_param/frequency_vertical") 13 | tracks/0/interp = 1 14 | tracks/0/loop_wrap = true 15 | tracks/0/imported = false 16 | tracks/0/enabled = true 17 | tracks/0/keys = { 18 | "times": PoolRealArray( 0, 2.5, 5 ), 19 | "transitions": PoolRealArray( 1, 1, 1 ), 20 | "update": 0, 21 | "values": [ 2.0, 10.0, 2.0 ] 22 | } 23 | 24 | [node name="BGAnimated" instance=ExtResource( 1 )] 25 | 26 | [node name="BG" parent="." index="0"] 27 | color = Color( 0, 0.556863, 0.596078, 1 ) 28 | 29 | [node name="FG1" parent="." index="1"] 30 | material = ExtResource( 3 ) 31 | texture = ExtResource( 2 ) 32 | 33 | [node name="FG2" parent="." index="2"] 34 | visible = false 35 | 36 | [node name="AnimationPlayer" parent="." index="3"] 37 | autoplay = "anim" 38 | anims/anim = SubResource( 1 ) 39 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/animated/BGAnimatedFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.0 9 | shader_param/frequency = 0.0 10 | shader_param/speed = 0.0 11 | shader_param/amplitude_vertical = 0.2 12 | shader_param/frequency_vertical = 2.02032 13 | shader_param/speed_vertical = 2.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/palette_speed = 0.1 18 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/checkerboard/BGCheckerboard.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefault.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://src/battle/backgrounds/checkerboard/BGCheckerboardFG1.tres" type="Material" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/checkerboard/BGCheckerboardFG2.tres" type="Material" id=3] 6 | [ext_resource path="res://assets/sprites/backgrounds/Checkerboard.jpg" type="Texture" id=4] 7 | 8 | [node name="BGCheckerboard" instance=ExtResource( 1 )] 9 | 10 | [node name="FG1" parent="." index="1"] 11 | material = ExtResource( 2 ) 12 | texture = ExtResource( 4 ) 13 | 14 | [node name="FG2" parent="." index="2"] 15 | visible = false 16 | material = ExtResource( 3 ) 17 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/checkerboard/BGCheckerboardFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.0 9 | shader_param/frequency = 0.0 10 | shader_param/speed = 0.0 11 | shader_param/amplitude_vertical = 0.2 12 | shader_param/frequency_vertical = 2.0 13 | shader_param/speed_vertical = 0.5 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/enable_scan_lines = true 18 | shader_param/palette_speed = 0.1 19 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/checkerboard/BGCheckerboardFG2.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.075 9 | shader_param/frequency = 10.0 10 | shader_param/speed = 2.0 11 | shader_param/amplitude_vertical = 0.0 12 | shader_param/frequency_vertical = 0.0 13 | shader_param/speed_vertical = 0.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/enable_scan_lines = true 18 | shader_param/palette_speed = 0.1 19 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/default/BGDefault.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefaultFG2.tres" type="Material" id=1] 4 | [ext_resource path="res://src/battle/backgrounds/default/BGDefaultFG1.tres" type="Material" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/default/FG.gd" type="Script" id=4] 6 | 7 | [node name="BGDefault" type="CanvasLayer"] 8 | 9 | [node name="BG" type="ColorRect" parent="."] 10 | anchor_right = 1.0 11 | anchor_bottom = 1.0 12 | color = Color( 0, 0, 0, 1 ) 13 | __meta__ = { 14 | "_edit_use_anchors_": false 15 | } 16 | 17 | [node name="FG1" type="TextureRect" parent="."] 18 | material = ExtResource( 2 ) 19 | anchor_right = 1.0 20 | anchor_bottom = 1.0 21 | expand = true 22 | script = ExtResource( 4 ) 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="FG2" type="TextureRect" parent="."] 28 | material = ExtResource( 1 ) 29 | anchor_right = 1.0 30 | anchor_bottom = 1.0 31 | expand = true 32 | script = ExtResource( 4 ) 33 | __meta__ = { 34 | "_edit_use_anchors_": false 35 | } 36 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/default/BGDefaultFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.075 9 | shader_param/frequency = 10.0 10 | shader_param/speed = 2.0 11 | shader_param/amplitude_vertical = 0.0 12 | shader_param/frequency_vertical = 0.0 13 | shader_param/speed_vertical = 0.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/enable_scan_lines = true 18 | shader_param/palette_speed = 0.1 19 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/default/BGDefaultFG2.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.075 9 | shader_param/frequency = 10.0 10 | shader_param/speed = 2.0 11 | shader_param/amplitude_vertical = 0.0 12 | shader_param/frequency_vertical = 0.0 13 | shader_param/speed_vertical = 0.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/enable_scan_lines = true 18 | shader_param/palette_speed = 0.1 19 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/default/FG.gd: -------------------------------------------------------------------------------- 1 | extends TextureRect 2 | 3 | func _ready() -> void: 4 | # warning-ignore:return_value_discarded 5 | get_viewport().connect("size_changed", self, "_on_viewport_size_changed") 6 | 7 | func _on_viewport_size_changed() -> void: 8 | material.set_shader_param("screen_height", get_viewport().size.y) 9 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/diamonds/BGDiamonds.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefault.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://assets/sprites/backgrounds/Diamonds.png" type="Texture" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/diamonds/BGDiamondsFG1.tres" type="Material" id=3] 6 | 7 | [node name="BGDiamonds" instance=ExtResource( 1 )] 8 | 9 | [node name="FG1" parent="." index="1"] 10 | material = ExtResource( 3 ) 11 | texture = ExtResource( 2 ) 12 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/diamonds/BGDiamondsFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.2 9 | shader_param/frequency = 20.0 10 | shader_param/speed = 2.0 11 | shader_param/amplitude_vertical = 0.075 12 | shader_param/frequency_vertical = 0.0 13 | shader_param/speed_vertical = 1.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.08 16 | shader_param/enable_palette_cycling = false 17 | shader_param/palette_speed = 0.5 18 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/portal/BGPortal.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefault.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://assets/sprites/backgrounds/Portal.png" type="Texture" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/portal/BGPortalFG2.tres" type="Material" id=3] 6 | [ext_resource path="res://src/battle/backgrounds/portal/BGPortalFG1.tres" type="Material" id=4] 7 | 8 | [node name="BGPortal" instance=ExtResource( 1 )] 9 | 10 | [node name="FG1" parent="." index="1"] 11 | material = ExtResource( 4 ) 12 | texture = ExtResource( 2 ) 13 | 14 | [node name="FG2" parent="." index="2"] 15 | visible = false 16 | material = ExtResource( 3 ) 17 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/portal/BGPortalFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [sub_resource type="Gradient" id=1] 6 | offsets = PoolRealArray( 0, 0.2, 0.3, 0.5, 0.5, 0.7, 0.8, 1 ) 7 | colors = PoolColorArray( 0, 0.352941, 0.294118, 1, 0, 0.466667, 0.388235, 1, 0, 0.494118, 0.411765, 1, 0, 0.521569, 0.435294, 1, 0, 0.380392, 0.317647, 1, 0, 0.407843, 0.341176, 1, 0, 0.435294, 0.364706, 1, 0, 0.54902, 0.458824, 1 ) 8 | 9 | [sub_resource type="GradientTexture" id=2] 10 | gradient = SubResource( 1 ) 11 | 12 | [resource] 13 | shader = ExtResource( 1 ) 14 | shader_param/screen_height = 640.0 15 | shader_param/amplitude = 0.0 16 | shader_param/frequency = 0.0 17 | shader_param/speed = 0.0 18 | shader_param/amplitude_vertical = 0.0 19 | shader_param/frequency_vertical = 0.0 20 | shader_param/speed_vertical = 0.0 21 | shader_param/scroll_direction = Vector2( 0, 0 ) 22 | shader_param/scrolling_speed = 0.0 23 | shader_param/enable_palette_cycling = true 24 | shader_param/palette_speed = 0.2 25 | shader_param/palette = SubResource( 2 ) 26 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/portal/BGPortalFG2.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/screen_height = 640.0 8 | shader_param/amplitude = 0.0 9 | shader_param/frequency = 0.0 10 | shader_param/speed = 0.0 11 | shader_param/amplitude_vertical = 0.0 12 | shader_param/frequency_vertical = 0.0 13 | shader_param/speed_vertical = 0.0 14 | shader_param/scroll_direction = Vector2( 0, 0 ) 15 | shader_param/scrolling_speed = 0.0 16 | shader_param/enable_palette_cycling = false 17 | shader_param/palette_speed = 0.1 18 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/squares and circles/BGSquaresCircles.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://src/battle/backgrounds/default/BGDefault.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://assets/sprites/backgrounds/Circles.png" type="Texture" id=2] 5 | [ext_resource path="res://src/battle/backgrounds/squares and circles/BGSquaresCirclesFG2.tres" type="Material" id=3] 6 | [ext_resource path="res://src/battle/backgrounds/squares and circles/BGSquaresCirclesFG1.tres" type="Material" id=4] 7 | [ext_resource path="res://assets/sprites/backgrounds/Squares.png" type="Texture" id=5] 8 | 9 | [node name="BGSquaresCircles" instance=ExtResource( 1 )] 10 | 11 | [node name="BG" parent="." index="0"] 12 | color = Color( 0, 0.0156863, 0.168627, 1 ) 13 | 14 | [node name="FG1" parent="." index="1"] 15 | material = ExtResource( 4 ) 16 | texture = ExtResource( 5 ) 17 | 18 | [node name="FG2" parent="." index="2"] 19 | material = ExtResource( 3 ) 20 | texture = ExtResource( 2 ) 21 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/squares and circles/BGSquaresCirclesFG1.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [sub_resource type="Gradient" id=1] 6 | offsets = PoolRealArray( 0, 0.2, 0.5, 0.8, 1 ) 7 | colors = PoolColorArray( 0.517647, 1, 0.788235, 1, 0.556863, 0.92549, 0.843137, 1, 0.592157, 0.85098, 0.894118, 1, 0.631373, 0.772549, 0.94902, 1, 0.666667, 0.698039, 1, 1 ) 8 | 9 | [sub_resource type="GradientTexture" id=2] 10 | gradient = SubResource( 1 ) 11 | 12 | [resource] 13 | shader = ExtResource( 1 ) 14 | shader_param/screen_height = 640.0 15 | shader_param/amplitude = 0.0 16 | shader_param/frequency = 0.0 17 | shader_param/speed = 0.0 18 | shader_param/amplitude_vertical = 0.0 19 | shader_param/frequency_vertical = 0.0 20 | shader_param/speed_vertical = 0.0 21 | shader_param/scroll_direction = Vector2( 0, 1 ) 22 | shader_param/scrolling_speed = 0.1 23 | shader_param/enable_palette_cycling = true 24 | shader_param/enable_scan_lines = true 25 | shader_param/palette_speed = 0.4 26 | shader_param/palette = SubResource( 2 ) 27 | -------------------------------------------------------------------------------- /BattleBackgrounds/src/battle/backgrounds/squares and circles/BGSquaresCirclesFG2.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shaders/Backgrounds.shader" type="Shader" id=1] 4 | 5 | [sub_resource type="Gradient" id=1] 6 | offsets = PoolRealArray( 0, 0.25, 0.75, 1 ) 7 | colors = PoolColorArray( 0.796078, 0.258824, 0.533333, 1, 0.741176, 0.223529, 0.333333, 1, 0.768627, 0.243137, 0.431373, 1, 0.713726, 0.207843, 0.231373, 1 ) 8 | 9 | [sub_resource type="GradientTexture" id=2] 10 | gradient = SubResource( 1 ) 11 | 12 | [resource] 13 | shader = ExtResource( 1 ) 14 | shader_param/screen_height = 640.0 15 | shader_param/amplitude = 0.075 16 | shader_param/frequency = 0.0 17 | shader_param/speed = 0.0 18 | shader_param/amplitude_vertical = 0.2 19 | shader_param/frequency_vertical = 10.0 20 | shader_param/speed_vertical = 2.0 21 | shader_param/scroll_direction = Vector2( 0, 0 ) 22 | shader_param/scrolling_speed = 0.08 23 | shader_param/enable_palette_cycling = true 24 | shader_param/enable_scan_lines = true 25 | shader_param/palette_speed = 0.1 26 | shader_param/palette = SubResource( 2 ) 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # earthbound-backgrounds-shaders-godot 2 | This is a demo project for a Godot shader inspired by the battle backgrounds of Earthbound. 3 | I tried to incorporate in this shader as many effects used in Earthbound to create the battle backgrounds. 4 | You can use this project as a reference to learn how to create backgrounds using the shader. 5 | 6 | ## Examples 7 | ![Palette-Cycling-Portal](https://user-images.githubusercontent.com/35233596/117941051-02072680-b30a-11eb-9493-53b25de89f19.gif) 8 | ![Checkerboard](https://user-images.githubusercontent.com/35233596/117941058-04698080-b30a-11eb-885e-2c74bc49a0ff.gif) 9 | ![SquareAndCircles-2](https://user-images.githubusercontent.com/35233596/117941066-059aad80-b30a-11eb-9444-bfee3cf3f47d.gif) 10 | ![Diamonds](https://user-images.githubusercontent.com/35233596/117941472-688c4480-b30a-11eb-8a52-5be77e4e5b75.gif) 11 | 12 | ## Credits 13 | **Shader and Assets: [@r3tr0_dev](https://github.com/r3tr0dev).** 14 | **Made using [Godot Engine](https://godotengine.org/).** 15 | --------------------------------------------------------------------------------