rodzill4 / material-maker Goto Github PK
View Code? Open in Web Editor NEWA procedural textures authoring and 3D model painting tool based on the Godot game engine
License: MIT License
A procedural textures authoring and 3D model painting tool based on the Godot game engine
License: MIT License
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()
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.
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
Thanks
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.
On 3 it's all right but on 3.1 I have
parser error method create node is not declared in the current class
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
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.
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?
The library tab is broken as of 4b5d6d7
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.
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.
Add support for hodpi screens when in standalone mode.
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.
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 ๐
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.
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
The current environments are inadequate for accurately depicting materials.
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.
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?
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.
This approach is used by all operating systems. For example, Windows.
I think this approach is more accessible and easy for users. I hope you will like it.
P.S. Google Translator.
This project crashes with (at least) 3.2RC2 and 3.2RC3 under Windows. Did not test under Linux (@Calinou ?). Didn't start investigating yet, but I doubt it's a Godot problem (all my other projects just run fine).
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.
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!
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 ๐
There's an official GDScript style guide since Godot 3.0. To get cleaner-looking code, we should reformat code to follow it the best we can.
Similar to #30, I can work on this if this is desired ๐
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.
I can't change the font size, it's too small to read.
Is there a way or place that I or anyone could submit samples to be used in future versions?
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.
Resizing the window caused the program to freeze for 5-10 seconds, and then afterwards it crashed.
I cannot drag nodes into the work space. Furthermore, I cannot open any example materials.
GodotEngine Version 3.1.1 stable
OS: Linux Manjaro
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.
Godot 3.1 beta 2 freezes when adding Image box (generator - image).
Material maker 0.6, Master branch, windows 10 64
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.
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:
Is it possible to implement undo/redo like visual shaders have?
For example Ctrl+Z for undo, control + Shift + Z for redo.
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}"
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:
Possibly connected behaviours that could be their own issues:
Desired Fixes/Suggestions:
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)
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
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
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.
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
For convenience sake. The preview texture is so small it's almost useless.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.