RodZill4 / material-maker

A procedural textures authoring and 3D model painting tool based on the Godot game engine
MIT License
3.52k stars 222 forks source link

Warp Node Issue #501

Open randy9randy opened 2 years ago

randy9randy commented 2 years ago
 Hello. I have been working on making a wooden plank material and the only issue that I have run into is with the warp node. In short, it only seems to work on flat greyscale parts of a node image which doesn't seem to be what should happen.
 To help explain this, I will give my material example and process as best I can. 
 In order to prevent wood knots from landing on two planks adjacent to each other and wood grain from being too consistent from adjacent planks, I would create the same rectangle tiles as the wood planks (Just simple rectangles with no texture to them), give them a separate greyscale value, and plug that into the warps height map input. 
 In Substance Designer, this works (Although I use the directional warp node in Substance Designer, and after using all other warp nodes in Material Maker, I have determined that the normal Warp node is the closest thing I can use), but even when trying out every other warp node available to me in material maker, using greyscale nodes and using different methods like greyscale inverting them and Fill to Random Grey, **only** the seams in between the wood planks would warp and not the planks themselves. Here are some screenshots showing the process and the problem:

.This screenshot shows my overall wood pattern that I intend to use the warp node on to create the wood plank variation on: Wood Pattern Start

.This screenshot is the greyscale rectangles for adding variation to the planks grains and knots: Wood Pattern Warp Prep

.This screenshot shows how my method works in Substance Designer, where I utilize the different values and that then plugs into a directional warp node: SD_Plank_Pattern_Separation_Prep

.This screenshot shows what I do in Substance Designer and what I am trying to accomplish. You can see the plank wood grains separated successfully and the arrow pointing to a knot that was successfully not appearing on the plank adjacent to it: SD_Plank_Pattern_Separation_Working

.This screenshot Shows that doing the same thing in Material Maker (To the best of my abilities) ONLY works on the seams and not the planks themselves (Even greyscale inverting does not fix this issue or change the output. Changing the surrounding values, big and small numbers, of the warp node itself does not give expected or desired results. It also doesn't work for the other warp nodes. Again, the normal warp node is the best match I could find). The red arrow points to a knot that has transferred over to an adjacent wood plank. You can also see that the wood grain itself is also consistent from plank to plank: Wood Pattern Warp Issue

Thank you and congratulations on making it to v1.0! This is a really good start and I am impressed with how far I got with this stress test and versatility project! I look forward to its development! I will help in any way I can. Sorry if this message was too long or felt condescending at points!

nothke commented 2 years ago

Hi, I have had the same problem and found a different solution.

Thing is, the "warp" node in MM is not the same as in SD. The MM node generates a slope from grayscale, while SD uses a normal map to offset the pixel position. However, you can create a similar effect with Custom UV node in MM, except that in CustomUV you "set" the value and not "add" it.. So, what I did is:

  1. recreate the basic UV map from 2 gradients like this:

image

  1. Then, I created randomized tile colors like this:

image

  1. and then, I add those two to create a UV map with tile-based offsets:

image

  1. And now, by plugging that into CustomUV node, I "move" my base noise texture so that it doesn't appear monolithic.

image

Maybe there is a better solution, but this worked for me. I wish there was a vector-based warp as well so that there is no need for this hack. Hope that helped!

RodZill4 commented 2 years ago

The easiest way to offset the position from a map (and not its X and Y derivatives, like the Warp node does) is to use map inputs of the Transform node.

You can easily displace and create wood knots before creating planks which will solve the problem with adjacent planks (and there are other easier ways to create planks, such as using Bricks nodes).