Skip to content

Commit

Permalink
Merge to fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Dec 17, 2024
2 parents 4c7f66c + 755f7c5 commit 05b64cc
Show file tree
Hide file tree
Showing 441 changed files with 3,936 additions and 629 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev-desktop-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ on:
default: "true"

env:
GODOT_VERSION: 4.3
GODOT_SUB: stable
GODOT_DOWNLOAD_DIR: https://github.com/godotengine/godot-builds/releases/download/4.3-stable
GODOT_VERSION: 4.4
GODOT_SUB: dev6
GODOT_DOWNLOAD_DIR: https://github.com/godotengine/godot-builds/releases/download/4.4-dev6
EXPORT_NAME: material_maker
MM_RELEASE: 1_4a1
MM_RELEASE: 1_4a2

jobs:
export_windows_linux:
Expand Down
76 changes: 71 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,72 @@
# Material Maker 1.4a1

## Known problems

- User settings are saved in a different directory (so using 1.4 alphas should not
affect your 1.3 configuration)
- Subwindows are not scaled correctly if the UI scale is not 1

## General

- Added flexible UI layout: panels can be moved anywhere in the window or
undocked (Material authoring and Painting have different layouts)
- Improved theme support (especially made many custom UI components themeable),
added a new Modern theme and improved old themes (contributed by Jowan-Spooner)
- Added basic support for GLTF 3D models
- Dropping a .obj or .glb file into the 3D preview panel will use it as preview model
- In the 3D preview replaced the default cube mesh with a chamfered cube and the
plane with a bent plane (chamfer and curvature can be modified in the mesh
configuration popup)
- Improved the Add Node popup so it's themeable, more performant and has better search
capabilities (contributed by Jowan-Spooner)
- Improved the Library panel's design (contributed by Jowan-Spooner)
- Added an editor for polygon parameters in the 2D preview
- Added a shader error diagnostic tool
- Added easy stylus pressure configuration in painting tool
- Added a Find/Replace tool to code editor
- Added an option to delete rescued unsaved projects at startup
- Added support for hover copy+paste on float, color and gradient editors

## Nodes

- Added a MeshMap node that automatically bakes maps (position, normal, tangent,
curvature, occlusion or thickness) for the current custom mesh.
- Added many new 2D and 3D SDF nodes (contributed by Theaninova and williamchange)
- Added new operations to the Math and Vec3 Math nodes (contributed by williamchange)
- Added a Shard FBM noise node (contributed by williamchange)
- Added a Tex3D Uniform node (contributed by williamchange)
- Added Classic, Generalized and Anisotropic Kuwahara filter nodes (contributed by williamchange)
- Redesigned the Float and Gradient parameter editor widgets (contributed by Jowan-Spooner)
- Improved the image picker UI (contributed by Jowan-Spooner)
- Added a new Splines parameter type (that can be edited in the 2D preview directly)
and a new Splines node
- Added a new Pixels parameter type, that can describe tiny images with 2, 4, 8 or 16 colors,
and can be edited in the 2D preview directly. Added new Pixels and Smooth Pixels nodes
- Added a new Lattice parameter type and a new Distort node
- Added a new Webcam node that can output a Webcam feed (MacOS only)
- Added a density input to the Noise node
- The 2D and 3D SDF Boolean and Transform nodes, the 3D SDF Color node and the
Tex3D Transform, Blend Select and Shape Select nodes are now variadic (contributed by williamchange)
- The Blend node now has Hue, Saturation, Color and Value blend modes (contributed
by williamchange)
- The Spherize node has been improved (contributed by williamchange)
- Updated documentation for many nodes (contributed by williamchange)

## Bug Fixes

- Small fixes in the GLSL parser
- Optimized polygon/polyline parameter

## Miscellaneous

- Material Maker is now based on Godot 4.3. While porting to Godot 4, many features
have been rewritten completely, including shader code generation and shader rendering
- The MacOS export has been modified so Material Maker can be installed
easily (contributed by williamchange)

# Material Maker 1.3

# General
## General

- Updated interface to the website to login and upload assets without the need
of a web browser
Expand All @@ -19,27 +85,27 @@
- Added Cairo tiles node
- Added a Spherize node (contributed by williamchange)

# Bug Fixes
## Bug Fixes

- Fixed an update problem in the Iterate Buffer node
- Fixed a NaN problem in the sdArc node (contributed by myaaaaaaaaa)
- Fixed a problem where the recovery file was not deleted when closing a tab
- Fixed an export problem in the Painting tool
- Fixed a problem with the Fill nodes where areas could leak though corners

# Miscellaneous
## Miscellaneous

- Material Maker is now based on Godot 3.5.2

# Material Maker 1.2p1

# New features
## New features

- Added Unreal Engine 5 export targets that generate a Python script for UE5 to
build automatically the generated material (it's necessary to setup a path for
Python in UE, this is described in the documentation)

# Bug Fixes
## Bug Fixes

- Fixed several small problems in the Export Editor window
- Fixed a problem that caused the 3D preview to update incorrectly
Expand Down
1 change: 1 addition & 0 deletions addons/flexible_layout/flexible_dragger.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dgwcni3ebvc8s
3 changes: 2 additions & 1 deletion addons/flexible_layout/flexible_layout.gd
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ class FlexLayout:
if rect.size.x == 0 or rect.size.y == 0:
return
if top:
top.layout(control.get_rect())
rect.size = Vector2i(Vector2(rect.size))
top.layout(rect)
main_control.layout_changed.emit()

func move_panel(panel, reference_panel : FlexNode, destination : int, test_only : bool = false) -> bool:
Expand Down
1 change: 1 addition & 0 deletions addons/flexible_layout/flexible_layout.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://crspdrrii0nex
1 change: 1 addition & 0 deletions addons/flexible_layout/flexible_overlay.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bhwlc7y7qgb2v
1 change: 1 addition & 0 deletions addons/flexible_layout/flexible_tab.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://ywxnr7grll4s
1 change: 1 addition & 0 deletions addons/flexible_layout/flexible_tabs.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dg1byost6nv7c
1 change: 1 addition & 0 deletions addons/flexible_layout/test.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://pwdjqjokbnju
6 changes: 4 additions & 2 deletions addons/material_maker/engine/dependencies.gd
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ func dependency_update(dependency_name : String, value = null, internal : bool =
var b : Buffer = buffers[dependency_name]
match b.status:
Buffer.Invalidated:
print_debug("Buffer %s (updating) should not be invalidated status" % dependency_name)
is_buffer_just_updated = true
#print_debug("Buffer %s (updating) should not be invalidated" % dependency_name)
#is_buffer_just_updated = true
update()
return
Buffer.UpdatingInvalidated:
#print_debug("Buffer %s (updating) reset to invalidated status" % dependency_name)
b.status = Buffer.Invalidated
Expand Down
1 change: 1 addition & 0 deletions addons/material_maker/engine/dependencies.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://crr3mu66a78bu
1 change: 1 addition & 0 deletions addons/material_maker/engine/io_types.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://coeb0q7f1dfo6
1 change: 1 addition & 0 deletions addons/material_maker/engine/loader.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://ddlcbf6dw2a6p
1 change: 1 addition & 0 deletions addons/material_maker/engine/logger.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://5f5raxatrnnl
93 changes: 82 additions & 11 deletions addons/material_maker/engine/multi_renderer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ var max_viewport_size : int = 2048

var max_buffer_size = 0

var rendering_device : RenderingDevice
var rendering_device_user = null

var shader_error_handler


Expand All @@ -27,19 +24,14 @@ signal free_rendering_device

func _ready() -> void:
shader_error_handler = load("res://addons/material_maker/engine/shader_error_handler.gd").new()
common_shader = "varying float elapsed_time;
void vertex() {
elapsed_time = TIME;
}
"
common_shader = "varying float elapsed_time;\nvoid vertex() {\n\telapsed_time = TIME;\n}\n"
common_shader += preload("res://addons/material_maker/shader_functions.tres").text
for i in total_renderers:
var renderer = preload("res://addons/material_maker/engine/renderer.tscn").instantiate()
add_child(renderer)
free_renderers.append(renderer)
rendering_device = RenderingServer.create_local_rendering_device()

initialize_rendering_thread()
# Global parameters

func get_global_parameters():
Expand Down Expand Up @@ -113,6 +105,85 @@ func release(renderer : Object) -> void:
free_renderers.append(renderer)
free_renderer.emit()


# rendering thread

const render_in_separate_thread : bool = true
var rendering_thread : Thread
var rendering_mutex : Mutex
var rendering_semaphore : Semaphore
var rendering_callable : Callable
var rendering_parameters : Array
var rendering_return_value
var rendering_thread_running : bool
var rendering_thread_working : bool = false
var rendering_device : RenderingDevice
var rendering_device_user = null

func thread_loop():
while true:
rendering_semaphore.wait()
rendering_mutex.lock()
var running : bool = rendering_thread_running
if not running:
rendering_mutex.unlock()
break
var rv = rendering_callable.callv(rendering_parameters)
rendering_return_value = rv
rendering_thread_running = false
rendering_mutex.unlock()

func thread_run(c : Callable, p : Array = [], stop_thread = false):
if render_in_separate_thread:
if rendering_thread == null:
return
while rendering_thread_working and is_inside_tree():
await get_tree().process_frame
rendering_thread_working = true
while not rendering_mutex.try_lock() and is_inside_tree():
await get_tree().process_frame
rendering_callable = c
rendering_parameters = p
rendering_thread_running = not stop_thread
rendering_mutex.unlock()
rendering_semaphore.post()
var running : bool = true
var rv
while running:
while not rendering_mutex.try_lock():
if is_inside_tree():
await get_tree().process_frame
running = rendering_thread_running
rv = rendering_return_value
rendering_mutex.unlock()
rendering_thread_working = false
return rv
else:
return await c.callv(p)

func create_rendering_device():
rendering_device = RenderingServer.create_local_rendering_device()

func destroy_rendering_device():
pass

func initialize_rendering_thread():
if render_in_separate_thread:
rendering_thread = Thread.new()
rendering_mutex = Mutex.new()
rendering_semaphore = Semaphore.new()
rendering_thread.start(self.thread_loop, 2)
thread_run(self.create_rendering_device)
else:
create_rendering_device()

func stop_rendering_thread():
if render_in_separate_thread:
await thread_run(destroy_rendering_device, [])
await thread_run(destroy_rendering_device, [], true)
rendering_thread.wait_to_finish()
rendering_thread = null

func request_rendering_device(user) -> RenderingDevice:
while ! renderers_enabled or rendering_device_user != null:
await self.free_rendering_device
Expand Down
1 change: 1 addition & 0 deletions addons/material_maker/engine/multi_renderer.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dqcja48n320s4
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_base.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://mcbr328cl01e
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_brush.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b7uvyymfdklls
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_buffer.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://brtutoy18rxq5
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_comment.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://x2lbtdvnuwdt
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_context.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://8dg7g6ubsn61
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_debug.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bcutdsiyw2tuf
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_export.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b2decri0hye1o
5 changes: 5 additions & 0 deletions addons/material_maker/engine/nodes/gen_graph.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ var transmits_seed : bool = true

var current_mesh : Mesh = null


signal graph_changed()
signal connections_changed(removed_connections, added_connections)
signal hierarchy_changed()


func _ready() -> void:
super._ready()

func emit_hierarchy_changed():
var top = self
while top.get_parent() != null and top.get_parent().get_script() == get_script():
Expand Down
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_graph.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://fcw2oyxbk8he
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_image.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://e6sktgaie00t
1 change: 1 addition & 0 deletions addons/material_maker/engine/nodes/gen_ios.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://04c37eowt30v
13 changes: 8 additions & 5 deletions addons/material_maker/engine/nodes/gen_iterate_buffer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var iteration_param_name : String
var used_named_parameters : Array = []


func _ready():
func _init():
#texture.flags = Texture2D.FLAG_REPEAT
shader_computes.append(MMShaderCompute.new())
shader_computes.append(MMShaderCompute.new())
Expand Down Expand Up @@ -114,17 +114,19 @@ func do_update_shaders() -> void:
for i in 2:
var shader_compute : MMShaderCompute = shader_computes[i]
var buffer_name : String = buffer_names[i]
var output_texture_type : int = 0 if new_is_greyscale else 1
if f32:
output_texture_type |= 2
if i == 1 and get_parameter("autostop"):
var shader_template : String = load("res://addons/material_maker/engine/nodes/iterate_buffer_compute.tres").text
var output_texture_type : int = 0 if (sources[i].output_type == "f") else 1
if f32:
output_texture_type |= 2
var output_textures : Array[Dictionary] = [{name="OUTPUT_TEXTURE", type=output_texture_type}]
var extra_parameters : Array[Dictionary] = [{name="mm_compare", type="sampler2D", value=texture}]
var extra_output_parameters : Array[Dictionary] = [{name="mm_highest_diff", type="int"}]
await shader_compute.compute_shader.set_shader_from_shadercode_ext(shader_template, sources[i], output_textures, extra_parameters, false, extra_output_parameters)
else:
await shader_compute.set_shader_from_shadercode(sources[i], f32)
var shader_template : String = load("res://addons/material_maker/engine/nodes/buffer_compute.tres").text
var output_textures : Array[Dictionary] = [{name="OUTPUT_TEXTURE", type=output_texture_type}]
await shader_compute.compute_shader.set_shader_from_shadercode_ext(shader_template, sources[i], output_textures, [], false, [])
mm_deps.buffer_create_compute_material(buffer_name, shader_compute)
mm_deps.update()
if new_is_greyscale != is_greyscale:
Expand All @@ -139,6 +141,7 @@ func set_parameter(n : String, v) -> void:
mm_deps.dependency_update("o%s_it_tex_size" % get_instance_id(), pow(2, v))
super.set_parameter(n, v)
set_current_iteration(0)
mm_deps.buffer_invalidate(buffer_names[0])

func on_dep_update_value(buffer_name, parameter_name, value) -> bool:
if parameter_name != buffer_names[2] and parameter_name != iteration_param_name and (buffer_name != buffer_names[1] or ! value is Texture2D):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bflrhcmq2h2oc
Loading

0 comments on commit 05b64cc

Please sign in to comment.