119 lines
2.6 KiB
Plaintext
119 lines
2.6 KiB
Plaintext
[gd_scene load_steps=7 format=2]
|
|
|
|
[ext_resource path="res://IslandGenerator.gd" type="Script" id=1]
|
|
|
|
[sub_resource type="Shader" id=1]
|
|
code = "shader_type canvas_item;
|
|
|
|
/*
|
|
uniform float lod: hint_range(0.0, 5) = 0.0;
|
|
|
|
|
|
void fragment3(){
|
|
vec4 color = texture(SCREEN_TEXTURE, SCREEN_UV, lod);
|
|
COLOR = color;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
六角形モザイク by あるる(きのもと 結衣)
|
|
Hex Noise by Yui Kinomoto @arlez80
|
|
|
|
MIT License
|
|
*/
|
|
//shader_type canvas_item;
|
|
|
|
uniform vec2 size = vec2( 64.0, 48.0 );
|
|
|
|
void fragment( )
|
|
{
|
|
vec2 norm_size = size * SCREEN_PIXEL_SIZE;
|
|
bool half = mod( SCREEN_UV.y / 2.0, norm_size.y ) / norm_size.y < 0.5;
|
|
vec2 uv = SCREEN_UV + vec2( norm_size.x * 0.5 * float( half ), 0.0 );
|
|
vec2 center_uv = floor( uv / norm_size ) * norm_size;
|
|
vec2 norm_uv = mod( uv, norm_size ) / norm_size;
|
|
center_uv += mix(
|
|
vec2( 0.0, 0.0 )
|
|
, mix(
|
|
mix(
|
|
vec2( norm_size.x, -norm_size.y )
|
|
, vec2( 0.0, -norm_size.y )
|
|
, float( norm_uv.x < 0.5 )
|
|
)
|
|
, mix(
|
|
vec2( 0.0, -norm_size.y )
|
|
, vec2( -norm_size.x, -norm_size.y )
|
|
, float( norm_uv.x < 0.5 )
|
|
)
|
|
, float( half )
|
|
)
|
|
, float( norm_uv.y < 0.3333333 ) * float( norm_uv.y / 0.3333333 < ( abs( norm_uv.x - 0.5 ) * 2.0 ) )
|
|
);
|
|
|
|
COLOR = textureLod( SCREEN_TEXTURE, center_uv, 0.0 );
|
|
}
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id=2]
|
|
shader = SubResource( 1 )
|
|
shader_param/size = Vector2( 64, 48 )
|
|
|
|
[sub_resource type="Shader" id=3]
|
|
code = "shader_type canvas_item;
|
|
|
|
uniform int amount = 80;
|
|
|
|
void fragment()
|
|
{
|
|
vec2 grid_uv = round(UV * float(amount)) / float(amount);
|
|
|
|
vec4 text = texture(TEXTURE, grid_uv);
|
|
|
|
COLOR = text;
|
|
}"
|
|
|
|
[sub_resource type="ShaderMaterial" id=4]
|
|
shader = SubResource( 3 )
|
|
shader_param/amount = 80
|
|
|
|
[sub_resource type="ImageTexture" id=5]
|
|
flags = 0
|
|
flags = 0
|
|
size = Vector2( 256, 256 )
|
|
|
|
[node name="IslandGenerator" type="Node2D"]
|
|
scale = Vector2( 1.00254, 1 )
|
|
script = ExtResource( 1 )
|
|
|
|
[node name="blur" type="Sprite" parent="."]
|
|
material = SubResource( 2 )
|
|
scale = Vector2( 0.976278, 1 )
|
|
centered = false
|
|
|
|
[node name="pixelate" type="Sprite" parent="."]
|
|
visible = false
|
|
material = SubResource( 4 )
|
|
scale = Vector2( 1.30352, 0.863349 )
|
|
texture = SubResource( 5 )
|
|
centered = false
|
|
|
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
|
margin_right = 149.0
|
|
margin_bottom = 40.0
|
|
__meta__ = {
|
|
"_edit_use_anchors_": false
|
|
}
|
|
|
|
[node name="Button" type="Button" parent="HBoxContainer"]
|
|
margin_right = 71.0
|
|
margin_bottom = 40.0
|
|
text = "Generate"
|
|
|
|
[node name="IterationsSpinBox" type="SpinBox" parent="HBoxContainer"]
|
|
margin_left = 75.0
|
|
margin_right = 149.0
|
|
margin_bottom = 40.0
|
|
value = 4.0
|
|
|
|
[connection signal="pressed" from="HBoxContainer/Button" to="." method="_on_Button_pressed"]
|