7
$\begingroup$

What is the way to multiply a texture across one axis? Lets assume that I have a plane. How can I multiply the "Gradient" texture in the node editor (Shift A > Textures > Gradient) several times across the plane surface? Here is what I mean -

enter image description here

I'm aiming for a holographic like effect so that texture will be used for something like this -

enter image description here

I tried using the "Mapping" node, but I still can't figure out what to do. Here's my node setup for the hologram like effect -

enter image description here

The results from the node setup -

enter image description here

My aim is to replace that texture with a "Gradient" texture. What would be the approach?

Update - Is there way of using my own created tiled texture to achieve that effect? I tried something using the tiled texture above - http://www.pasteall.org/blend/31547 Basicly, I want the darker parts to be used by the one node group and the lighter parts to be used by the other and all in between to transition from the first to the other. Am I doing it right?

$\endgroup$
  • $\begingroup$ This is what I have so far (holographic lines with a checkered texture) - pasteall.org/blend/31542 My aim is to replace that texture with a "Gradient" texture. What would be the approach? $\endgroup$ – Vladimir Sep 12 '14 at 23:54
  • $\begingroup$ Does Wave Texture satisfy you any way? $\endgroup$ – Leon Cheung Sep 13 '14 at 0:50
  • $\begingroup$ Here's a test with the wave texture using bands pasteall.org/blend/31543 $\endgroup$ – cegaton Sep 13 '14 at 1:03
  • $\begingroup$ Thanks for the suggestion guys. Wave texture really adds some holographic touch. But, I I still want that gradient effect (as shown in the first image above). $\endgroup$ – Vladimir Sep 13 '14 at 7:33
  • $\begingroup$ I updated my post. Am I doing it right? $\endgroup$ – Vladimir Sep 13 '14 at 9:27
9
$\begingroup$

The Vector Mapper came to mind as the first place to look, but it does seem to have the necessary capability. It's still useful for scaling and rotating textures, so we keep it anyway.

The repetition can be done with a conglomeration of simpler nodes. Being able to assemble simple nodes in all kinds of ways to accomplish anything is what makes Cycles so poweful.

Use the nodes Input -> Texture Coordinates, Vector Mapper, Converter -> Separate RGB and Combine RGB, and Converter -> Math (two of them).

Send "Generated" (or whatever your favorite) texture coordinates into the Vector Mapper, so you can control the orientation of the repeating texture. (Make sure the Min and Max checkboxes are off.) The Mapper's output is split into separate x,y,z using the RGB splitter. The Splitter doesn't care if the given data is a geometric vector or a color, as long as there's three numbers.

The three outputs feed into the three inputs of a Combiner, except 'X' (aka 'R') goes to a Math node set for Multiply. Put a number in the second slot, like 7, or 20. The output of this goes to the second Math node, set for 'Modulo'. Its second slot should be 1.0. This feeds the 'R' of the RGB Combiner.

The Combiner's output is the mapped texture coordinate with 'X' made repeating, like a sawtooth wave, ramping up from 0.0 to 1.0 then dropping to 0.0 each cycle. Feed this as the 'Vector' of the Texture node, Gradient or otherwise. Behold, the texture repeats!

enter image description here enter image description here

$\endgroup$
11
$\begingroup$

Welcome to the wonderful world of math!

enter image description here

(note that the top face gets a little screwed up if it's perfectly flat, but that's easy to fix just by adding or subtracting a small value before the Modulo math node)

Modulo is a math operation available in the Math node. It gives the remainder when dividing two numbers (e.g: 5 mod 2 = 1, 9 mod 3 = 0, or 2.3 mod 1.0 = 0.3).

In this case, we divide the coordinates (which range from 0.0 to 10.0, since the mapping scale is on 10) by 1.0, and thus for every whole number the math node shows black (remainder is 0.0), but as the decimal increases it'll get lighter (bigger and bigger remainders) until we reach the next whole number and it turns black again, restarting the cycle.

Since a gradient texture only changes on one axis, we only need to do the modulo operation on the X axis, but in other cases you may want to do it for the Y and Z axes as well.

$\endgroup$
  • $\begingroup$ Thank you. I haven't used the math node so often so that I did not try to multiply a texture with it, hehe. $\endgroup$ – Vladimir Sep 13 '14 at 23:15
  • $\begingroup$ Smart idea on using Modulo, and very good explanations. $\endgroup$ – Leon Cheung Sep 14 '14 at 5:28
7
$\begingroup$

For the mapping node to work properly you need to tell it what the existing mapping coordinates are. To do this simply add an input > texture coordinates node and plug the UV output (the model must be unwrapped) into the vector input on the mapping node.

Here is what I came up with in terms of making the horizontal lines. enter image description here Obviously there is a lot of tweaking to do, this is simply mixing two different colored emission shaders.

Here is the node setup: enter image description here
Click to enlarge

The texture coordinate node gives the mapping node the mapping coordinates to work with. Window coordinates are aligned with the view. I would suggest instead of using window coordinates, go into front view > edit mode > select all (A) > U > Project from view

The mapping node scales the coordinates in the y direction by 100 (looking at it now, that seems a bit too much).

The image texture is this one I created here. Unfortunately the generated gradient texture does not behave desirably when tiled.

enter image description here

The color ramp is simply to give a little more control of the final mixing.

Instead of two emission shaders you can use the two shaders you have already created.

$\endgroup$
  • $\begingroup$ This is what I have so far (holographic lines with a checkered texture) - pasteall.org/blend/31542 My aim is to replace that texture with a "Gradient" texture. What would be the approach? $\endgroup$ – Vladimir Sep 12 '14 at 23:55
  • $\begingroup$ Have you unwrapped the model? $\endgroup$ – PGmath Sep 13 '14 at 0:25
  • $\begingroup$ Thanks for answering. I thought it would work on "Generated" so I didn't made any unwrap. So basically, there is no way to tile a gradient texture in some way, right? $\endgroup$ – Vladimir Sep 13 '14 at 7:38
  • $\begingroup$ I updated my post. Am I doing it right? $\endgroup$ – Vladimir Sep 13 '14 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.