Giter Club home page Giter Club logo

material-maker's Introduction

Material Maker

This is a tool based on Godot Engine that can be used to create textures procedurally and paint 3D models.

Its user interface is based on Godot's GraphEdit node: textures and brushes are described as interconnected nodes.

Download

On Windows, you can also install Material Maker using Scoop:

scoop bucket add extras
scoop install material-maker

... or Chocolatey (default or portable install):

choco install material-maker
choco install material-maker.portable

Can't wait for next release? Automated builds from master branch are available (use at your own risk):

Build Passing

Documentation

Translations

Translation files can be installed using the Install button in the Preferences dialog.

Community

Screenshot

Screenshot

License

Copyright (c) 2018-2021 Rodolphe Suescun and contributors

Unless otherwise specified, files in this repository are licensed under the MIT license. See LICENSE.md for more information.

material-maker's People

Contributors

arnklit avatar blacryu avatar bliepp avatar calinou avatar easynam avatar escargot-sans-gluten avatar goldenthumbs avatar jackaperkins avatar jeremybeier avatar jummit avatar kewlamogh avatar luggage66 avatar metincetin avatar myaaaaaaaaa avatar paddy-exe avatar paulofalcao avatar raedwulf avatar relintai avatar rodzill4 avatar sisilicon avatar skyace65 avatar tcroc avatar teddydd avatar theaninova avatar variable-ind avatar vreon avatar williamchange avatar wojtekpil avatar yeldhamdev avatar zhibade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-maker's Issues

Some questions using the 0.6 Linux version from itch

  • Can you also Export a complete face texture.png capture with all material/filters/etc settings applied?
  • How do you restart the cube preview rotation once it is paused?
  • I don't see Grid lines when clicking snap button.
  • How do you add Material (in case I delete using the X button)

Thanks

2D preview window isn't visible if it's too short or tall, creates several node drawing problems

This is using Material Maker v0.8. Here's a video demonstrating this: https://youtu.be/VE8qLj2xFQs

Bug Description

On startup and whenever the 2D preview window is activated at the divider's default size (at 900p resolution with 100% Windows 10 scaling) the 2D preview window won't show anything inside it.. While it's doing this, some of the text and panels for deselected/inactive nodes are hidden. The 2D preview window needs to be at an incredibly specific window-height relative to the others to show its contents, and it can still create more node-rendering issues even when it is visible.

Current User Fix:

Turning the 2D preview window into a 3D preview window makes everything in the app display as intended, pretending the 2D preview window doesn't exist.

Video Timestamps for the demonstration video: https://youtu.be/VE8qLj2xFQs

0:55: When I stretch the 2D preview window to be taller, the 2D window shows itself for a bit, but making it too high causes the same problem as before. Stretching the 2D preview window's height around changes how much the deselected nodes have their text/panels drawn.

1:12: When the 2D preview window is active but not drawn, it also stops the 3D preview that you can activate in the background of the workspace.

The good news:

  • All nodes, buttons and sliders are always functional even if they're not visible.
  • Adjusting 2D preview window's width doesn't seem to change anything.

Possibly connected behaviours that could be their own issues:

  • When 2D window is active but not drawn, scrolling all the nodes off-screen hides the file tabs at the top and the background-preview button
  • When the 2D window is active and drawn, it will show me a 2D preview of my nodes as I click on them, except for when I click on the final material output

Desired Fixes/Suggestions:

  • The program lets me know that the 2D preview window needs to be taller to work properly.
  • The 2D preview window still draws nodes fully if it's active and too small to be drawn.
  • The 2D preview window still draws when it's activated and has more than enough height to display itself, centring the 2D preview in the middle of the extra height it's given.

My Specs:
OS Name: Microsoft Windows 10 Home
Version: 10.0.18362 Build 18362
System Type: x64-based PC
Processor: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz, 2904 Mhz, 2 Core(s), 4 Logical Processor(s)

0.6 Mac OS X. debug_path in Render Viewport node should be system agnostic

Not sure if it is used other than for debugging, but it contained a Windows path so it produced error on Mac (and probably Linux).

main_window.gd

func render_shader_to_viewport(shader, textures, render_size, method, args):
	if debug_path != null and debug_path != "":
		var f = File.new()
		f.open(debug_path+str(debug_file_index)+".shader", File.WRITE)
		f.store_string(shader)
		f.close()
		debug_file_index += 1

Exported textures are mixed up

When there are multiple export nodes and there is an ambient occlusion map defined the exported textures use the ambient occlusion texture.

I noticed that if I close everything and give Material Maker maximum performance, it works fine.

[Proposal] Add function to save multiple editor layouts

I like that the editor panels can now be moved around in 0.9, though the size of the Library panel doesn't seem to save correctly for some reason. With the ability to move panels and activate/deactivate them, and the possibility of there being more panels in the future, it would be nice to be able to save multiple different layouts depending on our workflow. Maybe there could also be a function to easily revert to the saved layout in case we've moved things around during work, or possibly a way to save the editor layout with the material .ptex project file if possible.

Add type hints to all GDScript files

The codebase currently has some type hints, but many of them are missing (especially for function return types).

If you'd like, I could go through the codebase and add them. I just need to know whether you're OK with type inference (:=). I personally prefer using it, but I know some people don't ๐Ÿ™‚

Problems connecting nodes

My PC โ€ฆ
Ubuntu Linux 19.04 (32G memory)
GPU: GeForce GTX 770

This problem occurs suddenly, I am not sure how to reproduce. Normally I can do node connections with a mouse drag from output slot to input slot. But if the problem occurs, this does not work. Instead my clcik-drag moves the whole source node or creates a selection box.

[Proposal] Adding nodes. RMB instead of Space Button.

Hello! I would like to suggest adding nodes via RMB, and the Space button to move the view. (In Material Maker, you can also move the view via the Space button, but first a window for adding nodes appears, which is not very convenient).
But adding nodes via RMB needs to be made more convenient than now, which is via the Space button.
IMG_20200404_205027
This approach is used by all operating systems. For example, Windows.
jQ_xIJnh71-v_UbrsyfO7a-ZF0-eE2ZdSiP3L2lZ-IMCYeN5hii2NctXPmNUXmxV0r0gidERi7Yw1A0o7zxWiewKKCN3OISoEEuouEHWDduwY8vzZ5Qt-kb5kobLOgepcabC8ImFkL5Ya7a3ch-JtYojaA
I think this approach is more accessible and easy for users. I hope you will like it.
P.S. Google Translator.

Unreal Blueprint Style Group

Unreal has a group node that goes around an area that has a re-nameable title that I find very useful for organization.

image

Global UV scale option?

Since all of the nodes read from a uv value for their calculations, it'd be nice if each material had a global UV scale value, starting at (1.0, 1.0) that could be adjusted independently of the nodes. It's frustrating to make a cool pattern with non symetric noise and then not be able to get a 2x2 version of it with unique quadrants. Would this be hard to implement?

Drag and Drop material causes an error on Exported version

Mac OS X,
Godot 3.2 alpha2

0.6 Drag and Drop material. E.g. Brick:

Running it through the IDE works fine except for the Warnings

But when Exported and run as an app produces the warnings AND error when dragging and dropping. Looks like the load() method for preview. This is what shows up in the logs.

HERE0
res://addons/material_maker/library/base/bricks.png
HERE1
HERE1.5
HERE2
WARNING: This method has been deprecated and will be removed in the future
At: scene/resources/texture.cpp:239:load() - This method has been deprecated and will be removed in the future
WARNING: Loaded resource as image file, this will not work on export: 'res://addons/material_maker/library/base/bricks.png'. Instead, import the image file as an Image resource and load it normally as a resource.
At: core/image.cpp:1877:load() - Loaded resource as image file, this will not work on export: 'res://addons/material_maker/library/base/bricks.png'. Instead, import the image file as an Image resource and load it normally as a resource.
ERROR: Error opening file 'res://addons/material_maker/library/base/bricks.png'.
At: core/io/image_loader.cpp:56:load_image() - Error opening file 'res://addons/material_maker/library/base/bricks.png'.
HERE3
here4

Lines of code with issue:
library.gd

func get_drag_data(position):
	var selected_item = get_selected()
	if selected_item != null:
		var data = selected_item.get_metadata(0)
		if data == null:
			return null
		var preview
		if data.has("icon") && data.has("library"):
			print("HERE0")
			var filename = data.library.left(data.library.rfind("."))+"/"+data.icon+".png"
			print(filename)
			print("HERE1")
			preview = TextureRect.new()
			print("HERE1.5")
			preview.texture = ImageTexture.new()
			print("HERE2")
			preview.texture.load(filename)
			print("HERE3")
		elif data.has("type") and data.type == "uniform":
			preview = ColorRect.new()
			preview.rect_size = Vector2(32, 32)
			if data.has("color"):
				preview.color = Color(data.color.r, data.color.g, data.color.b, data.color.a)
		else:
			preview = Label.new()
			preview.text = data.tree_item
		print("here4")
		set_drag_preview(preview)
		return data 
	return null

Implement undo

Is it possible to implement undo/redo like visual shaders have?
For example Ctrl+Z for undo, control + Shift + Z for redo.

exported roughness map has pink tint

Hey, I'm using the binary version of material maker 0.8 on linux. I don't know if i'm doing something wrong, but if export my material as png images, the roughness map doesn't look like it is supposed to. i'm not using the export node here, but only standard export of all output channels that have a connection.

the export generates a file called mymaterial_orm.png (curious about the suffix here, because all other maps are named appropriately) and the image has a pink tint, when it of course should be greyscale (which it is within material maker)

Any idea why this might happen?

Command line mode export

I store only source materials (*.ptex files) in my project repository, but not generated by export images, because storing them is redundant and consumes a lot of space (several MB against several KB). But if i want to produce material images, i needed to launch Material Designer for every material and manually export it.
It will be better, if Material Designer will have special console mode only for export.
For example:
MaterialDesigner.exe --export -i in_material.ptex -o output_directory/
This command opens input material and exports it.
If such options will exist, it will be easy to write script, that automatically exports all materials in project build process.

Colorised invert not working

Colorised invert not working in Ubuntu Linux. When pressing black and white color. Color picker not show. Only blue popup window show. Colorize rainbow color picker working.

After a moment of reflection, I completely misunderstood. It works anyway. It is only slider. Not picker.

using: 0.6 version

[Proposal] Update theme

image
Hi, what about updating the Theme to the modern Godot one? It's only a couple clicks. Shall I make a PR with something like this or you are fine with the current one?
Thanks!

Material Maker Discord / Reddit

I think a place to share tips, materials and just chat about material maker would be cool. It would be a time investment and I'm not sure if anyone is up for it, but I'm just making this suggestion to see if there are others who also want this.

  • Reddit
  • Discord

Add more control over randomness

There are some patterns, based on random values - bricks, voronoi, perlin noise, color noise
truchet, scratchers, etc. Result of such patterns changes after each change of pattern node, even if only position changed.
Sometimes, final result may looks either good or bad, dependent on random seed. So, if you selected good seed, you need to quickly export result, because after any change or after program restart you may not receive good seed again.
To fix such issues, it will be good to control randomness. I see two options how to do this:

  • Add one global random seed and allow user to change it and save in result material file.
  • Add random seed option to any node, that uses random generator.

HiDPI support

Add support for hodpi screens when in standalone mode.

Errors in verbose mode

Godot 3.1, Godot 3.2 beta 1

When I tried to open project with verbose flag godot -v or godot -e -v I saw a lot of OpenGL errors

   At: drivers/gles3/rasterizer_gles3.cpp:124.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Undefined behavior	ID: 131222	Severity: Medium	Message: Program undefined behavior warning: The current GL state uses a sampler (0) that has depth comparisons disabled, with a texture object (0) with a non-depth format, by a shader that samples it with a shadow sampler. This will result in undefined behavior.

I'm not sure if this are project or engine bug

Unable to run as a stand-alone binary

I'm not sure how much of an issue you'd want this to be, but when exporting a Linux binary (64-bit), these errors occur and the program crashes.

stuart@stuart-desktop:~/tmp/2$ ./Material_Maker.x86_64 
OpenGL ES 3.0 Renderer: NV137
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
   At: scene/resources/scene_format_text.cpp:1225.
ERROR: _load: Method/Function Failed, returning: RES()
   At: core/io/resource_loader.cpp:186.
ERROR: SceneTree: Default Environment as specified in Project Settings (Rendering -> Environment -> Default Environment) could not be loaded.
   At: scene/main/scene_tree.cpp:2384.
ERROR: load_source_code: Condition ' err ' is true. returned: err
   At: modules/gdscript/gdscript.cpp:792.
ERROR: load: Condition ' err != OK ' is true. returned: RES()
   At: modules/gdscript/gdscript.cpp:1856.
ERROR: _load: Method/Function Failed, returning: RES()
   At: core/io/resource_loader.cpp:186.
SCRIPT ERROR: GDScript::load_byte_code: Parse Error: Can't preload resource at path: res://addons/material_maker/nodes/node_generic.gd
   At: res://addons/material_maker/node_factory.gdc:13.
ERROR: load_byte_code: Method/Function Failed, returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:764.
ERROR: load: Condition ' err != OK ' is true. returned: RES()
   At: modules/gdscript/gdscript.cpp:1848.
ERROR: _load: Method/Function Failed, returning: RES()
   At: core/io/resource_loader.cpp:186.
ERROR: poll: res://addons/material_maker/main_window.tscn:8 - Parse Error: [ext_resource] referenced nonexistent resource at: res://addons/material_maker/node_factory.gd
   At: scene/resources/scene_format_text.cpp:439.
ERROR: load: Condition ' err != OK ' is true. returned: RES()
   At: core/io/resource_loader.cpp:149.
ERROR: _load: Method/Function Failed, returning: RES()
   At: core/io/resource_loader.cpp:186.
ERROR: start: Condition ' !scene ' is true. returned: false
   At: main/main.cpp:1688.
WARNING: cleanup: ObjectDB Instances still exist!
   At: core/object.cpp:1989.

The obvious candidates for the crash are the "nonexistent resource" and "Can't preload resource" errors.

Normal map filter always renders at 1024ร—1024 after loading a saved material

While working on #38 (from commit 80f8071), I noticed that the normal map filter will always be render a 1024ร—1024 image after loading a material (even if the OptionButton says it's not 1024ร—1024).

This can be worked around by setting a different size in the OptionButton, which will cause the normal map to be rendered again. In comparison, this bug doesn't occur with the output material size.

Command line arguments to export specific channel

I need to export only a specific channel of my material.

-c: Channel. Could be albedo, normal, ao, roughness etc.

-o: Output path. Exports all channels when it's a directory and only the provided channel if it's a png. The default channel could be albedo.

Example:

material-maker --export -c albedo -o albedo.png material.ptex

I want this to make a thumbnailer for .ptex files. Currently I use this code which exports everything and uses the albedo as thumbnail:

material-maker --export --size "${1}" -o /tmp "${2}"
materialname=$(basename $2 .ptex)
albedopath="/tmp/${materialname}_albedo.png"
cp "${albedopath}" "${3}"

Result:
image
This is slow because it exports every texture.

Open node search when dragging out from inputs

I think it would be useful if the same search that opens when dragging out from output ports opened when dragging out from input ports as well. It would connect the first output of the new node to the input.

Upload binary releases on GitHub for easier automated installation

Using the Godot BaseApp I maintain, I'd like to create a Flatpak for Material Maker like I did for Pixelorama. To be able to do this, I need a download link that can be accessed in an automated manner (it must not expire over time). GitHub Releases can provide this, but not itch.io. A permanent link will also be useful to add Material Maker to Scoop.

Could you upload the binary versions of the latest release to GitHub, please? Thanks in advance ๐Ÿ™‚

Unity export keeps generating the same UUIDs from multiple .ptex files

Separate .ptex files are generating textures with the same guid during a unity export.

For example, say I have

  • bricks.ptex, which I export to bricks.mat and bricks_albedo.png
  • grass.ptex, which I export to grass.mat and grass_albedo.png

I may get the same guid in bricks_albedo.png.meta and grass_albedo.png.meta causing issues when importing into Unity.

v0.9 - Windows

Error when trying to send something to Embross input

If I try to send something to input of Embross box (for example Image, noise etc), I get error:

invalid call. Nonexistent function get_shader_code_get_globals' in base 'GraphNode (node_generic.gd)'.

Could you fix it so that the program does nothing when something goes wrong (for example if a user connect something wrong etc)?

Material maker 0.6, Godot 3.06 stable.

Cant Enable plugin due to Errors

godot version
3.2.2 beta 1

OS version
ubuntu 19.10 64x

Problem
Cant enable the plugin due to errors

Screenshot from 2020-04-20 09-58-37

tried to change to load(), but doesnt work either. There are some errors about mm_loader inside the import_plugin folder too

Mac OS X runs fine. But there is an error on startup

Hi, I tested it with Godot RC 2 on Mac OS X Mojave. Runs good. However on startup there is this error. Maybe it is irrelevant.

E 0:00:02.517 get_child: Index p_index=-1 out of size (data.children.size()=1)
<C++ Source> scene/main/node.cpp:1296 @ get_child()
tabs.gd:52 @ get_current_tab_control()
main_window.gd:120 @ get_current_graph_edit()
main_window.gd:496 @ update_preview_3d()
preview_3d.gd:42 @ _on_Model_item_selected()
preview_3d_ui.gd:23 @ _on_Model_item_selected()
main_window.gd:76 @ _ready()

3D Preview doesn't refresh

Fantastic work on this tool. I'll get to the bug:

It happens often that the 3D preview of a material doesn't refresh, thus providing false feedback.
I'm using material maker v0.8 on Windows 10 with an AMD Vega 64 GPU and a Ryzen 1700x CPU.

refresh_fail
In the attached gif you can see that I'm disconnecting all material ports but the preview isn't changing. Changing settings oftentimes fails to refresh as well, and reloading the file produces inconsistent results that are different each time.
The material file is also attached:
sdf_operations.zip

Submit new samples?

Is there a way or place that I or anyone could submit samples to be used in future versions?

"stair-stepping" artifacts in normal maps

Material Maker 0.8, Manjaro Linux

There are stair-stepping artifacts in generated normal maps as illustrated in the attached image. I'm really not sure if this is the case here, but often this sort of thing happens in other programs due to the use of 8-bit images or images using certain texture compression to generate the normal maps. It's not too noticeable on small pieces, but this would definitely affect bigger objects or ones meant to get pretty close to the camera.

Having fun with the program, though!

stepping_artifacts

Improve environment lighting

The current environments are inadequate for accurately depicting materials.

  • In Schelde, a pure white cube displays as medium blue-grey, even though the sun is shining directly on it.
  • In Park, with a bright blue sky, it's dark green-brown.
  • In Night, it's dark grey-brown; the white cube is darker than the black asphalt ground!
  • In Lobby, it's medium brown with 50 lights overhead.
  • In Experiment, it's multicolored medium grey.

One cannot accurately determine colors or texture depth in this situation. This is mostly due to Godot's current poor implementation of environment lighting but there are many things you can do to improve it.

  • In Godot's environment settings/tonemap, you should set it to Filmic, and set White to 16. Set the background to Schelde and observe what happens to the sun as you do this.

  • Most of the HDRIs provided by Godot are under exposed (or at least rendered under exposed). For Schelde you should set Exposure (in the same panel) to at least 2, up to 4. All the other HDRIs need a boost as well.

  • You also need a directional light (energy 0.5-1) that lines up with the environment lighting. Environment lighting in Godot is severely inadequate. The environment doesn't provide shadows, and even increasing the exposure as above really only gets the background accurate. It doesn't adequately light objects to accurately show material attributes like color, normal maps, etc. To get your lighting and shadows accurate, the light needs to come from the exact same angle as the sun in the background. There's a trick to make it easy if you need it.

  • In addition to these environment maps, you should provide a pure white studio lighting setup. Maybe 2: One with a 3-point light set. And another using flood lights or an emissive plane, though this might have to wait until you can use a realtime GI probe in Godot 4.

  • The background should rotate. I'd have one button to rotate the object, and another to rotate the background (or the camera and all objects except lights). That way I can control the object position and light position independently.

Here is a sample file for schelde. Drop shcelde.hdr in the project folder. Though the cube still appears blue here, it's a proper blue from the environment rather than a dark blue-grey when the sun is supposed to be shining directly on it.

Lighting Sample.zip

3D SDF Repeat node doesn't seem to work

The 3D SDF Repeat node doesn't seem to work properly as far as I can tell, no matter which 3D SDF node I plug into it. This could be why the included 3D SDF examples, like the Skulls, don't work correctly either since most of them use at least a few Repeat nodes. I also noticed that the output nodes of the nested graphs in Skulls, for example, don't seem to want to connect to anything if you unplug and replug a node into them. That may be a separate issue, though.

Consider renaming the repository to material-maker

Now that the project is known as Material Maker, it might be a good idea to rename this repository from godot-procedural-textures to material-maker. The description could be updated as well. GitHub will automatically set up a redirect, so links won't be broken.

[Proposal] Add function to lock the rotation axis in 3D view

It's a bit harder than it should be to manipulate the 3D views and it would be nice to be able to just lock the rotation axis so that the view can only be rotated horizontally, for example, at least while using the regular left-mouse button to rotate.

Add Godot 3.1 beta support?

On 3 it's all right but on 3.1 I have

parser error method create node is not declared in the current class

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.