Using advanced material editor parameters to create animation

In many cases, it is required to animate textures scrolling or oscillating in their uv space. This can be used efficiently for things like computer screens or TV screens that have animated noise.

Getting ready

The Sandbox must be open and you must have applied a basic material to a solid.

How to do it...

Let's start using some of the advanced material parameters available to us:

  1. Clicking a + sign beside any of the texture slots will open some advanced parameters for the texture.
    How to do it...
  2. In this recipe, let's set an interference texture shipped with the SDK to the Decal slot of an object.
  3. Next, set the TypeU parameter to constant moving.
  4. Now, set the rate and amplitude to 1 and 1.5 respectively.
  5. Set the glow to 1 so that you can observe this particular texture scrolling through the uv space of the object.

You can now make all kinds of variations using these parameters and can experiment using animation on the diffuse slot and other textures!

How it works...

In this example, we have created a simple interference-type effect that can easily be applied to any screens or electronics in your level.

This technique is not only limited to being used for interference textures but it's also used often with any flowing type of objects. A good example is to use this on small rivers or lava.

There's more...

There are other techniques that can be used when adding variations and advanced material parameters. Some of these are explained next.

Animated textures

In order to animate textures in Sandbox, the texture name in the Editor must be set up according to specific naming conventions.

The technique is used to switch sequentially between a certain amount of textures at a particular rate:

  • prefix##ns_nesuffix(time).
  • prefix — is the Start of the texture name.
  • ## — is the number of digits in the animated sequence. Putting two # symbols allows for sequences of over 10 frames.
  • ns_ne — are the first and last numbers of animated sequence images.
  • suffix — optional end of texture name.
  • Time — optional time of single frame in seconds (default value is 0.05 seconds = 50 ms).

An example of an animated format is bubbles##00_12simulation(0.05).dds.

This means the texture sequence with the names: bubbles00simulation.dds, bubbles01simulation.dds, bubbles02simulation.dds through bubbles12simulation.dds is animated with the speed of 50 ms per frame.

Vertex deformation

Vertex deformation

The CryENGINE material system allows us to animate vertex deformation from some shader technique.

There are many settings available here that can be experimented with. Some specific examples of using vertex deformation is on a piece of cloth blowing in the wind or other soft objects.

See also

  • Go to the Creating basic shapes with solids recipe in Chapter 3, Basic Level Layout to learn to manipulate solids
  • Go to Chapter 4, Environment Creation to learn about the creation of a basic material
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.245.233