Jump to content

What can texture animations be used for?


ChinRey
 Share

You are about to reply to a thread that has been inactive for 1589 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Yes, I know this is a strange question. Instead of looking for solutions to a problem, I'm looking for problems for some solutions.

Bel, my scripter alt, is starting a series of scripting classes for beginners at HHBS this Saturday and the title of the series is "Things that Move". Five, or possibly six, of the classes will cover texture animations, frame animation, smooth linear scrolling, rotate, scale and ping pong. If there's a sixth class, it will be about smooth animation with texture repeats.

I want to present items that are actually useful for the participants rather than just "theoretical" exercises, they have to be fairly simple objects (these are scripting classes, not buiding classes) and of course not to big.

I have some ideas. For frame animation I was thinking of a neon sign and for smooth linear a scrolling text display but I'd love to hear other suggestions and for the other kinds I don't really have any ideas I'm happy with. I could do water animations of course but that's a bit too boring. For rotation I was thinking of a "hypnotic spiral" kind of thing but that may be a bit to niche and a fan would probably be more suitable for the omega rotation class.

Any other suggestions?

Link to comment
Share on other sites

Try this on a cube prim flattened on X.

default 
{
     state_entry()
     {
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,4,"174e4fad-3bd8-12f8-0c9d-ae238420f47c",<1,1,1>,ZERO_VECTOR,0.0,
          PRIM_COLOR,ALL_SIDES,<0.7,0.0,0.9>,1.0]);
        llSetTextureAnim(ANIM_ON | LOOP, 4,17,2,0,0,10.0); 
     }
} 

I've had that texture hanging around in my inventory for at least ten years.  It makes a nice demo.

  • Like 2
Link to comment
Share on other sites

Some time ago I acquired a recreation of the Flaptter vehicle from the Laputa Castle in the Sky anime. It had a set of dragonfly-like sculpted wings which would rapidly toggle their alpha on/off to simulate the frantic beating of the wings. This naturally produced a truckload of object updates when in use, which I wasn't keen on. Luckily, it was modify enabled so I found that I could make a much more efficient effect by using a simple texture animation that was essentially two frames: the visible wing, and full alpha (I also reduced the texture size considerably since high detail wasn't needed). Instead of hammering the server with turning alpha on/off, I could just start the animation on the wing sculpts.

Similarly, I have also been able to replace a pulsating color transition that originally used many llSetColor calls with a smooth low-resolution texture of a color gradient. Granted, it's not always possible to make these kind of substitutions, but when the object and texture designs allow, it can be done.

  • Like 2
Link to comment
Share on other sites

With advanced lighting and shadows from projectors, you can create a flashing light effect.

In this example I have just a plain white circle as the projector texture. In front of the light (facing the light source) I have a prim with a texture animation that flickers between solid and full alpha.

https://gyazo.com/fea61f7438f44b3b5b72bf1ea7b9c2eb

Can also be used without a projector texture or a wider FOV on the projector to create a flickering light around the whole room

  • Like 2
Link to comment
Share on other sites

Do you want a smooth color transitions on a surface? Don't do repeating timers or complicated color math.

Create a texture with the desired color gradient, and smoothly slide it across the surface. You can have as many colors as you want and it's easy to control, and it works great with small textures!

You could even create a greyscale texture so it becomes tintable while giving you control of the color's brightness. 

  • Like 2
Link to comment
Share on other sites

Rain. I saw a huge rain object, with animated textures on four vertical planes, in Bellessaria today. The textures move a pattern of droplets downward.

A nice feature of that approach is that you can make a rain object that keeps the rain outside.

Edited by animats
  • Like 1
Link to comment
Share on other sites

6 hours ago, animats said:

Rain. I saw a huge rain object, with animated textures on four vertical planes, in Bellessaria today. The textures move a pattern of droplets downward.

A nice feature of that approach is that you can make a rain object that keeps the rain outside.

While it looks decent, it's very impractical if you expect any avatar to be walking in the rain.

The planes block mouse clicks, so you cannot click on anything, even your own avatar, if there's a rainy surface between your target and your camera.

  • Like 1
Link to comment
Share on other sites

I think viewers still need to have Advanced Lighting Model enabled to see emissive alpha, but maybe everybody runs with ALM now; if so, this is a kind of fun effect:

integer mode;
float speed = 8.0;
key BLINKENLIGHTS = "7c87789f-d2ac-f152-c125-985f787a64cb";

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS,
            [ PRIM_SIZE, <0.75, 0.75, 0.188>
            , PRIM_TEXTURE, ALL_SIDES, TEXTURE_BLANK, <1.0, 1.0, 1.0>, ZERO_VECTOR, 0.0
            , PRIM_TEXTURE, 3, BLINKENLIGHTS, <1.0, 1.0/16.0, 0.0>, <0.0, 1.0/32.0, 0.0>, PI
            , PRIM_TEXTURE, 1, BLINKENLIGHTS, <1.0, 1.0/16.0, 0.0>, <0.0, 1.0/32.0, 0.0>, PI
            , PRIM_TEXTURE, 2, BLINKENLIGHTS, <1.0, 1.0/16.0, 0.0>, <0.0, 1.0/32.0, 0.0>, 0.0
            , PRIM_TEXTURE, 4, BLINKENLIGHTS, <1.0, 1.0/16.0, 0.0>, <0.0, 1.0/32.0, 0.0>, 0.0
            , PRIM_ALPHA_MODE, ALL_SIDES, PRIM_ALPHA_MODE_EMISSIVE, 0
            , PRIM_COLOR, ALL_SIDES, <1.0, 0.8, 0.2>, 1.0
            , PRIM_GLOW, ALL_SIDES, 0.15
            , PRIM_COLOR, 0, ZERO_VECTOR, 1.0
            , PRIM_COLOR, 5, ZERO_VECTOR, 1.0
            , PRIM_GLOW, 0, 0.0
            , PRIM_GLOW, 5, 0.0
            ]);
        
    }

    touch_start(integer total_number)
    {
        mode = (mode + 1) % 5;
        if (0 == mode)
            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 4.0, 4.0, speed);
        else
        if (1 == mode)
            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 4.0, 7.0, speed);
        else
        if (2 == mode)
            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 1.0, 4.0, speed);
        else
        if (3 == mode)
            llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 1, 16, 15.0, 2.0, speed);
        else
            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 11.0, 5.0, speed);
    }
}

The texture isn't quite perfect but good enough to demonstrate the effect and to pass for a variety of different caution blinkers on touch.

To the general topic: I think after good ol' waterfalls, pools, and flames, the most common use of texture animation these days is to make plant leaves flutter in the "wind". I don't have a good free-to-share sculpt UUID for grasses, nor a good shareable off-the-shelf texture, but it's a reasonable way to demonstrate ping-pong smooth rotation over a limited range, and to illustrate why it looks best when only half the texture is used (in contrast to a certain popular plant creator's attempt at this).

  • Like 1
Link to comment
Share on other sites

Since texture animation works on all texture channels you can make some very nice running water effects using a  seamless fractal noise generator to create normal/specular maps & alpha channels, etc and tweaking the UV mapping on your mesh to control the speed/direction of the flow of the water.

water_noise.jpg.a67f106ec3ba22feb69533782326b1f3.jpg

water.thumb.JPG.a8b3ccb5c7a6e637b3d7fd87d54d882a.JPGwater_anim.thumb.gif.1a0e034faf976b4248bf7829518a2ded.gif

  • Like 3
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1589 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...