diff --git a/addons/procedural_material/graph_edit.tscn b/addons/procedural_material/graph_edit.tscn new file mode 100644 index 0000000..ef1a3d2 --- /dev/null +++ b/addons/procedural_material/graph_edit.tscn @@ -0,0 +1,397 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://addons/procedural_material/graph_edit.gd" type="Script" id=1] +[ext_resource path="res://addons/procedural_material/nodes/material.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/procedural_material/nodes/material.gd" type="Script" id=3] + +[sub_resource type="Theme" id=1] + + +[sub_resource type="Shader" id=2] + +code = "shader_type canvas_item; + +float rand(vec2 x) { + return fract(sin(dot(x, vec2(13.9898, 8.141))) * 43758.5453); +} + +vec2 rand2(vec2 x) { + return fract(sin(vec2(dot(x, vec2(13.9898, 8.141)), + dot(x, vec2(3.4562, 17.398)))) * 43758.5453); +} + +vec3 rand3(vec2 x) { + return fract(sin(vec3(dot(x, vec2(13.9898, 8.141)), + dot(x, vec2(3.4562, 17.398)), + dot(x, vec2(13.254, 5.867)))) * 43758.5453); +} + +float wave_sin(float x) { + return 0.5-0.5*cos(3.1415928*2.0*x); +} + +float wave_saw(float x) { + x = fract(x); + return min(2.0*x, 2.0-2.0*x); +} + +float wave_square(float x) { + return (fract(x) < 0.5) ? 0.0 : 1.0; +} + +float mix_multiply(float x, float y) { + return x*y; +} + +float mix_add(float x, float y) { + return min(x+y, 1.0); +} + +float mix_max(float x, float y) { + return max(x, y); +} + +float mix_min(float x, float y) { + return min(x, y); +} + +float mix_min(float x, float y) { + return min(x, y); +} + +float mix_xor(float x, float y) { + return min(x+y, 2.0-x-y); +} + +float mix_pow(float x, float y) { + return pow(x, y); +} + +vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*c1 + (1.0-opacity)*c2; +} + +vec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) { + if (rand(uv) < opacity) { + return c1; + } else { + return c2; + } +} + +vec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*c1*c2 + (1.0-opacity)*c2; +} + +vec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2; +} + +float blend_overlay_f(float c1, float c2) { + return (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2)); +} + +vec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2; +} + +vec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2; +} + +float blend_soft_light_f(float c1, float c2) { + return (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0); +} + +vec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2; +} + +float blend_burn_f(float c1, float c2) { + return (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0); +} + +vec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2; +} + +float blend_dodge_f(float c1, float c2) { + return (c1==1.0)?c1:min(c2/(1.0-c1),1.0); +} + +vec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2; +} + +vec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*max(c1, c2) + (1.0-opacity)*c2; +} + +vec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) { + return opacity*min(c1, c2) + (1.0-opacity)*c2; +} + +vec2 transform(vec2 uv, vec2 translate, float rotate, float scale) { + vec2 rv; + uv -= vec2(0.5); + rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y; + rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y; + rv /= scale; + rv += vec2(0.5); + rv -= translate; + return rv; +} + +float bricks(vec2 uv, vec2 count, float offset, float mortar, float bevel) { + mortar /= max(count.x, count.y); + bevel /= max(count.x, count.y); + float fract_x = fract(uv.x*count.x+offset*step(0.5, fract(uv.y*count.y*0.5))); + float slope_x = 1.0/(bevel*count.x); + float off = 0.5*mortar/bevel; + float f1 = fract_x*slope_x-off; + float f2 = (1.0-fract_x)*slope_x-off; + float fract_y = fract(uv.y*count.y); + float slope_y = 1.0/(bevel*count.y); + float f3 = fract_y*slope_y-off; + float f4 = (1.0-fract_y)*slope_y-off; + return max(0.0, min(1.0, min(min(f1, f2), min(f3, f4)))); +} + +float colored_bricks(vec2 uv, vec2 count, float offset) { + float x = floor(uv.x*count.x+offset*step(0.5, fract(uv.y*count.y*0.5))); + float y = floor(uv.y*count.y); + return fract(x/3.0+y/7.0); +} + +float perlin(vec2 uv, vec2 size, int iterations, float persistence, int seed) { + uv += vec2(float(seed)*0.1234567); + float rv = 0.0; + float coef = 1.0; + float acc = 0.0; + for (int i = 0; i < iterations; ++i) { + vec2 step = vec2(1.0)/size; + float f0 = rand(floor(fract(uv)*size)); + float f1 = rand(floor(fract(uv+vec2(step.x, 0.0))*size)); + float f2 = rand(floor(fract(uv+vec2(0.0, step.y))*size)); + float f3 = rand(floor(fract(uv+vec2(step.x, step.y))*size)); + vec2 mixval = fract(uv*size); + mixval = 0.5*(1.0-cos(3.1415928*mixval)); + rv += coef * mix(mix(f0, f1, mixval.x), mix(f2, f3, mixval.x), mixval.y); + acc += coef; + size *= 2.0; + coef *= persistence; + } + + return rv / acc; +} + +vec4 voronoi(vec2 uv, vec2 size, float intensity, int seed) { + uv += vec2(float(seed)*0.1234567); + uv *= size; + float best_distance0 = 1.0; + float best_distance1 = 1.0; + vec2 point0; + vec2 point1; + vec2 p0 = floor(uv); + for (int dx = -1; dx < 2; ++dx) { + for (int dy = -1; dy < 2; ++dy) { + vec2 d = vec2(float(dx), float(dy)); + vec2 p = p0+d; + p += rand2(mod(p, size)); + float distance = length((uv - p) / size); + if (best_distance0 > distance) { + best_distance1 = best_distance0; + best_distance0 = distance; + point1 = point0; + point0 = p; + } else if (best_distance1 > distance) { + best_distance1 = distance; + point1 = p; + } + } + } + float edge_distance = dot(uv - 0.5*(point0+point1), normalize(point0-point1)); + + return vec4(point0, best_distance0*length(size)*intensity, edge_distance); +} + +float Perlin_f(vec2 uv) { return perlin(uv, vec2(4.000000, 4.000000), 6, 0.500000000, 2375); } +float Bricks_f(vec2 uv) { return bricks(uv, vec2(3, 6), 0.5, 0.05, 0.2); } +vec3 colorize_3_gradient(float x) { + if (x < 0.000000000) { + return vec3(0.273438007,0.273438007,0.273438007); + } else if (x < 1.000000000) { + return vec3(0.273438007,0.273438007,0.273438007)+x*vec3(-0.273438007,-0.273438007,-0.273438007); + } + return vec3(0.000000000,0.000000000,0.000000000); +} +void fragment() { +float Perlin_0_f = Perlin_f(UV+vec2(0.01, 0.0)); +float Perlin_1_f = Perlin_f(UV-vec2(0.01, 0.0)); +float Perlin_2_f = Perlin_f(UV+vec2(0.0, 0.01)); +float Perlin_3_f = Perlin_f(UV-vec2(0.0, 0.01)); +vec2 Warp_0_uv = UV+0.100000001*vec2((Perlin_0_f)-(Perlin_1_f), (Perlin_2_f)-(Perlin_3_f)); +float Bricks_0_f = Bricks_f(Warp_0_uv); +vec3 Warp_0_rgb = vec3(Bricks_0_f); +float Warp_0_f = dot(vec3(Bricks_0_f), vec3(1.0))/3.0; +vec3 colorize_3_0_rgb = colorize_3_gradient(Warp_0_f); +COLOR = vec4(colorize_3_0_rgb, 1.0); +} +" + +[sub_resource type="ShaderMaterial" id=3] + +render_priority = 0 +shader = SubResource( 2 ) + +[node name="GraphEdit" type="GraphEdit"] + +self_modulate = Color( 1, 1, 1, 0 ) +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 1280.0 +margin_bottom = 718.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = true +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +right_disconnects = true +scroll_offset = Vector2( 0, 0 ) +snap_distance = 20 +use_snap = false +zoom = 1.0 +script = ExtResource( 1 ) +_sections_unfolded = [ "Material", "Mouse", "Visibility" ] + +[node name="Material" type="GraphNode" parent="." index="2" instance=ExtResource( 2 )] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 111.0 +margin_bottom = 118.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +theme = SubResource( 1 ) +title = "Material" +offset = Vector2( 0, 0 ) +show_close = false +resizable = false +selected = false +comment = false +overlay = 0 +slot/0/left_enabled = true +slot/0/left_type = 0 +slot/0/left_color = Color( 0.5, 0.5, 1, 1 ) +slot/0/right_enabled = false +slot/0/right_type = 0 +slot/0/right_color = Color( 0.5, 0.5, 1, 1 ) +slot/1/left_enabled = true +slot/1/left_type = 0 +slot/1/left_color = Color( 0.5, 0.5, 1, 1 ) +slot/1/right_enabled = false +slot/1/right_type = 0 +slot/1/right_color = Color( 0.5, 0.5, 1, 1 ) +slot/2/left_enabled = true +slot/2/left_type = 0 +slot/2/left_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/2/right_enabled = false +slot/2/right_type = 0 +slot/2/right_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/3/left_enabled = true +slot/3/left_type = 0 +slot/3/left_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/3/right_enabled = false +slot/3/right_type = 0 +slot/3/right_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/4/left_enabled = true +slot/4/left_type = 0 +slot/4/left_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/4/right_enabled = false +slot/4/right_type = 0 +slot/4/right_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/5/left_enabled = true +slot/5/left_type = 0 +slot/5/left_color = Color( 0.498039, 0.498039, 1, 1 ) +slot/5/right_enabled = false +slot/5/right_type = 0 +slot/5/right_color = Color( 0.498039, 0.498039, 1, 1 ) +script = ExtResource( 3 ) +_sections_unfolded = [ "Anchor", "Margin", "Mouse", "Theme", "slot", "slot/2", "slot/3", "slot/4", "slot/5" ] + +[node name="Timer" type="Timer" parent="." index="3"] + +process_mode = 1 +wait_time = 0.1 +one_shot = true +autostart = false + +[node name="SaveViewport" type="Viewport" parent="." index="4"] + +arvr = false +size = Vector2( 0, 0 ) +own_world = true +world = null +transparent_bg = false +msaa = 2 +hdr = false +disable_3d = false +usage = 2 +debug_draw = 0 +render_target_v_flip = true +render_target_clear_mode = 0 +render_target_update_mode = 1 +audio_listener_enable_2d = false +audio_listener_enable_3d = false +physics_object_picking = false +gui_disable_input = true +gui_snap_controls_to_pixels = true +shadow_atlas_size = 0 +shadow_atlas_quad_0 = 2 +shadow_atlas_quad_1 = 2 +shadow_atlas_quad_2 = 3 +shadow_atlas_quad_3 = 4 +_sections_unfolded = [ "GUI", "Render Target", "Rendering" ] + +[node name="ColorRect" type="ColorRect" parent="SaveViewport" index="0"] + +material = SubResource( 3 ) +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 40.0 +margin_bottom = 40.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +color = Color( 1, 1, 1, 1 ) +_sections_unfolded = [ "Material", "Rect" ] + +[node name="Timer" type="Timer" parent="SaveViewport" index="1"] + +process_mode = 1 +wait_time = 0.1 +one_shot = true +autostart = false + +[connection signal="connection_request" from="." to="." method="_on_GraphEdit_connection_request"] + +[connection signal="disconnection_request" from="." to="." method="_on_GraphEdit_disconnection_request"] + +[connection signal="timeout" from="Timer" to="." method="do_send_changed_signal"] + + diff --git a/addons/procedural_material/pm_editor.tscn b/addons/procedural_material/pm_editor.tscn index ea5563a..34f086b 100644 --- a/addons/procedural_material/pm_editor.tscn +++ b/addons/procedural_material/pm_editor.tscn @@ -1,249 +1,11 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://addons/procedural_material/pm_editor.gd" type="Script" id=1] -[ext_resource path="res://addons/procedural_material/graph_edit.gd" type="Script" id=2] -[ext_resource path="res://addons/procedural_material/nodes/material.tscn" type="PackedScene" id=3] -[ext_resource path="res://addons/procedural_material/preview.gd" type="Script" id=4] -[ext_resource path="res://addons/procedural_material/panoramas/park.hdr" type="Texture" id=5] +[ext_resource path="res://addons/procedural_material/graph_edit.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/procedural_material/preview.gd" type="Script" id=3] +[ext_resource path="res://addons/procedural_material/panoramas/park.hdr" type="Texture" id=4] -[sub_resource type="Shader" id=1] - -code = "shader_type canvas_item; - -float rand(vec2 x) { - return fract(sin(dot(x, vec2(13.9898, 8.141))) * 43758.5453); -} - -vec2 rand2(vec2 x) { - return fract(sin(vec2(dot(x, vec2(13.9898, 8.141)), - dot(x, vec2(3.4562, 17.398)))) * 43758.5453); -} - -vec3 rand3(vec2 x) { - return fract(sin(vec3(dot(x, vec2(13.9898, 8.141)), - dot(x, vec2(3.4562, 17.398)), - dot(x, vec2(13.254, 5.867)))) * 43758.5453); -} - -float wave_sin(float x) { - return 0.5-0.5*cos(3.1415928*2.0*x); -} - -float wave_saw(float x) { - x = fract(x); - return min(2.0*x, 2.0-2.0*x); -} - -float wave_square(float x) { - return (fract(x) < 0.5) ? 0.0 : 1.0; -} - -float mix_multiply(float x, float y) { - return x*y; -} - -float mix_add(float x, float y) { - return min(x+y, 1.0); -} - -float mix_max(float x, float y) { - return max(x, y); -} - -float mix_min(float x, float y) { - return min(x, y); -} - -float mix_min(float x, float y) { - return min(x, y); -} - -float mix_xor(float x, float y) { - return min(x+y, 2.0-x-y); -} - -float mix_pow(float x, float y) { - return pow(x, y); -} - -vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*c1 + (1.0-opacity)*c2; -} - -vec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) { - if (rand(uv) < opacity) { - return c1; - } else { - return c2; - } -} - -vec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*c1*c2 + (1.0-opacity)*c2; -} - -vec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2; -} - -float blend_overlay_f(float c1, float c2) { - return (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2)); -} - -vec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2; -} - -vec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2; -} - -float blend_soft_light_f(float c1, float c2) { - return (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0); -} - -vec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2; -} - -float blend_burn_f(float c1, float c2) { - return (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0); -} - -vec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2; -} - -float blend_dodge_f(float c1, float c2) { - return (c1==1.0)?c1:min(c2/(1.0-c1),1.0); -} - -vec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2; -} - -vec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*max(c1, c2) + (1.0-opacity)*c2; -} - -vec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) { - return opacity*min(c1, c2) + (1.0-opacity)*c2; -} - -vec2 transform(vec2 uv, vec2 translate, float rotate, float scale) { - vec2 rv; - uv -= vec2(0.5); - rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y; - rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y; - rv /= scale; - rv += vec2(0.5); - rv -= translate; - return rv; -} - -float bricks(vec2 uv, vec2 count, float offset, float mortar, float bevel) { - mortar /= max(count.x, count.y); - bevel /= max(count.x, count.y); - float fract_x = fract(uv.x*count.x+offset*step(0.5, fract(uv.y*count.y*0.5))); - float slope_x = 1.0/(bevel*count.x); - float off = 0.5*mortar/bevel; - float f1 = fract_x*slope_x-off; - float f2 = (1.0-fract_x)*slope_x-off; - float fract_y = fract(uv.y*count.y); - float slope_y = 1.0/(bevel*count.y); - float f3 = fract_y*slope_y-off; - float f4 = (1.0-fract_y)*slope_y-off; - return max(0.0, min(1.0, min(min(f1, f2), min(f3, f4)))); -} - -float colored_bricks(vec2 uv, vec2 count, float offset) { - float x = floor(uv.x*count.x+offset*step(0.5, fract(uv.y*count.y*0.5))); - float y = floor(uv.y*count.y); - return fract(x/3.0+y/7.0); -} - -float perlin(vec2 uv, vec2 size, int iterations, float persistence, int seed) { - uv += vec2(float(seed)*0.1234567); - float rv = 0.0; - float coef = 1.0; - float acc = 0.0; - for (int i = 0; i < iterations; ++i) { - vec2 step = vec2(1.0)/size; - float f0 = rand(floor(fract(uv)*size)); - float f1 = rand(floor(fract(uv+vec2(step.x, 0.0))*size)); - float f2 = rand(floor(fract(uv+vec2(0.0, step.y))*size)); - float f3 = rand(floor(fract(uv+vec2(step.x, step.y))*size)); - vec2 mixval = fract(uv*size); - mixval = 0.5*(1.0-cos(3.1415928*mixval)); - rv += coef * mix(mix(f0, f1, mixval.x), mix(f2, f3, mixval.x), mixval.y); - acc += coef; - size *= 2.0; - coef *= persistence; - } - - return rv / acc; -} - -vec4 voronoi(vec2 uv, vec2 size, float intensity, int seed) { - uv += vec2(float(seed)*0.1234567); - uv *= size; - float best_distance0 = 1.0; - float best_distance1 = 1.0; - vec2 point0; - vec2 point1; - vec2 p0 = floor(uv); - for (int dx = -1; dx < 2; ++dx) { - for (int dy = -1; dy < 2; ++dy) { - vec2 d = vec2(float(dx), float(dy)); - vec2 p = p0+d; - p += rand2(mod(p, size)); - float distance = length((uv - p) / size); - if (best_distance0 > distance) { - best_distance1 = best_distance0; - best_distance0 = distance; - point1 = point0; - point0 = p; - } else if (best_distance1 > distance) { - best_distance1 = distance; - point1 = p; - } - } - } - float edge_distance = dot(uv - 0.5*(point0+point1), normalize(point0-point1)); - - return vec4(point0, best_distance0*length(size)*intensity, edge_distance); -} - -float Perlin_f(vec2 uv) { return perlin(uv, vec2(4.000000, 4.000000), 6, 0.500000000, 2375); } -float Bricks_f(vec2 uv) { return bricks(uv, vec2(3, 6), 0.5, 0.05, 0.2); } -vec3 colorize_3_gradient(float x) { - if (x < 0.000000000) { - return vec3(0.273438007,0.273438007,0.273438007); - } else if (x < 1.000000000) { - return vec3(0.273438007,0.273438007,0.273438007)+x*vec3(-0.273438007,-0.273438007,-0.273438007); - } - return vec3(0.000000000,0.000000000,0.000000000); -} -void fragment() { -float Perlin_0_f = Perlin_f(UV+vec2(0.01, 0.0)); -float Perlin_1_f = Perlin_f(UV-vec2(0.01, 0.0)); -float Perlin_2_f = Perlin_f(UV+vec2(0.0, 0.01)); -float Perlin_3_f = Perlin_f(UV-vec2(0.0, 0.01)); -vec2 Warp_0_uv = UV+0.100000001*vec2((Perlin_0_f)-(Perlin_1_f), (Perlin_2_f)-(Perlin_3_f)); -float Bricks_0_f = Bricks_f(Warp_0_uv); -vec3 Warp_0_rgb = vec3(Bricks_0_f); -float Warp_0_f = dot(vec3(Bricks_0_f), vec3(1.0))/3.0; -vec3 colorize_3_0_rgb = colorize_3_gradient(Warp_0_f); -COLOR = vec4(colorize_3_0_rgb, 1.0); -} -" - -[sub_resource type="ShaderMaterial" id=2] - -render_priority = 0 -shader = SubResource( 1 ) - -[sub_resource type="Animation" id=3] +[sub_resource type="Animation" id=1] length = 1.0 loop = true @@ -261,7 +23,7 @@ tracks/0/keys = { "values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ] } -[sub_resource type="ArrayMesh" id=4] +[sub_resource type="ArrayMesh" id=2] blend_shape_mode = 1 custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) @@ -279,7 +41,7 @@ surfaces/0 = { } _sections_unfolded = [ "surface_1" ] -[sub_resource type="SpatialMaterial" id=5] +[sub_resource type="SpatialMaterial" id=3] render_priority = 0 flags_transparent = false @@ -333,7 +95,7 @@ proximity_fade_enable = false distance_fade_enable = false _sections_unfolded = [ "Depth", "Metallic" ] -[sub_resource type="ArrayMesh" id=6] +[sub_resource type="ArrayMesh" id=4] blend_shape_mode = 1 custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) @@ -350,15 +112,15 @@ surfaces/0 = { } _sections_unfolded = [ "surface_1" ] -[sub_resource type="PanoramaSky" id=7] +[sub_resource type="PanoramaSky" id=5] radiance_size = 2 -panorama = ExtResource( 5 ) +panorama = ExtResource( 4 ) -[sub_resource type="Environment" id=8] +[sub_resource type="Environment" id=6] background_mode = 2 -background_sky = SubResource( 7 ) +background_sky = SubResource( 5 ) background_sky_custom_fov = 0.0 background_color = Color( 0, 0, 0, 1 ) background_energy = 1.0 @@ -435,7 +197,7 @@ adjustment_contrast = 1.0 adjustment_saturation = 1.0 _sections_unfolded = [ "Background" ] -[sub_resource type="Shader" id=9] +[sub_resource type="Shader" id=7] code = "shader_type canvas_item; @@ -445,12 +207,12 @@ void fragment() { " _sections_unfolded = [ "Resource" ] -[sub_resource type="ShaderMaterial" id=10] +[sub_resource type="ShaderMaterial" id=8] render_priority = 0 -shader = SubResource( 9 ) +shader = SubResource( 7 ) -[sub_resource type="Animation" id=11] +[sub_resource type="Animation" id=9] length = 0.2 loop = false @@ -492,7 +254,7 @@ tracks/2/keys = { "values": [ 0 ] } -[sub_resource type="Animation" id=12] +[sub_resource type="Animation" id=10] length = 0.2 loop = false @@ -552,95 +314,7 @@ custom_constants/margin_left = 0 script = ExtResource( 1 ) _sections_unfolded = [ "Rect" ] -[node name="GraphEdit" type="GraphEdit" parent="." index="0"] - -self_modulate = Color( 1, 1, 1, 0 ) -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 1280.0 -margin_bottom = 718.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -right_disconnects = true -scroll_offset = Vector2( 0, 0 ) -snap_distance = 20 -use_snap = false -zoom = 1.0 -script = ExtResource( 2 ) -_sections_unfolded = [ "Material", "Mouse", "Visibility" ] - -[node name="Material" parent="GraphEdit" index="0" instance=ExtResource( 3 )] - -margin_right = 111.0 -margin_bottom = 118.0 -_sections_unfolded = [ "Anchor", "Margin", "Mouse", "Theme", "slot", "slot/2", "slot/3", "slot/4", "slot/5" ] - -[node name="Timer" type="Timer" parent="GraphEdit" index="1"] - -process_mode = 1 -wait_time = 0.1 -one_shot = true -autostart = false - -[node name="SaveViewport" type="Viewport" parent="GraphEdit" index="2"] - -editor/display_folded = true -arvr = false -size = Vector2( 0, 0 ) -own_world = true -world = null -transparent_bg = false -msaa = 2 -hdr = false -disable_3d = false -usage = 2 -debug_draw = 0 -render_target_v_flip = true -render_target_clear_mode = 0 -render_target_update_mode = 1 -audio_listener_enable_2d = false -audio_listener_enable_3d = false -physics_object_picking = false -gui_disable_input = true -gui_snap_controls_to_pixels = true -shadow_atlas_size = 0 -shadow_atlas_quad_0 = 2 -shadow_atlas_quad_1 = 2 -shadow_atlas_quad_2 = 3 -shadow_atlas_quad_3 = 4 -_sections_unfolded = [ "GUI", "Render Target", "Rendering" ] - -[node name="ColorRect" type="ColorRect" parent="GraphEdit/SaveViewport" index="0"] - -material = SubResource( 2 ) -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 40.0 -margin_bottom = 40.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -color = Color( 1, 1, 1, 1 ) -_sections_unfolded = [ "Material", "Rect" ] - -[node name="Timer" type="Timer" parent="GraphEdit/SaveViewport" index="1"] - -process_mode = 1 -wait_time = 0.1 -one_shot = true -autostart = false +[node name="GraphEdit" parent="." index="0" instance=ExtResource( 2 )] [node name="Preview" type="Container" parent="." index="1"] @@ -677,7 +351,7 @@ size_flags_horizontal = 1 size_flags_vertical = 1 stretch = false stretch_shrink = 1 -script = ExtResource( 4 ) +script = ExtResource( 3 ) _sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Mouse", "Rect" ] [node name="ObjectRotate" type="AnimationPlayer" parent="Preview/Preview" index="0"] @@ -687,7 +361,7 @@ autoplay = "rotate" playback_process_mode = 1 playback_default_blend_time = 0.0 playback_speed = 0.1 -anims/rotate = SubResource( 3 ) +anims/rotate = SubResource( 1 ) blend_times = [ ] _sections_unfolded = [ "Playback Options" ] @@ -720,7 +394,7 @@ _sections_unfolded = [ "GUI", "Render Target" ] [node name="Objects" type="Spatial" parent="Preview/Preview/MaterialPreview" index="0"] -transform = Transform( -0.0754918, 0, -0.997143, 0, 1, 0, 0.997143, 0, -0.0754918, 0, 0, 0 ) +transform = Transform( 0.305445, 0, 0.952206, 0, 1, 0, -0.952206, 0, 0.305445, 0, 0, 0 ) _sections_unfolded = [ "Transform" ] [node name="Cube" type="MeshInstance" parent="Preview/Preview/MaterialPreview/Objects" index="0"] @@ -734,9 +408,9 @@ lod_min_distance = 0.0 lod_min_hysteresis = 0.0 lod_max_distance = 0.0 lod_max_hysteresis = 0.0 -mesh = SubResource( 4 ) +mesh = SubResource( 2 ) skeleton = NodePath("..") -material/0 = SubResource( 5 ) +material/0 = SubResource( 3 ) _sections_unfolded = [ "Geometry", "Transform", "material" ] [node name="Cylinder" type="MeshInstance" parent="Preview/Preview/MaterialPreview/Objects" index="1"] @@ -751,9 +425,9 @@ lod_min_distance = 0.0 lod_min_hysteresis = 0.0 lod_max_distance = 0.0 lod_max_hysteresis = 0.0 -mesh = SubResource( 6 ) +mesh = SubResource( 4 ) skeleton = NodePath("..") -material/0 = SubResource( 5 ) +material/0 = SubResource( 3 ) _sections_unfolded = [ "Geometry", "Transform", "material" ] [node name="OmniLight" type="OmniLight" parent="Preview/Preview/MaterialPreview" index="1"] @@ -784,7 +458,7 @@ _sections_unfolded = [ "Shadow" ] transform = Transform( 1, 0, 0, 0, 0.766044, 0.642787, 0, -0.642787, 0.766044, 0, 1.83022, 2.2549 ) keep_aspect = 1 cull_mask = 1048575 -environment = SubResource( 8 ) +environment = SubResource( 6 ) h_offset = 0.0 v_offset = 0.0 doppler_tracking = 0 @@ -798,7 +472,7 @@ _sections_unfolded = [ "Transform" ] [node name="WorldEnvironment" type="WorldEnvironment" parent="Preview/Preview/MaterialPreview" index="3"] -environment = SubResource( 8 ) +environment = SubResource( 6 ) [node name="Model" type="OptionButton" parent="Preview/Preview" index="2"] @@ -858,7 +532,7 @@ selected = 3 [node name="SelectedPreview" type="ColorRect" parent="Preview/Preview" index="4"] -material = SubResource( 10 ) +material = SubResource( 8 ) anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -884,22 +558,16 @@ autoplay = "" playback_process_mode = 1 playback_default_blend_time = 0.0 playback_speed = 1.0 -anims/maximize = SubResource( 11 ) -anims/minimize = SubResource( 12 ) +anims/maximize = SubResource( 9 ) +anims/minimize = SubResource( 10 ) blend_times = [ ] -[connection signal="connection_request" from="GraphEdit" to="GraphEdit" method="_on_GraphEdit_connection_request"] - -[connection signal="disconnection_request" from="GraphEdit" to="GraphEdit" method="_on_GraphEdit_disconnection_request"] - [connection signal="graph_changed" from="GraphEdit" to="." method="generate_shader"] [connection signal="node_selected" from="GraphEdit" to="." method="_on_GraphEdit_node_selected"] [connection signal="popup_request" from="GraphEdit" to="." method="_on_GraphEdit_popup_request"] -[connection signal="timeout" from="GraphEdit/Timer" to="GraphEdit" method="do_send_changed_signal"] - [connection signal="item_selected" from="Preview/Preview/Model" to="Preview/Preview" method="_on_Model_item_selected"] [connection signal="item_selected" from="Preview/Preview/Environment" to="Preview/Preview" method="_on_Environment_item_selected"] diff --git a/addons/procedural_material/widgets/gradient_editor.gd b/addons/procedural_material/widgets/gradient_editor.gd index 71220ff..8b7f554 100644 --- a/addons/procedural_material/widgets/gradient_editor.gd +++ b/addons/procedural_material/widgets/gradient_editor.gd @@ -61,6 +61,7 @@ var active_cursor func select_color(cursor, position): active_cursor = cursor + $Gradient/Popup/ColorPicker.color = cursor.color $Gradient/Popup/ColorPicker.connect("color_changed", cursor, "set_color") $Gradient/Popup.rect_position = position $Gradient/Popup.popup() diff --git a/addons/procedural_material/widgets/gradient_editor.tscn b/addons/procedural_material/widgets/gradient_editor.tscn index 2f3a876..7463d82 100644 --- a/addons/procedural_material/widgets/gradient_editor.tscn +++ b/addons/procedural_material/widgets/gradient_editor.tscn @@ -86,8 +86,8 @@ anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 4.0 margin_top = 4.0 -margin_right = 302.0 -margin_bottom = 438.0 +margin_right = 4.0 +margin_bottom = 4.0 rect_scale = Vector2( 0.75, 0.75 ) rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false diff --git a/examples/bricks.ptex b/examples/bricks.ptex index f30e6e7..2963211 100644 --- a/examples/bricks.ptex +++ b/examples/bricks.ptex @@ -1 +1 @@ -{"connections":[{"from":"Perlin","from_port":0,"to":"Warp","to_port":1},{"from":"Warp","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_2","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":2},{"from":"colorize_2","from_port":0,"to":"colorize_5","to_port":0},{"from":"colorize_5","from_port":0,"to":"Material","to_port":1},{"from":"Bricks","from_port":0,"to":"Warp","to_port":0},{"from":"blend_1","from_port":0,"to":"colorize_1","to_port":0},{"from":"Bricks","from_port":1,"to":"blend_1","to_port":1},{"from":"Warp","from_port":0,"to":"blend_2","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_2","to_port":1},{"from":"blend_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"blend_2","from_port":0,"to":"colorize_6","to_port":0},{"from":"colorize_6","from_port":0,"to":"normal_map_0","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_1","to_port":0},{"from":"Perlin","from_port":0,"to":"colorize_0","to_port":0}],"nodes":[{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_5","node_position":{"x":837,"y":157},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_0","node_position":{"x":560.943665,"y":50},"type":"colorize"},{"gradient":[{"b":0.0016,"g":0.0016,"pos":0,"r":0.307292},{"b":0,"g":0.180135,"pos":0.2,"r":0.606771},{"b":0,"g":0,"pos":0.363636,"r":0.3125},{"b":0,"g":0.19869,"pos":0.572727,"r":0.669271},{"b":0.019368,"g":0.060224,"pos":0.736364,"r":0.309896},{"b":0,"g":0.180135,"pos":1,"r":0.606771}],"name":"colorize_1","node_position":{"x":562.943665,"y":-65},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0.273438,"g":0.273438,"pos":1,"r":0.273438}],"name":"colorize_3","node_position":{"x":763,"y":373},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.1,"r":1}],"name":"colorize_2","node_position":{"x":535.943665,"y":163},"type":"colorize"},{"amount":0.5,"blend_type":6,"name":"blend_1","node_position":{"x":350,"y":244},"type":"blend"},{"bevel":0.2,"columns":3,"mortar":0.05,"name":"Bricks","node_position":{"x":118,"y":-22},"row_offset":0.5,"rows":6,"type":"bricks"},{"amount":0.04,"name":"Warp","node_position":{"x":384,"y":10.75},"type":"warp"},{"name":"Material","node_position":{"x":1081,"y":208},"type":"material"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":925,"y":305},"type":"normal_map"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_6","node_position":{"x":743,"y":291},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_2","node_position":{"x":536,"y":331},"type":"blend"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0.463542,"g":0.463542,"pos":1,"r":0.463542}],"name":"colorize_4","node_position":{"x":708,"y":224},"type":"colorize"},{"iterations":6,"name":"Perlin","node_position":{"x":107,"y":170},"persistence":0.85,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":836.943726,"y":-71},"type":"blend"}]} \ No newline at end of file +{"connections":[{"from":"Perlin","from_port":0,"to":"Warp","to_port":1},{"from":"Warp","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_2","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":2},{"from":"colorize_2","from_port":0,"to":"colorize_5","to_port":0},{"from":"colorize_5","from_port":0,"to":"Material","to_port":1},{"from":"Bricks","from_port":0,"to":"Warp","to_port":0},{"from":"blend_1","from_port":0,"to":"colorize_1","to_port":0},{"from":"Bricks","from_port":1,"to":"blend_1","to_port":1},{"from":"Warp","from_port":0,"to":"blend_2","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_2","to_port":1},{"from":"blend_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"blend_2","from_port":0,"to":"colorize_6","to_port":0},{"from":"colorize_6","from_port":0,"to":"normal_map_0","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_1","to_port":0},{"from":"Perlin","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_3","from_port":0,"to":"Material","to_port":5}],"nodes":[{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_5","node_position":{"x":837,"y":157},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_0","node_position":{"x":560.943665,"y":50},"type":"colorize"},{"gradient":[{"b":0.0016,"g":0.0016,"pos":0,"r":0.307292},{"b":0,"g":0.180135,"pos":0.2,"r":0.606771},{"b":0,"g":0,"pos":0.354545,"r":0.3125},{"b":0,"g":0.19869,"pos":0.563636,"r":0.669271},{"b":0.019368,"g":0.060224,"pos":0.736364,"r":0.309896},{"b":0,"g":0.180135,"pos":1,"r":0.606771}],"name":"colorize_1","node_position":{"x":562.943665,"y":-65},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.1,"r":1}],"name":"colorize_2","node_position":{"x":535.943665,"y":163},"type":"colorize"},{"amount":0.5,"blend_type":6,"name":"blend_1","node_position":{"x":350,"y":244},"type":"blend"},{"bevel":0.2,"columns":3,"mortar":0.05,"name":"Bricks","node_position":{"x":118,"y":-22},"row_offset":0.5,"rows":6,"type":"bricks"},{"amount":0.04,"name":"Warp","node_position":{"x":384,"y":10.75},"type":"warp"},{"name":"Material","node_position":{"x":1081,"y":208},"type":"material"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":925,"y":305},"type":"normal_map"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_6","node_position":{"x":743,"y":291},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_2","node_position":{"x":536,"y":331},"type":"blend"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0.463542,"g":0.463542,"pos":1,"r":0.463542}],"name":"colorize_4","node_position":{"x":708,"y":224},"type":"colorize"},{"iterations":6,"name":"Perlin","node_position":{"x":107,"y":170},"persistence":0.85,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":836.943726,"y":-71},"type":"blend"},{"gradient":[{"b":0.289063,"g":0.289063,"pos":0,"r":0.289063},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":774,"y":400},"type":"colorize"}]} \ No newline at end of file diff --git a/examples/wood_with_blood.ptex b/examples/wood_with_blood.ptex index 19ad47d..beb016d 100644 --- a/examples/wood_with_blood.ptex +++ b/examples/wood_with_blood.ptex @@ -1 +1 @@ -{"connections":[{"from":"bricks_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":1},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"blend_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_1","to_port":1},{"from":"perlin_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"blend_1","to_port":2},{"from":"blend_1","from_port":0,"to":"Material","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_2","to_port":1},{"from":"colorize_3","from_port":0,"to":"blend_2","to_port":0},{"from":"blend_2","from_port":0,"to":"Material","to_port":2},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_3","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":1}],"nodes":[{"gradient":[{"b":0.690104,"g":0.690104,"pos":0,"r":0.690104},{"b":0.492188,"g":0.492188,"pos":1,"r":0.492188}],"name":"colorize_1","node_position":{"x":495.633789,"y":220.5},"type":"colorize"},{"name":"Material","node_position":{"x":938,"y":96},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0.490909,"r":0},{"b":1,"g":1,"pos":0.618182,"r":1}],"name":"colorize_3","node_position":{"x":487.633789,"y":65},"type":"colorize"},{"iterations":6,"name":"perlin_0","node_position":{"x":12,"y":225.5},"persistence":0.7,"scale_x":20,"scale_y":3,"type":"perlin"},{"bevel":0,"columns":5,"mortar":0.05,"name":"bricks_0","node_position":{"x":-1,"y":30.5},"row_offset":0.5,"rows":1,"type":"bricks"},{"gradient":[{"b":0,"g":0.336914,"pos":0,"r":0.598958},{"b":0,"g":0.454102,"pos":0.118182,"r":0.807292},{"b":0,"g":0.37793,"pos":0.245455,"r":0.671875},{"b":0,"g":0.427734,"pos":0.354545,"r":0.760417},{"b":0.017795,"g":0.488254,"pos":0.527273,"r":0.854167},{"b":0,"g":0.37793,"pos":0.645455,"r":0.671875},{"b":0,"g":0.439453,"pos":0.845455,"r":0.78125},{"b":0,"g":0.357422,"pos":1,"r":0.635417}],"name":"colorize_0","node_position":{"x":472,"y":-41.5},"type":"colorize"},{"amount":1,"blend_type":2,"name":"blend_0","node_position":{"x":271,"y":306.5},"type":"blend"},{"iterations":7,"name":"perlin_1","node_position":{"x":110.633789,"y":-143.5},"persistence":0.55,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.55,"blend_type":0,"name":"blend_2","node_position":{"x":690.633789,"y":201.5},"type":"blend"},{"iterations":6,"name":"perlin_2","node_position":{"x":232.633789,"y":40},"persistence":0.65,"scale_x":4,"scale_y":4,"type":"perlin"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0.515625},{"b":0,"g":0,"pos":0.145455,"r":0.25},{"b":0,"g":0,"pos":0.445455,"r":0.515625},{"b":0.007871,"g":0.007871,"pos":0.745455,"r":0.144176},{"b":0,"g":0,"pos":1,"r":0.322917}],"name":"colorize_2","node_position":{"x":487.633789,"y":-144.5},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_4","node_position":{"x":732,"y":116},"type":"colorize"},{"amount":0.4,"name":"normal_map_0","node_position":{"x":724.633789,"y":345.5},"type":"normal_map"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":707.633789,"y":-68},"type":"blend"}]} \ No newline at end of file +{"connections":[{"from":"bricks_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":1},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"blend_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_1","to_port":1},{"from":"perlin_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"blend_1","to_port":2},{"from":"blend_1","from_port":0,"to":"Material","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_2","to_port":1},{"from":"colorize_3","from_port":0,"to":"blend_2","to_port":0},{"from":"blend_2","from_port":0,"to":"Material","to_port":2},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_3","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":1},{"from":"blend_0","from_port":0,"to":"colorize_5","to_port":0},{"from":"colorize_5","from_port":0,"to":"normal_map_0","to_port":0}],"nodes":[{"gradient":[{"b":0.828125,"g":0.828125,"pos":0,"r":0.828125},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_1","node_position":{"x":495.633789,"y":220.5},"type":"colorize"},{"name":"Material","node_position":{"x":938,"y":96},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0.581818,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_3","node_position":{"x":487.633789,"y":65},"type":"colorize"},{"iterations":6,"name":"perlin_0","node_position":{"x":12,"y":225.5},"persistence":0.7,"scale_x":20,"scale_y":3,"type":"perlin"},{"bevel":0,"columns":5,"mortar":0.05,"name":"bricks_0","node_position":{"x":-1,"y":30.5},"row_offset":0.5,"rows":1,"type":"bricks"},{"gradient":[{"b":0,"g":0.336914,"pos":0,"r":0.598958},{"b":0,"g":0.454102,"pos":0.118182,"r":0.807292},{"b":0,"g":0.37793,"pos":0.245455,"r":0.671875},{"b":0,"g":0.427734,"pos":0.345455,"r":0.760417},{"b":0.017795,"g":0.488254,"pos":0.527273,"r":0.854167},{"b":0,"g":0.37793,"pos":0.645455,"r":0.671875},{"b":0,"g":0.439453,"pos":0.845455,"r":0.78125},{"b":0,"g":0.357422,"pos":1,"r":0.635417}],"name":"colorize_0","node_position":{"x":472,"y":-41.5},"type":"colorize"},{"iterations":7,"name":"perlin_1","node_position":{"x":110.633789,"y":-143.5},"persistence":0.55,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.55,"blend_type":0,"name":"blend_2","node_position":{"x":690.633789,"y":201.5},"type":"blend"},{"iterations":6,"name":"perlin_2","node_position":{"x":232.633789,"y":40},"persistence":0.65,"scale_x":4,"scale_y":4,"type":"perlin"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0.515625},{"b":0,"g":0,"pos":0.145455,"r":0.25},{"b":0,"g":0,"pos":0.445455,"r":0.515625},{"b":0.007871,"g":0.007871,"pos":0.745455,"r":0.144176},{"b":0,"g":0,"pos":1,"r":0.322917}],"name":"colorize_2","node_position":{"x":487.633789,"y":-144.5},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_4","node_position":{"x":732,"y":116},"type":"colorize"},{"amount":0.4,"name":"normal_map_0","node_position":{"x":724.633789,"y":345.5},"type":"normal_map"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":707.633789,"y":-68},"type":"blend"},{"amount":1,"blend_type":2,"name":"blend_0","node_position":{"x":271,"y":306.5},"type":"blend"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_5","node_position":{"x":503,"y":336.5},"type":"colorize"}]} \ No newline at end of file diff --git a/main_window.tscn b/main_window.tscn new file mode 100644 index 0000000..ace0be6 --- /dev/null +++ b/main_window.tscn @@ -0,0 +1,164 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/procedural_material/graph_edit.tscn" type="PackedScene" id=1] + +[node name="PanelContainer" type="Panel"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +_sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Rect", "Size Flags", "custom_constants" ] + +[node name="VBoxContainer" type="VBoxContainer" parent="." index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 0 +_sections_unfolded = [ "Anchor", "Margin", "Size Flags" ] + +[node name="Menu" type="HBoxContainer" parent="VBoxContainer" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 1280.0 +margin_bottom = 20.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 + +[node name="FileMenu" type="MenuButton" parent="VBoxContainer/Menu" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 35.0 +margin_bottom = 20.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 0 +shortcut = null +group = null +text = "File" +flat = true +align = 1 +items = [ ] + +[node name="HelpMenu" type="MenuButton" parent="VBoxContainer/Menu" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 39.0 +margin_right = 81.0 +margin_bottom = 20.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 0 +shortcut = null +group = null +text = "Help" +flat = true +align = 1 +items = [ ] + +[node name="HBoxContainer" type="HSplitContainer" parent="VBoxContainer" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 24.0 +margin_right = 1280.0 +margin_bottom = 720.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 3 +split_offset = 0 +collapsed = false +dragger_visibility = 0 +_sections_unfolded = [ "Size Flags" ] + +[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 100.0 +margin_bottom = 696.0 +rect_min_size = Vector2( 100, 100 ) +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +_sections_unfolded = [ "Rect" ] + +[node name="Projects" type="TabContainer" parent="VBoxContainer/HBoxContainer" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 112.0 +margin_right = 1280.0 +margin_bottom = 696.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 3 +tab_align = 0 +tabs_visible = true +_sections_unfolded = [ "Size Flags" ] + +[node name="blah" parent="VBoxContainer/HBoxContainer/Projects" index="0" instance=ExtResource( 1 )] + +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 32.0 +margin_right = -4.0 +margin_bottom = -4.0 + +