• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Trouble creating venation pattern by using FX-Map

New Here ,
Sep 03, 2023 Sep 03, 2023

Copy link to clipboard

Copied

Hello, for now I am creating the tiny veins (or you can deem it as the smallest venation level of leaf) of the Japanese Maple by using the FX-Map node. The reason I choose this node instead of the general Voronoi node and cells node is that I am not satisfied with the result generated by them.

 

Based on my observation of the actual leaf of Japanese Maple, I discovered that its tiny veins look like the combination of the “Y” shape. One “Y” ‘s middle branch connects to another “Y” ’s left or right branch and repeat this process until a net structure is formed.

 

For now, I come up with two ideas to achieve this effect. I attached images bellow to illustrate them. The basic logic of the first one is that I separate the “Y” shape into 3 branches and only focus on generating branches on one side at first and set some conditions to generate another side later. The problem is that I must set a counter variable for each “Y” shape ‘s connecting point to judge whether the number of lines connecting to each point is less than 3. However, I did not find any way to dynamically generate and set variables.

 

Another one is to generate three branches from the center in the first loop. After that, two branches are generated from the end points of each branch generated in the first step. Rest is just repeat the second step. However, the problem is the same, I need to set variables dynamically for each new end points in each loop.

 

I hope I can receive assistance from someone because I have already worked on it for a relatively long time and don’t want to give up.

 

TOPICS
How to

Views

161

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 06, 2023 Sep 06, 2023

Copy link to clipboard

Copied

Hello,
 
This is indeed a challenging project. There are several ways to approach it, from moderately complex to extremely complex.
I can try to break down the moderately complex approach:
 
For each level of recursion, you can separate the process in two stages:
  1. Data stage: Computing the end positions and encoding them as colours in a texture. This is performed using a Pixel Processor node.
  2. Draw stage: Using an FX-Map node to draw the lines, reading the positions from the texture generated by the Pixel Processor.

 

The Pixel Processor node can be used to encode the following data in the RGBA channels of a texture:
- RG: End position (x, y), this is used to place the line in the FX-Map
- BA: Direction vector from the start position to the end position (x, y), this is used to rotate the line in the FX-Map
 
On each iteration, a new Pixel Processor reads the texture generated by the previous Pixel Processor and uses that data to compute the new end positions. A new FX-Map node draws the lines for that iteration using the texture from the new Pixel Processor.
 
CyrilDellenbach_0-1694011031128.png

 

Does that make sense?
 
Best regards,
 
Cyril Dellenbach (Micro) | QA Support Artist | Adobe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

Hello officer,

 

Thanks for your reply.

 

Here are some questions towards your solution:

 

1. How to use the pixel processor to calculate the end position?

Based on my understanding, the function wrote in the function graph of pixel processor node takes effect on all pixels of an image. The $pos variable will get all pixels' coordinates invloving both what I need and what I don't need. I came up with an idea like check whether the pixels' color are white. If that is true, those coordiantes will be kept. However, pixels between the start positon and the end position are still what I don't need. Didn't find any ways to seperate them yet.

 

2. How to use the FX-Map to draw a line?

I guess the logic behind your way to draw a line is similar to drawing a line on a canvas using JAVA, Python or other languages. For example, set two coordiantes in advance and then call the draw() function. It is reasonable and make more sense. However, I am new to FX-Map and the only way I find to draw a line is to use a narrow square, which is also a shared solution mentioned in many tutorials on youtube. Beside that, I didn't find any other ways to do so. 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 19, 2023 Sep 19, 2023

Copy link to clipboard

Copied

LATEST

Hello!


1

Your understanding is correct. You need a Pixel Processor that generates an arbitrary starting point, then a series of Pixel Processors that generate 2 points for every point in the input.
This is much easier if you create a function that converts a pixel position to a pixel index (I.e. the number of the pixel if we were to count them from left to right and top to bottom) and another function that makes the reverse operation (index to position).
Then you can check at which index you are currently at based on $pos, check a specific pixel index in the input, and compute the output color accordingly. If the pixel in the input is black, output black.

 

Input

LucaGiarrizzo_2-1695111200784.png

 

Output

LucaGiarrizzo_3-1695111209343.png

 


2
The most straightforward way to draw a line in an FX-Map is indeed to draw a narrow rectangle. For placing the lines, you need to take into account the following:

  • Position is set using an offset from the center (so offset 0, 0 is actually position 0.5, 0.5) and is expressed in image space (0 to 1 from one edge to its opposite)
  • Rotation is applied around the center of the shape and the value is expressed as a number of turns.

 

Use an Iterate node to go through each pixel in the Pixel Processor's output one by one to add lines.

 

Compute everything you need in the Color/Luminosity parameter function of the Quadrant node, to ensure it is computed first. Use the $number variable to know which iteration you are at, which tells you which pixel index you should use in the Pixel Prcocessor output. Then store the results of your computations in variables that you use to set the values of Pattern Offset, Pattern Size and Pattern Rotation.

 

Adobe_Substance_3D_Designer_ZSN7CaAzTx.png

 

Again, this is a complex project. I hope it provides a valuable opportunity to learn about these two very powerful nodes!

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines