Author Topic: Teto Substance Sketchbook (and stuff)  (Read 3330 times)

Here is me first about mys substance things. But before showing materials, I must learn Designer well. So I started by doing some functions and nodes. They are all on Substance Share. By sometimes for a reason they aren't and I think that it could be useful to share anyway, so I'll post them here.

My workflow starts with heightmaps, for every substance that doesn't come from a photo or an imported image. And the heightmaps are useful for creating masks and the normal map, and you can mix many heightmaps without problem. Except that sometimes I didn't find what I wanted for mixing or adjusting (see below).

All functions I made so far:
- Clamp_Float : https://share.allegorithmic.com/libraries/2200
- Percent2float: https://share.allegorithmic.com/libraries/2201
- Transform_by_2_intervals: https://share.allegorithmic.com/libraries/2202
- Pixel_Value: https://share.allegorithmic.com/libraries/2311
- Position2pixel: https://share.allegorithmic.com/libraries/2313
- isPair: https://share.allegorithmic.com/libraries/2312 (very script kiddy this one  8) )

All nodes:
- ByPass_Alternative: https://share.allegorithmic.com/libraries/2287
- Elevation: https://share.allegorithmic.com/libraries/2200
- Elevation_Advanced: https://share.allegorithmic.com/libraries/2250
- Heightmap separator: https://share.allegorithmic.com/libraries/2209
- Invert_color_2: https://share.allegorithmic.com/libraries/2213
- Masked_Edge: https://share.allegorithmic.com/libraries/2295
- Max_Value_Grayscale: https://share.allegorithmic.com/libraries/2217
- Min_Value_Grayscale: https://share.allegorithmic.com/libraries/2218
- On-Off_Grayscale: https://share.allegorithmic.com/libraries/2259
- Stack: https://share.allegorithmic.com/libraries/2207
- Stack_auto: https://share.allegorithmic.com/libraries/2214
- To_the_ceiling: https://share.allegorithmic.com/libraries/2220
- To_the_ground: https://share.allegorithmic.com/libraries/2219

I've created this topic also if you have questions, remarks and so on. Don't hesitate. :)
Last Edit: October 01, 2016, 11:18:20 am

You know, Allegorithmic should write a complete overview of their nodes. I've just discovered that a part of "Elevation" (the "compression" option) was already available under the name "Histogram Range", plus "Histogram Scan" and "Histogram shift" run roughly as the other options of Elevation (or Elevation_Advanced). That's frustrating in a way because if those nodes would please me (it's not the case, though) it means that I'd wasted a lot of time.

Fortunately, the use of these nodes is frustrating for me (sorry Allegorithmic! ;) ) because lack of securities and weird behavior for Histogram shift. It seems that these nodes are more for tweaking by hands, not made for automation or inclusion inside other nodes. I'm not sure that I'm very understandable... Anyway, I continue to think that my nodes can be useful, but that's was close. ;D

For now I'm working on a node that can allow you to mask edges.

I took pyramids and eggs "sort of" to take an example. The image 01 shows the 2 heightmaps together. Pyramids and eggs are mixed together. The image shows that where they're mixed together, the edge is sharp. So maybe you want to have something more smooth, more organic.

The image 02 shows the result, done by a node which has 3 options to mix 2 heightmaps:
- Like image 02. Basic.
- With an heightmap that is stacked on. (image 03)
- With patterns, B&W images that are taken from the texture (image 04). For example a silhouette of the first heightmap in order to have a better passage from heightmap A to heightmap B. Typically grass -> soil. Available for both heightmaps, white=opaque or transparent, with settings for the strength/blur.

We can adjust the behavior of the patterns or the additional heightmap.

The outputs are :
- The result.
- Mask for the effect, an heightmap.
- Binary mask. White, ok, black nok.
- Optional masks given as input, used for the option "pattern for transition". As you can adjust things, it's good to retrieve them after, with the modification done.

But I'm not satisfied. We can have a wide range of effects with the node (photo 05 and 06 show the effects of the overall strength) and we can have something very organic, but I want to change the shape of transition (something flat or more parabolic) and for the moment the method I'm using doesn't please me. I have to work on it. Unfortunately I don't have much time for the moment.  :-[

Tell me what you think or if something missing.

Good news about Min_Value_Grayscale and the opposite. Problem was, until today, that the reliable method I used was time/resources demanding. At 8k a decent PC would crash or freeze, and many nodes I made are using both nodes, so it a huge problem that I had to fix. It's done, and now the nodes shouldn't be a problem anymore, and could be used extensively without problem.

Short story: I reduce the size of the input heightmap from whatever size to 64x64, without loosing any highest pixel value. So 1 pixel in a 64x64 image corresponding to a 128x128 square in a 8K image and it has the highest value of the pixels in the 128x128 square. Or the lowest, for Min_Value. After that, I'm using the old-fashioned way, as every computer can handle this easily.

During this process I learned one important thing, that can be useful to share with people who work with their own nodes: pixel_processor is a great node, but can be tricky to use. I discovered 2 things :

- Never use integer values when you handle pixels, never. At a position ($pos) [x,y], where [x,y] are pixelized versions of [0.12865,0.58962] for example, if you want to know the value of the next pixel, don't ask [x+1, y+1], ask [x+1.0, y+1.0]. Even if it should work, it doesn't.

- More important, don't hesitate to make a pixel_processor by operation. For example, if you want to transform 2 contiguous pixels, with pixel A depending of B and after B is transformed depending of A, separate the operations, one by node. Because as the node use drastically parallel processing, you aren't sure that the 2nd operation will be done after the 1st one. So if you transform blocks of pixels, and blocks can overlap, you can't be sure of the order of any operation you are doing. The solution is : Do the 1st operation (A is changed by the value of B) and link the node to another dedicated to the 2nd operation. With that way, the 2nd operation is safely done after the first.

 ;D

Important update8)

For people who use my nodes, please consider to update most of them, I updated 2 of them, Min_Value_Grayscale and Max_Value_Grayscale, which are used in other nodes (also updated):
  • To the ceiling
  • To the ground
  • By Pass alternative
  • Elevation advanced
  • Elevation
  • Masking Edge
  • Stack auto


Now these node won't freeze/crash you computer with high resolution heightmaps and they are dramatically faster than before, around 200x with a 2K image.  ;D
Last Edit: October 01, 2016, 03:38:41 pm

Teto can you check if your ByPass works under SubDes 5.6.21 please ?

I didn't know what your nodes are supposed to do, can you describe them more than only give us the web links

best regards.

As my english is not that good, my explanations may be fuzzy, that's right. ^^

I'll try to be more specific.

The main goal to this node is to help a designer to have an alternative when a grayscale image is absent or under a value. Imagine that you develop a node, and ask the user to give a grayscale image for an effect as an entry. The user plugs nothing, or an image too dark for the purpose of your node (because... reasons). The node allows you to plus an alternative image that would be used instead, in order to have "something" (a neutral grayscale for example), because if not, your node doesn't work well.

Of course you can do many other things with this kind of node, it's just an example.

In short :
- It's a node with 2 entries A and B, and a color chooser.
- If A is not plugged with something -> B is chosen.
- If a pixel from A has a higher value that the value in color chooser -> B is chosen.

For example you can decide that if the grayscale image in A is too dark (since a pixel is lower than 100 for example), you lighten it and put the result in B. In this case, the output of the node will never have a pixel with a value < 100.
Last Edit: February 07, 2017, 08:18:52 pm