Gradients: color, value, number

Joel

Active member
4-gradients.jpg


grad_mats.jpg


I posted this stuff a few years ago. Now I’m attaching an improved file with four samples to go with with a related tutorial I am posting about gradient backgrounds.

Gradients are powerful. They are aesthetically beautiful, and because C3D colors have values between 0 — 255 gradients can be plugged into material nodes to vary colors, transparency, brightness, and scale.

This all started with a Frank Beckmann material using a vertical gradient to add a green tint to a car windshield. At first I used similar materials for blending diffuse colors. I was surprised to find that grayscale gradients can also be inputs for varying transparency, brightness, and scale.

The purpose of the attached file is to demonstrate how gradients can be both funky and functional. The examples are intended to be starting points for making new materials. The UV Mapper was an integral part of the process; three were Cubic types (selected polys only), but the Voronoi was Spherical. Note that I had to scale up the Voronoi cube 400% and burn the transform to get the right scaling effect; there may be a better way.

Concentric gradients (State node = IN) plugged into an emissive material can make glowing effects, but I had to do a lot of trial and error. Laser swords and rocket exhaust can be faked. Until C3D introduces volumetric materials, this might work.

I don’t do animation, so I don’t know how this might be applicable. I’d like a simple technique to cycle through the colors of a gradient if someone could post an example.

Using grayscale gradients and textures as inputs is simple and intuitive. It can easily be adapted for all kinds of new materials.
 

Attachments

  • 4_grads.jas.zip
    24 KB · Views: 157
Last edited:

misoversaturated

Active member
Hi Joel, thanks for your tut!

I don’t do animation, so I don’t know how this might be applicable. I’d like a simple technique to cycle through the colors of a gradient if someone could post an example.
There is a simple temporal color shift example included in the attachment, if that's not what you meant please tell me and I will try again :)

But I also want to expand a bit on circular gradients which can be useful in many cases.
Setting up a radial gradient is easy, just a Norm node from the State node's position will do it.
It will show color 0 = black at the origin and move to 1 = white at distance = 1 from the origin, when the object is bigger or smaller a multiplication node is advised for adjustment of the range.

circtang.jpg


Tangential gradients are more difficult and a tad beyond my math skills so I did not manage to construct an even one.
The node setting is more complicated also, I arrived there by trial and error.

circrad.jpg


And last a version that drives a fractal bump map:
The radial component and the tangential component are mixed by the radial gradient so that one dominates the center and the other the periphery.

image.jpg

These are volume oriented 3D materials, not surface driven UV materials.
 

Attachments

  • gradients.zip
    125.6 KB · Views: 151
Last edited:

Joel

Active member
First, thanks again to Misoversaturated for the symmetrical materials from a year ago. I can now make a pair of mirror-image materials and then apply them to any bilateral or radial symmetrical model. Perfect.

https://www.cheetah3d.com/forum/index.php?threads/13033/

LV_pig.jpg


I don’t do animation but I was curious to take random particle colors a step further. I barely remember which buttons to push to make things go. I looked over the ,jas files you attached here. One of the three .jas files you posted (temporalchromaticgradient.jas) does something like I’m after, where a single ball changes color, by passing tbrough the gradient from left to right. It uses a State node set to Time which must be the magic ingredient I was looking for. I combined it with an Instance-Random node in a Mix node set for 50%. The Solid shader has Intensity set at 1.5 to get a spooky iridescent glow on the base.

animat.jpg


A subtle detail in the your gradient: because the two end colors are slightly different (255-0-0 — 255-0-1) the Chromatic setting makes a neat rainbow, whereas 255-0-0 — 255-0-0 just stays plain red. Good to know. I tweaked that to have a double rainbow gradient (255-0-0 — 255-0-1 — 255-0-2).

As far as I can tell the Multiplication node you set at 0.25 makes it pass through 25% of the gradient per second so each particle goes through all the gradient colors in four seconds, and the Modulo node makes it loop back to the start.

The animation is simple, with Take 0 = 4 seconds, Frames Per Second = 5. Resolution = 600 X 600, Cheetah = Radiosity. I can’t post an MPEG, but it only takes a half a minute to render the attached file and run it. Result: Timothy Leary’s pig spends Christmas in Las Vegas.

The other two files for radial and tangential gradients make some beautiful materials but the Math nodes are beyond my comprehension. I will experiment with them to try and learn something. I only understand a few arithmetic Math nodes (like Multiply). I sometimes use materials from the forum that incorporate Math nodes I don’t understand (like Modulo).
 

Attachments

  • LV_pig.jas.zip
    136.5 KB · Views: 152

Jeanny

Well-known member
Joel & Miso

What Great Christmas Gifts !!!
I am so appreciative of your posts. :love:

Thank you so much for elaborating on the details of the mathematics of some of the Matt Nodes. My knowledge of the Matt node system is very limited; therefore I find it very mysteriously eluding. :eek::confused:o_O
Thank you so much for including your jas files!
As excellent as your explanations are, I wouldn't be able to completely comprehend them without the jas files.

I know this is just the tip of the iceberg, per say, but it is one more step closer for me to be able to create desirable effects with the matt node system.

As much as I find Las Vegas unsettling I am so glad Timothy Leary's pig ventured there.:)

My Best
Jeanny
 
Last edited:
Top