Introduction to Ramps & Gradients |
|||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
What This Section Is For Many of the shaders in this collection use Ramps and Gradients to control their processing, and rather than repeat details for each shader, it’s easier to explain the ideas in general, as they apply equally to all the shaders. First, some definitions (as used within TG Pack 3 - I take no responsibility for these definitions matching exactly their use in other packages or contexts!) : Ramps Gradients |
|||
![]() |
|||
Why Use Ramps & Gradients? Advantages 2) When the shader itself controls a parameter, you are limited in what you can create. You can only have as much variation as there are variables in the shader - for example, the TG Slope Bands shader only allows the blending of 3 colours, since that’s the number of colour parameters provided in the shader interface. By using a Gradient, you can then move the blend between as many (or as few) colours as you wish, allowing for much finer control over the result. Using a Ramp to control a variable brings a similar benefit - for instance, the TG Glow Transparency shader only allows for 3 transparency “points”, these being for the inner value, a moveable middle value, and an outer value. With a Ramp, though, you can have as many transparency points as you wish, with the rise and fall of the intensity of the pixels in the Ramp controlling the transparency value and the positions that those effects occur at. Not only that, but you can vary the value in a non-linear way, or with sudden breaks and changes, with as many repeats as you like, or with randomisation in the Ramp too.
Disadvantages Of course, over time, you can build up a library of Ramps and Gradients, which will always be to hand. |
|||
![]() |
|||
Where do I find Ramps & Gradients? There are sample Ramps and Gradients provided along with the shaders. These can be found in the following folders (these assume you are using trueSpace 5, and that you installed it to the default directories - if not, simply look in your trueSpace 5 folder and follow the path from there!) : C:\trueSpace5\ShaderLab2\Shaders\TG Pack 3 SL2\Ramps\ You can store your own Ramps and Gradients wherever you like, but you might like to keep them in these folders for ease of use in future! |
|||
![]() |
|||
How do I create my own Ramps & Gradients? The simple answer is, any way you like! There are several more obvious ways though. First, you can use an art package, and use linear or Gradient fills to make a Ramp or Gradient. A quick and easy way to produce suitable images is to use trueSpace itself - the free Axion Simple Gradient colour shader can be used to produce either Ramps or Gradients quite easily, by painting a plane using the shader in the colour channel, and the Constant reflectance shader (although you are limited to as many sweeps and changes across the image as there are parameters in that shader, naturally). Technical Note 1 : In order to save on processing, the shaders actually take a little shortcut when reading from a Ramp, and ONLY read the red channel colour information. This means that a Ramp that runs from black to full red will work exactly the same as one that runs from black to full white. There’s no advantage to using Ramps that only contain red channel information, though, and I find it easier to visualise and see details when working with greyscale Ramps, so I’ve stayed with using greyscale images for the Ramps. Technical Note 2 : The height of the Ramp image is irrelevant - the shaders always read across the top line of the image. Make your Ramp images as tall or as short as you like, whatever makes them easier to work with. Technical Note 3 : In width of the Ramp image isn’t critical either - the shaders read by a “percentage” along the image width, so they can be as long as or as wide as you like. To some extent, wider images will allow for smoother graduations in values (although how smoothly the shader reads from that image is dependent upon other factors - eg, if based on distance, and the range of distances set is very short, there’d be little need for a particularly long and smooth Ramp or Gradient). |
|||
![]() |
|||
Introduction to Ramps and Gradients |
|||
![]() |
|||