Author Topic: FX Map Bricks Scaling Per Row  (Read 6761 times)

Hey guys,

I am trying to create a node that creates something similar to the image below:

[/URL]

I basically want to tile bricks and have them scale smaller the lower they get on the texture. Ultimately I would like to have controls for how many rows there are...how far down the screen they go... and how drastic the scale is from top to bottom.

I tried using FX maps with the $number variable to achieve this but I was not able to get this to work properly.

I was wondering if anyone had any good ideas on how I could achieve something similar to this effect? Should I use FX maps? Maybe I should just create this using the regular substance graphs?

Any ideas or feedback would be great! Thank you,

-3DBriggs

It would be easy if there were for-loops available.
It would be easy if you could use multiple $numbers from different iteration notes.
It would be possible if there was a way to save a value somehow (the reason for my thread about how to use the "Set" node).

I am only able to make the spacing between the bricks relative to their size in the direction the bricks stay the same size.

Right now I think this is as far as I can get:




Last Edit: January 19, 2014, 04:59:00 pm

The iterate node can be used as a global for loop. You can plug multiple Iterate nodes and Set the $number variable to a custom variable in each iterate node using the Set node.

So what you ask is available but it's not correctly documented (we are aware of it and will try to do it as soon as possible).

I think this pattern is doable, but it's not easy, I've to think about it.
Product Manager - Allegorithmic

Thank you Retakrew7 and NicolasW both of your responses were extremely helpful. I will see how much further I can push this tomorrow and I will definitely experiment with Nicolas' suggestion of using the Set node.

You guys are awesome!

Interesting, I've now understood how to "Set" a local variable within a function, however, I am unable to make it global (or inheritable) within the FX-Node.

An example just for that would be really helpful.

I am also still wondering what to do with the output connector of the "Set" node.

Last Edit: January 20, 2014, 10:26:58 pm

Retakrew I have been looking through your function for "offset" inside of the fx map you created for the last few hours.

I am slightly confused on some of the math you have done and I was hoping you could help me understand by explaining a bit more.. I can kind of break down step by step what you are doing but some of it is hard to visualize.

I am mainly confused in the part that you commented:
"Base Offset = 0.5 - (width * 0.5)"

Any feedback would be extremely helpful!


On a side note... This is kind of what I am trying to figure out...

My goal is to have a float slider 0 to 1...
I want the slider to offset each row in the Vertical Axis (-V)
I want this offset to scale higher based off the current "$number"s row
I assume I would have to figure out which row $number is in... and then modify the Y offset by doing something like: FloatSlider * RowNumber

Basically I want row 0 (the top row) to stay still
Row 1 to offset slightly...
Row 2 offsets a little more than row 1...

Basically I imagine if the slider is at 0 the offset is default to what you showed me. But as a slide toward 1 everything would offset toward the top of the screen and eventually everything would be on top of row 0.

I hope that makes sense...

Anyways... I am looking forward to your response! You definitely have a good handle on these math functions.

Sorry my last response was a bit long. If I had to make this one simple question... I would ask how you are getting the rows based off the $Number?

Here is a simple example showing how to use the Set / Sequence nodes.

I guess the "Base Offset = 0.5 - (width * 0.5)" is here to offset all patterns so they stick to the image border.

Do you want each line to contain the same amount of pattern ? In your first post, the image has a different amount of pattern for each row, consequently the pattern keep a square shape. Otherwise the pattern would be stretched.

I think that's the main difficulty here, it'd probably be easier to use two iterate nodes: one to draw the first row(made of X patterns) and another one to draw the other rows (made of X+n patterns).
Product Manager - Allegorithmic

In the example I've uploaded the rows are calculated by dividing the number with the amount of squares per row (start_columns) at the start of the functions.

"Base Offset = 0.5 - (width * 0.5)"
This is used to place the square at a corner to make the offset calculations easier.

Thanks for the example, this also clarifies the use of a sequence node.

I guess I will have another shot at it tomorrow.
(one iterate node for the rows and one iterate node for the columns  + some global variables for current square size and vertical offset)

Maybe I will make a fx-node function tutorial series in the future explaining some of my graphs in detail.
Last Edit: January 21, 2014, 12:08:35 pm

Ha I got it to work!  :D 8)

The .sbs is in the attachement, brick_row_4 is commented.

Input parameters are:
- rows
- start columns
- additional bricks per row
- size (to scale the empty spaces between the bricks)

Last Edit: January 22, 2014, 04:31:53 pm

Nice !
I'm pleased people start making complex stuff using fxmaps :)

Nicolas
Product Manager - Allegorithmic