Author Topic: Repeat Function Idea  (Read 540 times)

Offline WASasquatch

  • Member
  • *
  • Posts: 3266
Repeat Function Idea
« on: March 25, 2018, 08:07:10 AM »
A really cool idea would be a repeat function. It would save time and space on so many projects I'd imagine (especially mine).

Basically you have a input like a surface layer, a shader/function input, and integer for number of iterations. Than TG in it's infinite glory applies said shader X times to the input (or last result). This would be useful for many shaders, for example, the transform input shader. Ever iteration it applies to the last result, or input, layering up the shaders effect.

Maybe there could be three types, a "Repeat Shader", "Repeat Scalar" and "Repeat Vector"

Image for visual example
« Last Edit: March 25, 2018, 08:09:01 AM by WASasquatch »

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: Repeat Function Idea
« Reply #1 on: March 25, 2018, 02:38:46 PM »
Something like the transform input shader, but with offset and number of octaves would be cool, but then you get into how do you mix those octaves?

Offline luvsmuzik

  • Member
  • *
  • Posts: 2918
    • luvsmuzik 1995
Re: Repeat Function Idea
« Reply #2 on: March 25, 2018, 04:12:18 PM »
The old Rock&Sea file share uses octaves that I am sure you both understand.

But could you, because I really have no clue, use an array for this?

Offline WASasquatch

  • Member
  • *
  • Posts: 3266
Re: Repeat Function Idea
« Reply #3 on: March 25, 2018, 06:52:46 PM »
The old Rock&Sea file share uses octaves that I am sure you both understand.

But could you, because I really have no clue, use an array for this?

I don't believe so. An array works off position and repeating. What I am talking about is taking a workflow which is long and drawn out and simplifying it. The repeat shader only simply merges the shader/function with the input shader X times. Doesn't have to be a transform shader. That's just an example which can be used with shaders for stepping colors or mixing many or something.
« Last Edit: March 25, 2018, 08:50:37 PM by WASasquatch »

Offline luvsmuzik

  • Member
  • *
  • Posts: 2918
    • luvsmuzik 1995
Re: Repeat Function Idea
« Reply #4 on: March 25, 2018, 08:21:10 PM »
Yes, I thought array was just grid or directional. I wonder if there would be a way to "seed" and "constant" or "build." It just gets confusing to me especially as I know some about multiply, difference, screen and that about color hues where those terms do not always mean what one would think when looking at a term.

Offline WASasquatch

  • Member
  • *
  • Posts: 3266
Re: Repeat Function Idea
« Reply #5 on: March 25, 2018, 08:53:45 PM »
Yes, I thought array was just grid or directional. I wonder if there would be a way to "seed" and "constant" or "build." It just gets confusing to me especially as I know some about multiply, difference, screen and that about color hues where those terms do not always mean what one would think when looking at a term.

When I say merge, I mean as any node does when you put them together and than pipe said node elsewhere. Though merging functionality would be cool. I've talked about the ability for all nodes to have a "Seed" function, which could than be used by functions to create all sort of dynamics.

Here is an example, this node network could simply be one or two repeats with different transform settings. Which would save so much time on adding/removing to get what I want.


And that's really a basic example, I want to go deeper but it takes time and previews instead of just changing a number for iterations. Just seems like something that should be part of the functions setup.

Online Oshyan

  • Planetside Staff
  • *
  • Posts: 13116
  • Holy snagging ducks!
Re: Repeat Function Idea
« Reply #6 on: March 25, 2018, 09:14:51 PM »
I think what you want is a "loop" function, correct? I believe it has been discussed, but it can be quite "dangerous" to support since it can make compute time really increase massively with simple setting changes. It does have some value, certainly, but would need to be used carefully.

- Oshyan

Offline WASasquatch

  • Member
  • *
  • Posts: 3266
Re: Repeat Function Idea
« Reply #7 on: March 25, 2018, 09:24:50 PM »
I think what you want is a "loop" function, correct? I believe it has been discussed, but it can be quite "dangerous" to support since it can make compute time really increase massively with simple setting changes. It does have some value, certainly, but would need to be used carefully.

- Oshyan

Yeah, that's probably a far better term to be using, yes. Basically like a for loop. Heck even while loops with the conditional scalar functionality would be incredibly powerful.

To that note about the dangers; I think it would be safe to say something like this should be inherently limited to X iterations. Maybe 10 (a slider bar?). Easy to stack up 10 nodes for 100 iterations than 100 nodes and settings.
« Last Edit: March 25, 2018, 09:29:14 PM by WASasquatch »

Offline Dune

  • Member
  • *
  • Posts: 15131
    • www.ulco-art.nl
Re: Repeat Function Idea
« Reply #8 on: March 26, 2018, 06:23:16 AM »
Loops are dangerous indeed; I once made a loop in code to open a new window (I believe it was in Flash), and I couldn't stop it running, had to force close down the machine.

Offline WASasquatch

  • Member
  • *
  • Posts: 3266
Re: Repeat Function Idea
« Reply #9 on: March 26, 2018, 06:55:01 AM »
Loops are dangerous indeed; I once made a loop in code to open a new window (I believe it was in Flash), and I couldn't stop it running, had to force close down the machine.

Action Script is dangerous haha. Loops are inherently dangerous, which is why you hard code limitations in. For example, you usually express a loop with a upper limit, and safe guard breaks within the function.

 

anything