mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
Updated 2D preview for transparent textures and added 2D preview in graph pane
This commit is contained in:
parent
2d23f7d05f
commit
1f4e0adb39
@ -15,16 +15,16 @@
|
||||
viewBox="0 0 128 128"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
sodipodi:docname="icons.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="-18.04226 : 31.214068 : 1"
|
||||
inkscape:vp_x="-18.239991 : 95.476607 : 1"
|
||||
inkscape:vp_y="0 : 1122.4747 : 0"
|
||||
inkscape:vp_z="139.87989 : 43.976074 : 1"
|
||||
inkscape:persp3d-origin="55.733336 : 19.241004 : 1"
|
||||
inkscape:vp_z="139.68216 : 108.23861 : 1"
|
||||
inkscape:persp3d-origin="55.535605 : 83.503543 : 1"
|
||||
id="perspective4586" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
@ -55,9 +55,9 @@
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="20.229515"
|
||||
inkscape:cx="12.288977"
|
||||
inkscape:cy="55.740147"
|
||||
inkscape:zoom="10.114758"
|
||||
inkscape:cx="100.19195"
|
||||
inkscape:cy="20.027892"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
@ -469,43 +469,43 @@
|
||||
id="path4590"
|
||||
style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="6"
|
||||
d="m 97.975657,255.32605 v 18.88926 l 11.825353,-10.75878 v -13.55872 z"
|
||||
points="97.975657,274.21531 109.80101,263.45653 109.80101,249.89781 97.975657,255.32605 " />
|
||||
d="m 97.777926,255.06351 v 18.88926 l 11.825354,-10.75878 v -13.55872 z"
|
||||
points="97.777926,273.95277 109.60328,263.19399 109.60328,249.63527 97.777926,255.06351 " />
|
||||
<path
|
||||
sodipodi:type="inkscape:box3dside"
|
||||
id="path4599"
|
||||
style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="13"
|
||||
d="m 97.975657,274.21531 21.760763,4.75713 6.41132,-13.64857 -16.34673,-1.86734 z"
|
||||
points="119.73642,278.97244 126.14774,265.32387 109.80101,263.45653 97.975657,274.21531 " />
|
||||
d="m 97.777926,273.95277 21.760764,4.75713 6.41132,-13.64857 -16.34673,-1.86734 z"
|
||||
points="119.53869,278.7099 125.95001,265.06133 109.60328,263.19399 97.777926,273.95277 " />
|
||||
<path
|
||||
sodipodi:type="inkscape:box3dside"
|
||||
id="path4601"
|
||||
style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="11"
|
||||
d="m 109.80101,249.89781 16.34673,0.13364 v 15.29242 l -16.34673,-1.86734 z"
|
||||
points="126.14774,250.03145 126.14774,265.32387 109.80101,263.45653 109.80101,249.89781 " />
|
||||
d="m 109.60328,249.63527 16.34673,0.13365 v 15.29241 l -16.34673,-1.86734 z"
|
||||
points="125.95001,249.76892 125.95001,265.06133 109.60328,263.19399 109.60328,249.63527 " />
|
||||
<path
|
||||
sodipodi:type="inkscape:box3dside"
|
||||
id="path4592"
|
||||
style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="5"
|
||||
d="m 97.975657,255.32605 21.760763,1.21418 6.41132,-6.50878 -16.34673,-0.13364 z"
|
||||
points="119.73642,256.54023 126.14774,250.03145 109.80101,249.89781 97.975657,255.32605 " />
|
||||
d="m 97.777926,255.06351 21.760764,1.21418 6.41132,-6.50877 -16.34673,-0.13365 z"
|
||||
points="119.53869,256.27769 125.95001,249.76892 109.60328,249.63527 97.777926,255.06351 " />
|
||||
<path
|
||||
sodipodi:type="inkscape:box3dside"
|
||||
id="path4596"
|
||||
style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="14"
|
||||
d="m 119.73642,256.54023 v 22.43221 l 6.41132,-13.64857 v -15.29242 z"
|
||||
points="119.73642,278.97244 126.14774,265.32387 126.14774,250.03145 119.73642,256.54023 " />
|
||||
d="m 119.53869,256.27769 v 22.43221 l 6.41132,-13.64857 v -15.29241 z"
|
||||
points="119.53869,278.7099 125.95001,265.06133 125.95001,249.76892 119.53869,256.27769 " />
|
||||
<path
|
||||
sodipodi:type="inkscape:box3dside"
|
||||
id="path4594"
|
||||
style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-width:1.13750851px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
inkscape:box3dsidetype="3"
|
||||
d="m 97.975657,255.32605 21.760763,1.21418 v 22.43221 l -21.760763,-4.75713 z"
|
||||
points="119.73642,256.54023 119.73642,278.97244 97.975657,274.21531 97.975657,255.32605 " />
|
||||
d="m 97.777926,255.06351 21.760764,1.21418 v 22.43221 l -21.760764,-4.75713 z"
|
||||
points="119.53869,256.27769 119.53869,278.7099 97.777926,273.95277 97.777926,255.06351 " />
|
||||
</g>
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.34946194px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
@ -540,5 +540,58 @@
|
||||
d="M 23.974609 64.923828 A 6.9700141 6.9700141 0 0 0 17.003906 71.894531 A 6.9700141 6.9700141 0 0 0 23.974609 78.863281 A 6.9700141 6.9700141 0 0 0 30.945312 71.894531 A 6.9700141 6.9700141 0 0 0 23.974609 64.923828 z M 23.974609 67.494141 A 4.4003119 4.4003119 0 0 1 28.375 71.894531 A 4.4003119 4.4003119 0 0 1 23.974609 76.294922 A 4.4003119 4.4003119 0 0 1 19.574219 71.894531 A 4.4003119 4.4003119 0 0 1 23.974609 67.494141 z "
|
||||
transform="translate(0,216.06665)"
|
||||
id="path897" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect897"
|
||||
width="28.077785"
|
||||
height="28.86871"
|
||||
x="98.074524"
|
||||
y="313.61609"
|
||||
ry="2.1750398" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 98.667714,336.65174 h 26.990266 l -0.19773,-0.0989"
|
||||
id="path899"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path901"
|
||||
d="m 98.469983,319.15256 h 26.990267 l -0.19773,-0.0989"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 98.371118,324.98562 h 26.990262 l -0.19773,-0.0989"
|
||||
id="path903"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path905"
|
||||
d="m 98.667714,330.81868 h 26.990266 l -0.19773,-0.0989"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 114.23828 98.242188 L 114.23828 102.69141 L 114.23828 98.242188 z M 122.79102 98.242188 L 122.79102 102.69141 L 122.79102 98.242188 z M 105.6875 98.339844 L 105.6875 102.78906 L 105.6875 98.339844 z "
|
||||
transform="translate(0,216.06665)"
|
||||
id="path907" />
|
||||
<path
|
||||
id="path914"
|
||||
d="m 114.23828,324.98631 v 5.90037 z m 8.55274,0 v 5.90037 z m -17.10352,0.12943 v 5.90037 z"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.15158939px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.15158939px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 109.8882,330.62164 v 5.90037 z m 8.55274,0 v 5.90037 z m -17.10352,0.12943 v 5.90037 z"
|
||||
id="path916" />
|
||||
<path
|
||||
id="path918"
|
||||
d="m 109.78933,319.15325 v 5.90037 z m 8.55274,0 v 5.90037 z m -17.10352,0.12943 v 5.90037 z"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.15158939px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.15158939px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 114.33714,336.4547 v 5.90037 z m 8.55274,0 v 5.90037 z m -17.10352,0.12943 v 5.90037 z"
|
||||
id="path920" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 39 KiB |
@ -16,6 +16,8 @@ onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library
|
||||
onready var preview_2d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D
|
||||
onready var preview_3d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D
|
||||
|
||||
onready var preview_2d_background = $VBoxContainer/HBoxContainer/ProjectsPane/Preview2D
|
||||
|
||||
const RECENT_FILES_COUNT = 15
|
||||
|
||||
const THEMES = [ "Dark", "Default", "Light" ]
|
||||
@ -507,8 +509,10 @@ func update_preview_2d(node = null) -> void:
|
||||
result.copy_to_texture(tex)
|
||||
result.release()
|
||||
preview_2d.set_preview_texture(tex)
|
||||
preview_2d_background.set_preview_texture(tex)
|
||||
else:
|
||||
preview_2d.set_preview_texture(null)
|
||||
preview_2d_background.set_preview_texture(null)
|
||||
|
||||
func update_preview_3d(previews : Array) -> void:
|
||||
var graph_edit : MMGraphEdit = get_current_graph_edit()
|
||||
@ -554,6 +558,17 @@ func dim_window() -> void:
|
||||
# (it won't respond to user input in this state).
|
||||
modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
func show_background_preview(button_pressed):
|
||||
func show_background_preview_2d(button_pressed):
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/Preview2D.visible = button_pressed
|
||||
if button_pressed:
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton.pressed = false
|
||||
|
||||
func show_background_preview_3d(button_pressed):
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/Preview3D.visible = button_pressed
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer.visible = button_pressed
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel.visible = button_pressed
|
||||
if button_pressed:
|
||||
$VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton.pressed = false
|
||||
|
||||
|
||||
func set_rect_size():
|
||||
pass # Replace with function body.
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://material_maker/main_window.gd" type="Script" id=1]
|
||||
[ext_resource path="res://material_maker/library.tscn" type="PackedScene" id=2]
|
||||
@ -10,16 +10,45 @@
|
||||
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=8]
|
||||
[ext_resource path="res://material_maker/node_factory.gd" type="Script" id=9]
|
||||
[ext_resource path="res://material_maker/theme/default.tres" type="Theme" id=10]
|
||||
[ext_resource path="res://material_maker/preview/preview_2d.gd" type="Script" id=11]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 size;
|
||||
|
||||
void fragment() {
|
||||
float ms = max(size.x, size.y);
|
||||
vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx);
|
||||
vec2 m2 = min(fract(uv), 1.0-fract(uv));
|
||||
vec4 image = texture(tex, uv);
|
||||
vec3 image_with_background = mix(vec3(mod(floor(uv.x*32.0)+floor(uv.y*32.0), 2.0)), image.xyz, image.a);
|
||||
float lines_color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0);
|
||||
COLOR = vec4(mix(image_with_background, vec3(lines_color), step(min(m2.x, m2.y), 1.0/min(size.x, size.y))), 1.0);
|
||||
}"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/size = Vector2( 721, 546 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
flags = 4
|
||||
atlas = ExtResource( 8 )
|
||||
region = Rect2( 96, 96, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
flags = 4
|
||||
atlas = ExtResource( 8 )
|
||||
region = Rect2( 96, 32, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
[sub_resource type="StyleBoxFlat" id=5]
|
||||
bg_color = Color( 0, 0, 0, 0.772549 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
flags = 4
|
||||
atlas = ExtResource( 8 )
|
||||
region = Rect2( 96, 64, 32, 32 )
|
||||
region = Rect2( 96, 64, 32, 31 )
|
||||
|
||||
[node name="MainWindow" type="Panel"]
|
||||
anchor_right = 1.0
|
||||
@ -136,12 +165,28 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
|
||||
[node name="Preview2D" type="ColorRect" parent="VBoxContainer/HBoxContainer/ProjectsPane"]
|
||||
visible = false
|
||||
material = SubResource( 2 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_min_size = Vector2( 64, 64 )
|
||||
rect_clip_content = true
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
script = ExtResource( 11 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="Preview3D" parent="VBoxContainer/HBoxContainer/ProjectsPane" instance=ExtResource( 4 )]
|
||||
margin_left = 0.0
|
||||
margin_top = 0.0
|
||||
margin_right = 0.0
|
||||
margin_bottom = 0.0
|
||||
ui_path = "../HBoxContainer/HBoxContainer/Preview3DUI"
|
||||
ui_path = "../PreviewUI/Panel/HBoxContainer/Preview3DUI"
|
||||
|
||||
[node name="Projects" type="Panel" parent="VBoxContainer/HBoxContainer/ProjectsPane"]
|
||||
self_modulate = Color( 1, 1, 1, 0 )
|
||||
@ -164,7 +209,7 @@ tab_close_display_policy = 1
|
||||
|
||||
[node name="AddNodePopup" parent="VBoxContainer/HBoxContainer/ProjectsPane/Projects" instance=ExtResource( 7 )]
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane"]
|
||||
[node name="PreviewUI" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane"]
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 1.0
|
||||
@ -172,36 +217,65 @@ margin_top = -45.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = -13.0
|
||||
custom_constants/separation = 7
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer"]
|
||||
[node name="Preview2DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"]
|
||||
margin_right = 44.0
|
||||
margin_bottom = 40.0
|
||||
hint_tooltip = "Show 2D preview"
|
||||
toggle_mode = true
|
||||
icon = SubResource( 3 )
|
||||
|
||||
[node name="Preview3DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"]
|
||||
margin_left = 51.0
|
||||
margin_right = 95.0
|
||||
margin_bottom = 40.0
|
||||
hint_tooltip = "Show 3D preview"
|
||||
toggle_mode = true
|
||||
icon = SubResource( 1 )
|
||||
icon = SubResource( 4 )
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer"]
|
||||
[node name="Panel" type="PanelContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"]
|
||||
visible = false
|
||||
margin_left = 51.0
|
||||
margin_right = 354.0
|
||||
margin_bottom = 38.0
|
||||
custom_constants/separation = 8
|
||||
self_modulate = Color( 1, 1, 1, 0.768627 )
|
||||
margin_left = 102.0
|
||||
margin_right = 399.0
|
||||
margin_bottom = 40.0
|
||||
custom_styles/panel = SubResource( 5 )
|
||||
|
||||
[node name="ControlView" type="TextureRect" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer"]
|
||||
margin_top = 3.0
|
||||
margin_right = 32.0
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel"]
|
||||
margin_right = 297.0
|
||||
margin_bottom = 40.0
|
||||
custom_constants/separation = 5
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="SpaceLeft" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"]
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="ControlView" type="TextureRect" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"]
|
||||
margin_left = 5.0
|
||||
margin_top = 4.0
|
||||
margin_right = 37.0
|
||||
margin_bottom = 35.0
|
||||
size_flags_vertical = 4
|
||||
texture = SubResource( 2 )
|
||||
texture = SubResource( 6 )
|
||||
|
||||
[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer" instance=ExtResource( 5 )]
|
||||
[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer" instance=ExtResource( 5 )]
|
||||
anchor_right = 0.0
|
||||
margin_left = 40.0
|
||||
margin_left = 42.0
|
||||
margin_top = 8.0
|
||||
margin_right = 303.0
|
||||
margin_bottom = 30.0
|
||||
margin_right = 292.0
|
||||
margin_bottom = 32.0
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="SpaceRight" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"]
|
||||
margin_left = 297.0
|
||||
margin_right = 297.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="NodeFactory" type="Node" parent="."]
|
||||
script = ExtResource( 9 )
|
||||
[connection signal="need_update" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" to="." method="update_preview_3d"]
|
||||
@ -215,8 +289,9 @@ script = ExtResource( 9 )
|
||||
[connection signal="reposition_active_tab_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="move_active_tab_to"]
|
||||
[connection signal="tab_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="set_current_tab"]
|
||||
[connection signal="tab_close" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="close_tab"]
|
||||
[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/Button" to="." method="show_background_preview"]
|
||||
[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/ControlView" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="on_gui_input"]
|
||||
[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Environment_item_selected"]
|
||||
[connection signal="model_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Model_item_selected"]
|
||||
[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Rotate_toggled"]
|
||||
[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton" to="." method="show_background_preview_2d"]
|
||||
[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton" to="." method="show_background_preview_3d"]
|
||||
[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/ControlView" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="on_gui_input"]
|
||||
[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Environment_item_selected"]
|
||||
[connection signal="model_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Model_item_selected"]
|
||||
[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Rotate_toggled"]
|
||||
|
@ -4,8 +4,6 @@
|
||||
[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=3]
|
||||
|
||||
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
@ -16,8 +14,10 @@ void fragment() {
|
||||
float ms = max(size.x, size.y);
|
||||
vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx);
|
||||
vec2 m2 = min(fract(uv), 1.0-fract(uv));
|
||||
float color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0);
|
||||
COLOR = mix(texture(tex, uv), vec4(vec3(color), 1.0), step(min(m2.x, m2.y), 1.0/min(size.x, size.y)));
|
||||
vec4 image = texture(tex, uv);
|
||||
vec3 image_with_background = mix(vec3(mod(floor(uv.x*32.0)+floor(uv.y*32.0), 2.0)), image.xyz, image.a);
|
||||
float lines_color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0);
|
||||
COLOR = vec4(mix(image_with_background, vec3(lines_color), step(min(m2.x, m2.y), 1.0/min(size.x, size.y))), 1.0);
|
||||
}"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
@ -46,6 +46,9 @@ mouse_filter = 1
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="P1" parent="." instance=ExtResource( 2 )]
|
||||
visible = false
|
||||
|
@ -1,13 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://material_maker/main_window.tscn" type="PackedScene" id=1]
|
||||
|
||||
|
||||
[node name="WindowDialog" type="WindowDialog"]
|
||||
margin_right = 1124.0
|
||||
margin_bottom = 619.0
|
||||
popup_exclusive = true
|
||||
window_title = "Material Maker"
|
||||
resizable = true
|
||||
|
||||
[node name="MainWindow" parent="." instance=ExtResource( 1 )]
|
Loading…
Reference in New Issue
Block a user