mirror of
https://github.com/Relintai/material-maker.git
synced 2025-01-09 05:39:38 +01:00
Fixed 3d preview and added warp generator
This commit is contained in:
parent
9834571c4a
commit
d643cecebb
@ -33,7 +33,7 @@ func _ready():
|
|||||||
if Engine.editor_hint:
|
if Engine.editor_hint:
|
||||||
texture_list = ADDON_TEXTURE_LIST
|
texture_list = ADDON_TEXTURE_LIST
|
||||||
for t in texture_list:
|
for t in texture_list:
|
||||||
generated_textures[t.texture] = { shader=null, source=null, texture=null }
|
generated_textures[t.texture] = null
|
||||||
material = SpatialMaterial.new()
|
material = SpatialMaterial.new()
|
||||||
|
|
||||||
func generate_material(renderer : MMGenRenderer):
|
func generate_material(renderer : MMGenRenderer):
|
||||||
@ -42,14 +42,25 @@ func generate_material(renderer : MMGenRenderer):
|
|||||||
var status = source.generator.render(source.output_index, renderer, 512)
|
var status = source.generator.render(source.output_index, renderer, 512)
|
||||||
while status is GDScriptFunctionState:
|
while status is GDScriptFunctionState:
|
||||||
status = yield(status, "completed")
|
status = yield(status, "completed")
|
||||||
print("Render status: "+str(status))
|
|
||||||
renderer.get_texture().get_data().save_png("res://test.png")
|
renderer.get_texture().get_data().save_png("res://test.png")
|
||||||
material.albedo_texture = load("res://test.png")
|
material.albedo_texture = load("res://test.png")
|
||||||
return material
|
return material
|
||||||
|
|
||||||
func initialize(data: Dictionary):
|
func render_textures(renderer : MMGenRenderer):
|
||||||
if data.has("name"):
|
for t in texture_list:
|
||||||
name = data.name
|
var source = get_source(t.port)
|
||||||
|
var texture = null
|
||||||
|
if source != null:
|
||||||
|
var status = source.generator.render(source.output_index, renderer, 512)
|
||||||
|
while status is GDScriptFunctionState:
|
||||||
|
status = yield(status, "completed")
|
||||||
|
texture = ImageTexture.new()
|
||||||
|
texture.create_from_image(renderer.get_texture().get_data())
|
||||||
|
generated_textures[t.texture] = texture
|
||||||
|
|
||||||
|
func update_materials(material_list):
|
||||||
|
for m in material_list:
|
||||||
|
update_spatial_material(m)
|
||||||
|
|
||||||
func get_generated_texture(slot, file_prefix = null):
|
func get_generated_texture(slot, file_prefix = null):
|
||||||
if file_prefix != null:
|
if file_prefix != null:
|
||||||
@ -59,14 +70,14 @@ func get_generated_texture(slot, file_prefix = null):
|
|||||||
else:
|
else:
|
||||||
return null
|
return null
|
||||||
else:
|
else:
|
||||||
return generated_textures[slot].texture
|
return generated_textures[slot]
|
||||||
|
|
||||||
func update_spatial_material(m, file_prefix = null):
|
func update_spatial_material(m, file_prefix = null):
|
||||||
var texture
|
var texture
|
||||||
m.albedo_color = parameters.albedo_color
|
m.albedo_color = Color(1, 1, 1)#parameters.albedo_color
|
||||||
m.albedo_texture = get_generated_texture("albedo", file_prefix)
|
m.albedo_texture = get_generated_texture("albedo", file_prefix)
|
||||||
m.metallic = parameters.metallic
|
m.metallic = 1#parameters.metallic
|
||||||
m.roughness = parameters.roughness
|
m.roughness = 1#parameters.roughness
|
||||||
if Engine.editor_hint:
|
if Engine.editor_hint:
|
||||||
texture = get_generated_texture("mrao", file_prefix)
|
texture = get_generated_texture("mrao", file_prefix)
|
||||||
m.metallic_texture = texture
|
m.metallic_texture = texture
|
||||||
@ -79,7 +90,7 @@ func update_spatial_material(m, file_prefix = null):
|
|||||||
texture = get_generated_texture("emission", file_prefix)
|
texture = get_generated_texture("emission", file_prefix)
|
||||||
if texture != null:
|
if texture != null:
|
||||||
m.emission_enabled = true
|
m.emission_enabled = true
|
||||||
m.emission_energy = parameters.emission_energy
|
#m.emission_energy = parameters.emission_energy
|
||||||
m.emission_texture = texture
|
m.emission_texture = texture
|
||||||
else:
|
else:
|
||||||
m.emission_enabled = false
|
m.emission_enabled = false
|
||||||
@ -92,7 +103,7 @@ func update_spatial_material(m, file_prefix = null):
|
|||||||
if Engine.editor_hint:
|
if Engine.editor_hint:
|
||||||
if (generated_textures.mrao.mask & (1 << 2)) != 0:
|
if (generated_textures.mrao.mask & (1 << 2)) != 0:
|
||||||
m.ao_enabled = true
|
m.ao_enabled = true
|
||||||
m.ao_light_affect = parameters.ao_light_affect
|
#m.ao_light_affect = parameters.ao_light_affect
|
||||||
m.ao_texture = m.metallic_texture
|
m.ao_texture = m.metallic_texture
|
||||||
m.ao_texture_channel = SpatialMaterial.TEXTURE_CHANNEL_BLUE
|
m.ao_texture_channel = SpatialMaterial.TEXTURE_CHANNEL_BLUE
|
||||||
else:
|
else:
|
||||||
@ -101,14 +112,14 @@ func update_spatial_material(m, file_prefix = null):
|
|||||||
texture = get_generated_texture("ambient_occlusion", file_prefix)
|
texture = get_generated_texture("ambient_occlusion", file_prefix)
|
||||||
if texture != null:
|
if texture != null:
|
||||||
m.ao_enabled = true
|
m.ao_enabled = true
|
||||||
m.ao_light_affect = parameters.ao_light_affect
|
#m.ao_light_affect = parameters.ao_light_affect
|
||||||
m.ao_texture = texture
|
m.ao_texture = texture
|
||||||
else:
|
else:
|
||||||
m.ao_enabled = false
|
m.ao_enabled = false
|
||||||
texture = get_generated_texture("depth_map", file_prefix)
|
texture = get_generated_texture("depth_map", file_prefix)
|
||||||
if texture != null:
|
if texture != null:
|
||||||
m.depth_enabled = true
|
m.depth_enabled = true
|
||||||
m.depth_scale = parameters.depth_scale
|
#m.depth_scale = parameters.depth_scale
|
||||||
m.depth_texture = texture
|
m.depth_texture = texture
|
||||||
else:
|
else:
|
||||||
m.depth_enabled = false
|
m.depth_enabled = false
|
||||||
|
@ -312,9 +312,12 @@ func _on_LoadRecent_id_pressed(id):
|
|||||||
# Preview
|
# Preview
|
||||||
|
|
||||||
func update_preview():
|
func update_preview():
|
||||||
var material_node = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control().get_node("Material")
|
var material_node = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control().get_node("node_Material")
|
||||||
if material_node != null:
|
if material_node != null:
|
||||||
material_node.update_materials($VBoxContainer/HBoxContainer/VBoxContainer/Preview.get_materials())
|
var status = material_node.generator.render_textures(renderer)
|
||||||
|
while status is GDScriptFunctionState:
|
||||||
|
status = yield(status, "completed")
|
||||||
|
material_node.generator.update_materials($VBoxContainer/HBoxContainer/VBoxContainer/Preview.get_materials())
|
||||||
update_preview_2d()
|
update_preview_2d()
|
||||||
|
|
||||||
func update_preview_2d(node = null):
|
func update_preview_2d(node = null):
|
||||||
|
@ -4,27 +4,12 @@
|
|||||||
|
|
||||||
[sub_resource type="Theme" id=1]
|
[sub_resource type="Theme" id=1]
|
||||||
|
|
||||||
[node name="Material" type="GraphNode" index="0"]
|
[node name="Material" type="GraphNode"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_right = 230.0
|
margin_right = 230.0
|
||||||
margin_bottom = 199.0
|
margin_bottom = 199.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
theme = SubResource( 1 )
|
theme = SubResource( 1 )
|
||||||
title = "Material"
|
title = "Material"
|
||||||
offset = Vector2( 0, 0 )
|
|
||||||
show_close = false
|
|
||||||
resizable = false
|
|
||||||
selected = false
|
|
||||||
comment = false
|
|
||||||
overlay = 0
|
|
||||||
slot/0/left_enabled = false
|
slot/0/left_enabled = false
|
||||||
slot/0/left_type = 0
|
slot/0/left_type = 0
|
||||||
slot/0/left_color = Color( 0.411765, 1, 0.388235, 0.352941 )
|
slot/0/left_color = Color( 0.411765, 1, 0.388235, 0.352941 )
|
||||||
@ -74,478 +59,165 @@ slot/7/right_enabled = false
|
|||||||
slot/7/right_type = 0
|
slot/7/right_type = 0
|
||||||
slot/7/right_color = Color( 0.494118, 0.494118, 1, 1 )
|
slot/7/right_color = Color( 0.494118, 0.494118, 1, 1 )
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
_sections_unfolded = [ "Theme", "slot", "slot/0", "slot/1", "slot/2", "slot/5", "slot/7" ]
|
|
||||||
|
|
||||||
[node name="resolution" type="OptionButton" parent="." index="0"]
|
[node name="resolution" type="OptionButton" parent="."]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 24.0
|
margin_top = 24.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 44.0
|
margin_bottom = 44.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
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 = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
text = "512x512"
|
text = "512x512"
|
||||||
flat = false
|
|
||||||
align = 0
|
|
||||||
items = [ "256x256", null, false, 0, null, "512x512", null, false, 1, null, "1024x1024", null, false, 2, null, "2048x2048", null, false, -1, null ]
|
items = [ "256x256", null, false, 0, null, "512x512", null, false, 1, null, "1024x1024", null, false, 2, null, "2048x2048", null, false, -1, null ]
|
||||||
selected = 1
|
selected = 1
|
||||||
|
|
||||||
[node name="Albedo" type="HBoxContainer" parent="." index="1"]
|
[node name="Albedo" type="HBoxContainer" parent="."]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 44.0
|
margin_top = 44.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 64.0
|
margin_bottom = 64.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="Label" type="Label" parent="Albedo" index="0"]
|
[node name="Label" type="Label" parent="Albedo"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 3.0
|
margin_top = 3.0
|
||||||
margin_right = 114.0
|
margin_right = 114.0
|
||||||
margin_bottom = 17.0
|
margin_bottom = 17.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Albedo"
|
text = "Albedo"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="albedo_color" type="ColorPickerButton" parent="Albedo" index="1"]
|
[node name="albedo_color" type="ColorPickerButton" parent="Albedo"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 118.0
|
margin_left = 118.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
rect_min_size = Vector2( 80, 0 )
|
rect_min_size = Vector2( 80, 0 )
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
focus_mode = 2
|
|
||||||
mouse_filter = 0
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 1
|
|
||||||
size_flags_vertical = 1
|
|
||||||
toggle_mode = false
|
|
||||||
enabled_focus_mode = 2
|
|
||||||
shortcut = null
|
|
||||||
group = null
|
|
||||||
flat = false
|
|
||||||
align = 1
|
|
||||||
color = Color( 1, 1, 1, 1 )
|
color = Color( 1, 1, 1, 1 )
|
||||||
edit_alpha = false
|
edit_alpha = false
|
||||||
_sections_unfolded = [ "Rect", "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="Metallic" type="HBoxContainer" parent="." index="2"]
|
[node name="Metallic" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 65.0
|
margin_top = 65.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 89.0
|
margin_bottom = 89.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="Label" type="Label" parent="Metallic" index="0"]
|
[node name="Label" type="Label" parent="Metallic"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Metallic"
|
text = "Metallic"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="metallic" type="SpinBox" parent="Metallic" index="1"]
|
[node name="metallic" type="SpinBox" parent="Metallic"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
|
||||||
[node name="Roughness" type="HBoxContainer" parent="." index="3"]
|
[node name="Roughness" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 90.0
|
margin_top = 90.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 114.0
|
margin_bottom = 114.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="Label" type="Label" parent="Roughness" index="0"]
|
[node name="Label" type="Label" parent="Roughness"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Roughness"
|
text = "Roughness"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="roughness" type="SpinBox" parent="Roughness" index="1"]
|
[node name="roughness" type="SpinBox" parent="Roughness"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
|
||||||
[node name="Emission" type="HBoxContainer" parent="." index="4"]
|
[node name="Emission" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 115.0
|
margin_top = 115.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 139.0
|
margin_bottom = 139.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="Label" type="Label" parent="Emission" index="0"]
|
[node name="Label" type="Label" parent="Emission"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Emission"
|
text = "Emission"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="emission_energy" type="SpinBox" parent="Emission" index="1"]
|
[node name="emission_energy" type="SpinBox" parent="Emission"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 5.0
|
max_value = 5.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
|
||||||
[node name="NormalMap" type="HBoxContainer" parent="." index="5"]
|
[node name="NormalMap" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 140.0
|
margin_top = 140.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 164.0
|
margin_bottom = 164.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="Label" type="Label" parent="NormalMap" index="0"]
|
[node name="Label" type="Label" parent="NormalMap"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Normal map"
|
text = "Normal map"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="normal_scale" type="SpinBox" parent="NormalMap" index="1"]
|
[node name="normal_scale" type="SpinBox" parent="NormalMap"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 5.0
|
max_value = 5.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
|
||||||
[node name="AmbientOcclusion" type="HBoxContainer" parent="." index="6"]
|
[node name="AmbientOcclusion" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 165.0
|
margin_top = 165.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 189.0
|
margin_bottom = 189.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="Label" type="Label" parent="AmbientOcclusion" index="0"]
|
[node name="Label" type="Label" parent="AmbientOcclusion"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Ambient occlusion"
|
text = "Ambient occlusion"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="ao_light_affect" type="SpinBox" parent="AmbientOcclusion" index="1"]
|
[node name="ao_light_affect" type="SpinBox" parent="AmbientOcclusion"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 5.0
|
max_value = 5.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
|
||||||
[node name="DepthMap" type="HBoxContainer" parent="." index="7"]
|
[node name="DepthMap" type="HBoxContainer" parent="."]
|
||||||
editor/display_folded = true
|
editor/display_folded = true
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 190.0
|
margin_top = 190.0
|
||||||
margin_right = 214.0
|
margin_right = 214.0
|
||||||
margin_bottom = 214.0
|
margin_bottom = 214.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="Label" type="Label" parent="DepthMap" index="0"]
|
[node name="Label" type="Label" parent="DepthMap"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_top = 5.0
|
margin_top = 5.0
|
||||||
margin_right = 120.0
|
margin_right = 120.0
|
||||||
margin_bottom = 19.0
|
margin_bottom = 19.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
|
||||||
rect_clip_content = false
|
|
||||||
mouse_filter = 2
|
|
||||||
mouse_default_cursor_shape = 0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 4
|
|
||||||
text = "Depth map"
|
text = "Depth map"
|
||||||
percent_visible = 1.0
|
|
||||||
lines_skipped = 0
|
|
||||||
max_lines_visible = -1
|
|
||||||
_sections_unfolded = [ "Size Flags" ]
|
|
||||||
|
|
||||||
[node name="depth_scale" type="SpinBox" parent="DepthMap" index="1"]
|
[node name="depth_scale" type="SpinBox" parent="DepthMap"]
|
||||||
anchor_left = 0.0
|
|
||||||
anchor_top = 0.0
|
|
||||||
anchor_right = 0.0
|
|
||||||
anchor_bottom = 0.0
|
|
||||||
margin_left = 124.0
|
margin_left = 124.0
|
||||||
margin_right = 198.0
|
margin_right = 198.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.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
|
|
||||||
min_value = 0.0
|
|
||||||
max_value = 5.0
|
max_value = 5.0
|
||||||
step = 0.05
|
step = 0.05
|
||||||
page = 0.0
|
|
||||||
value = 1.0
|
value = 1.0
|
||||||
exp_edit = false
|
|
||||||
rounded = false
|
|
||||||
editable = true
|
|
||||||
prefix = ""
|
|
||||||
suffix = ""
|
|
||||||
_sections_unfolded = [ "Rect" ]
|
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=6 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/material_maker/nodes/transform/transform.gd" type="Script" id=1]
|
[ext_resource path="res://addons/material_maker/nodes/transform/transform.gd" type="Script" id=1]
|
||||||
|
|
||||||
[sub_resource type="Theme" id=1]
|
[sub_resource type="StyleBoxEmpty" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id=4]
|
||||||
|
|
||||||
[node name="Transform" type="GraphNode"]
|
[node name="Transform" type="GraphNode"]
|
||||||
margin_left = 1.0
|
margin_left = 1.0
|
||||||
@ -10,7 +16,10 @@ margin_top = 1.0
|
|||||||
margin_right = 185.0
|
margin_right = 185.0
|
||||||
margin_bottom = 179.0
|
margin_bottom = 179.0
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
theme = SubResource( 1 )
|
custom_styles/position = SubResource( 1 )
|
||||||
|
custom_styles/defaultfocus = SubResource( 2 )
|
||||||
|
custom_styles/breakpoint = SubResource( 3 )
|
||||||
|
custom_styles/defaultframe = SubResource( 4 )
|
||||||
title = "Transform"
|
title = "Transform"
|
||||||
show_close = true
|
show_close = true
|
||||||
slot/0/left_enabled = true
|
slot/0/left_enabled = true
|
||||||
|
1
addons/material_maker/nodes/warp.mmg
Normal file
1
addons/material_maker/nodes/warp.mmg
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"warp","node_position":{"x":0,"y":0},"parameters":{"amount":0.2,"eps":0.045,"epsilon":0},"shader_model":{"global":"","inputs":[{"default":"vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)","label":"","name":"in","type":"rgba"},{"default":"0.0","label":"","name":"d","type":"f"}],"instance":"","name":"Warp","outputs":[{"rgba":"$in($uv+$amount*vec2($d(fract($uv+vec2($eps, 0.0)))-$d(fract($uv-vec2($eps, 0.0))), $d(fract($uv+vec2(0.0, $eps)))-$d(fract($uv-vec2(0.0, $eps)))))","type":"rgba"}],"parameters":[{"default":0,"label":"","max":1,"min":0,"name":"amount","step":0.005,"type":"float","widget":"spinbox"},{"default":0,"label":"","max":0.2,"min":0.005,"name":"eps","step":0.005,"type":"float","widget":"spinbox"}]}}
|
@ -43,7 +43,7 @@ func _on_Preview_resized():
|
|||||||
$Preview2D.rect_size = Vector2(64, 64)
|
$Preview2D.rect_size = Vector2(64, 64)
|
||||||
|
|
||||||
func _on_Preview2D_gui_input(ev : InputEvent):
|
func _on_Preview2D_gui_input(ev : InputEvent):
|
||||||
if ev is InputEventMouseButton && ev.button_index == 1 && ev.pressed:
|
if ev is InputEventMouseButton and ev.button_index == 1 and ev.pressed:
|
||||||
preview_maximized = !preview_maximized
|
preview_maximized = !preview_maximized
|
||||||
_on_Preview_resized()
|
_on_Preview_resized()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user