Castle Textures – Set 2

January 25th, 2010

My Christmas break was a bit longer than anticipated, but now I’m back and with a new texture set! This is the second in the new collection of castle textures, and this one adds windows and doors to go with the walls from the previous set.

Here is a quick preview:

Castle textures, set 2 sample

Visit the store to see the full set.

As usual, you can also buy the set from XStreetSL ,and you can also buy it from the MetaLife website:

XStreetSL page

Meta-Life page

Not An Introduction to Second Life Prim Lights

December 1st, 2009

This is dedicated to those knowledgeable and helpful folk over on the SL Universe forums, without whom this post might never have been written.

This is not the post I was going to write.

I was going to give an introduction to using Second Life prim lights. Because I needed some illustrative snapshots, I created a simple prim, activated the light feature, and started taking pictures.

At which point I realised that after five years in Second Life there are still things that I don’t know, one of them being that lights don’t quite work how I expected.

As an example, here’s a cube which has been turned into a light-source. You can see it lighting up the floor, as expected:

Well…maybe not quite as expected. Why does the light have such a peculiarly elongated and patterned appearance?

What’s happening is that the light is revealing some of the underlying structure in the Second Life world. Turning on wireframe (this is in the Advanced menu, if you want to try it yourself) gives an indication of what is going on. I won’t post a picture, because a static picture of the wireframe view is just a confusing mass of lines. If you try it yourself, though, you will notice that the lines and intersections (technically known as vertices) match the pattern of the light. When a light shines on a prim, the appearance is changed at the nearest vertex.

Let’s move the cube so that it is ‘between’ vertices:

The light fades. It doesn’t vanish altogether, but it is certainly less visible.

If the cube is moved again, over the next vertex, the full light returns:

If the light follows the vertices, what happens if the prim that the light is shining on is resized? Given what we’ve just seen, it’s perhaps unsurprising that resizing the prim will change the appearance of the light:

This has the odd result that resizing the light prim has no effect on the light that it casts, whereas resizing the prim that the light falls on does have an effect!

So, when you are trying to set up lights in Second Life, you have more to think about than you might have imagined. The position of the lights in relation to the prims that they are illuminating, and the size and shape of the prims that the light falls on, all have an impact on the final appearance of the lights.

In the next article in this series I will go back and write the post I originally intended, and give more of a basic introduction to lights.

Textures – A Few Quick Tips

November 20th, 2009

Some hints and tips that might make working with textures quicker and more efficient.

1. Instantly apply a texture

…without even opening the Build dialog! Simply drag a texture from your inventory onto the surface that you want to texture. The texture will instantly be applied to that face. Obviously this will only work on prims that you have modify permissions for.

2. Applying a texture to multiple faces

In the Build menu, tick ‘Select Texture’ as usual, and select the first face. Then hold down the Shift key and click on any other faces that you want to texture, even on completely different prims. Then apply the texture that you want, via the Texture tab. The texture will be applied to all the selected faces.

The only catch to this is that sometimes Second Life is a bit flaky about actually texturing all the selected faces, so don’t unselect straight away, and simply re-apply the texture if it doesn’t ‘take’ to all the faces.

3. Using the dropper

On the Texture tab, click the texture image to bring up the texture selection dialog. There is a small ‘dropper’ icon at the bottom of this. Click this icon, then click on any other prim face, and the texture from that face will be selected for the current face. This will only work to pick up textures that you have copy permissions for.

4. Choose between the texture selection dialog or your inventory

There are two ways to directly get a texture onto the texture tab (and hence on to the selected prim or face), either by dragging a texture from your inventory onto the texture image, or by clicking the texture image to call up the texture selection dialog.

Both have their pros and cons.

The Texture Selection dialog will search through your Inventory, and will only show you the textures or snapshots that you can apply as a texture. It will hide everything else, including textures that you cannot use (probably because you don’t have copy permissions for them). This is useful, but if you have an
inventory of any size it can take some time for the list of textures to fill up.

If you use your inventory instead, you don’t have this delay, but of course you will be shown everything, including textures/snapshots that you cannot actually use. If you try to drag these onto the texture image, the cursor will change to a ’stop’ icon to show that you cannot use them.

5. Use the Library

Down at the bottom of your inventory is a folder called Library, which contains a default collection of stuff that Linden supplies to every avatar (they sometimes add to this collection, so it’s a good idea to take an occasional look here for new things). It includes a useful and varied collection of textures. Before you spend your hard-earned Linden Dollars buying a new texture, look here first, to see if there is already something which suits your needs.


6. Use the Library’s default transparent and media textures.

If you need a fully transparent texture, or a texture to display videos on (a subject which is beyond the scope of this blog entry), the Library has default textures for these (they are at the top of the Library ‘tree’, not in the Textures folder). The advantage to using these is that they are very likely to already be in the viewer’s cache, and hence won’t need to be downloaded, which means that they will rez much faster.

8. Use the bumpmaps and colors

I’ve mentioned this in a previous post, but it’s worth repeating: experiment with the bumpmaps option on the Texture tab. Using bumpmaps, and applying colors, can create good textures without making use of a texture image at all (simply change the default ‘plywood’ texture to ‘blank’), or can create useful variations of existing textures.

Also worth repeating is the example to illustrate this technique:

Castle Textures – Set 1

November 9th, 2009

This is the first in a new collection of texture sets, for castle builds. This set consists of textures mainly for walls, floors, and ceilings. As usual, they seamlessly tile, and are all at 256×256.

A few examples:

You can get them from the Main Store, or from the XstreetSL page.

Cave Textures – Set 1

November 3rd, 2009

A new collection of textures, this time for cave walls and floors, and probably suitable for cliff-faces and similar environments. As usual, there are 20 textures, 256 x 256, and they all seamlessly tile.

A few examples:

You can find them at the Main Store, or on the XstreetSL pages.

Animated Textures – Tutorial 3

October 24th, 2009

In the previous two articles you saw how to use llSetTextureAnim() to activate conventional animated textures. This is the usual way of animating textures in Second Life.

There is another way, which involves using a script and a timer, along with the ‘offset texture’ function. This is far less efficient than using a normal animated texture, but there are occasions when it can be useful.

Let’s have an example. In the first set of animated textures released by Templar Creations you will find an animated gauge, with three frames of animation. If this is animated in the normal way, the effect is like this:

Animation example

Although this works, it’s rather ineffective. It would be better if the needle moved randomly. That can’t be done with a normal animation, but it is possible using the timer system.

The way this works is that the script sets up a timer, and each time the timer event fires, the script selects a random frame and displays it. I can’t easily demonstrate this is on a webpage, but if you visit the main Templar Creations store you will find a running example.

So, how do you display a specific frame?

In the previous article you saw how to display a single frame of an animation, using the ‘repeats’ setting on the texture tab of the Build dialog, and the llOffsetTexture() function.

For this example, let’s set the repeats in the script itself. The texture in question has three frames, so the horizontal repeats must be set to 0.333. The script will put the offset at 0.0, which will display the second frame, with the needle pointing straight up.

Why does an offset of 0.0 display the middle frame? Because the offset is from the middle of the texture. An offset of 0.333 will move the texture to the left so that the third frame is displayed. An offset of -0.333 (or 0.666, because textures wrap around) will move the texture to the right, so that the first frame is displayed.

Imagine that the texture is a long strip extending out from both sides of the visible prim face. Here it is at the default offset of 0.0, so that the middle frame is visible:

Offset 0.0, Frame 1

Offset 0.0, Frame 1

Setting the offset to 0.3333 shifts the strip of frames to the left, displaying the third frame:

Offset 0.3333, Frame 3

Offset 0.3333, Frame 3

Setting the offset to -0.3333 shifts the strip to the right, displaying the first frame:

Offset -0.3333, Frame 1

Offset -0.3333, Frame 1

Naturally, if you have a different number of frames, these numbers will also be different.

The script makes use of the llFrand() function to return a random number between 0 and 2, which it then uses to select the correct frame, and sets the offset for that frame. It also uses this to set the delay between frames to a random amount.

It also sets the texture scale, so that one frame at a time is displayed.


list Offsets = [0.666, 0.000, 0.333];
integer Frame = 1;
default
{
    state_entry()
    {
        llScaleTexture(0.333, 1.0, ALL_SIDES);
        llOffsetTexture(llList2Float(Offsets, Frame), 0.0, ALL_SIDES);
        llSetTimerEvent(llFrand(0.5) + 0.1);
    }
    timer()
    {
        Frame = (integer)llFrand(3);
        llOffsetTexture(llList2Float(Offsets, Frame), 0.0, ALL_SIDES);
        llSetTimerEvent(llFrand(0.5) + 0.1);
    }
}

That concludes this short series of articles on animated textures.

Steampunk Textures – Set 7

October 17th, 2009

Now available from the main store and from XstreetSL, this new texture set is mainly for walls and floors, and consists of 20 seamlessly tiling textures.

A few examples:

Sample 1

Sample 2

View the set on XstreetSL

Visit the Templar Creations Main Store

Animated Textures – Tutorial 2

October 1st, 2009

In the previous blog you saw how to use the SMOOTH option for simple animation. Although this is useful, it is also rather limited. The usual way of creating animated textures is by way of a texture which contains a set of ‘frames’, in a way very similar to that used in traditional animation.

Note: the examples from this blog are available as full-perm pre-built prims at the Templar Creations sandbox (behind the main store), for you to copy and experiment with, and use in your own builds if you wish.

Let’s have an example. Here is a texture which has three frames, to create a rotating gear:

Gears example

Gears example

Gears example (animated)

Gears example (animated)

Let’s assume you are starting from scratch. When you apply the texture to the prim, all three frames will be displayed (and will be ’squashed’ horizontally):

Gears image applied as texture

Gears image applied as texture

This will be corrected when the animation starts running, but it is often useful to have a single frame displayed when the animation is not active. To do this for this particular texture (and any texture which has just three horizontal frames), you need to set the horizontal repeat to 0.333, so that just 1/3 of the texture is displayed. Set the horizontal offset to 0.666 to display the first frame (understanding the offsets, and how to calculate the offsets you need in order to display specific parts of a texture is an entire future blog article in itself!).

When the texture is not being animated, it will revert to this display.

To start the animation, you need a script. On the Contents tab of the Build dialog, click the New Script button, and double-click the script that appears, to edit it.

For this demonstration, the script will switch the animation on and off when the prim is clicked on, so delete the contents of the script, and replace it with the following:


integer isRunning = FALSE;
default
{
    touch_start(integer count)
    {
        if (isRunning)
        {
            llSetTextureAnim(0, 0, 1, 1, 1, 1, 5.0);
            isRunning = FALSE;
        }
        else
        {
            llSetTextureAnim(ANIM_ON | LOOP, 0, 3, 1, 0, 3, 5.0);
            isRunning = TRUE;
        }
    }
}

The script uses the isRunning variable to keep track of whether the animation is on or off. When someone touches the prim, if this is FALSE (the animation is not running) it starts the animation, otherwise it stops the animation.

So, what are the parameters?

The first parameter is a set of flags, which in this case switch the animation on (ANIM_ON), and set it to play continuously (LOOP). The next parameter is the side of the prim which is to be animated. Use ALL_SIDES to animate all the sides of the prim. In our example, only side 0 is animated.

The next two parameters describe the layout of the frames — how many there are horizontally (3 in this case), and how many there are vertically (1 in this case).

Suppose we had a texture which contained two vertical rows of three frames each. The frames in this texture would get displayed in the following order:

Animated frames example

Frame order example

The next two parameters are the first frame, and the number of frames. This means that you can display only part of an animation if you want to. Some of the animations in the Animated Texture pack make use of this by having the very first frame as the ‘off’ frame, and displaying frames 2 to the end for the actual animation.

Note that the frames are numbered from 0, so in our three-frame example the frames are 0, 1, and 2.

The last parameter is the frame-rate — the number of frames per second.

In the previous blog post, the animation used the SMOOTH flag to scroll a single frame smoothly across the prim surface. Let’s take another look at this, because there is a little more to the SMOOTH option.

To demonstrate this, let’s have an image of 6 numbers:

Scrolling frames example

Scrolling frames example

Apply this texture in place of the original and replace the second llSetTextureAnim call in the script with the following:

llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, 0, 6, 1, 0, 6, 0.5);

Save it, and touch the prim again to restart the animation. This time, you will see each number smoothly scroll into view.

In the next tutorial blog, I’ll show a third way of animating textures, which doesn’t make use of llSetTextureAnim() at all.

Animated Textures – Tutorial 1

September 19th, 2009

With the recent release of the Animated Steampunk Textures pack, this would be a good time to do some tutorials on animated textures, so here we go…

This is the first of a three-part tutorial about using animated textures in Second Life. There three parts, because there are three different ways of animating textures, each with their own use. Two of them make use of the LSL function, llSetTextureAnim, which is the usual way of animating textures. The third way uses a timer and offsets to manually animate the texture — it is a lot less efficient, but can occasionally be useful.

In this first part, however, I’ll look at the simplest and easiest way of animating a texture, using the ’smooth scroll’ option. This simply moves the texture across the surface of the prim, and doesn’t need a specially designed texture — any texture can be scrolled, although some will obviously work better than others!

A common use of this is to create a flowing water animation, and that’s the example I’ll use here, especially as suitable textures are available from the built-in Library in every Second Life avatar’s inventory.

So…

Rez a simple cube, and apply a water texture to it — the Water – ripple layer 1 texture in the Library\Textures\Waterfalls folder should work well. Resize it into something fairly long and flat (5 x 2 should be effective).

On the Contents tab of the Build window, click the ‘New Script’, and wait for it to appear in the Contents list (if SL is being laggy this might take a few seconds). Double-click to open it.

Replace the existing code with the following:


default
{
    state_entry()
    {
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, 0, 1, 1, 1, 1, 0.12);
    }
}

Save the script, and the texture will start scrolling. Assuming that you haven’t rotated the prim, this will scroll the top surface.

Ok, now you’ve seen it in action, let’s look at the parameters.

The first parameter is a set of flags which specify how the texture should be animated. You can string together several flags (as in the above example) by using the ‘|’ symbol (technically an ‘OR’ operator). Note that some combinations don’t make sense.

You can check the LSL Wiki page for details of what each flag means, but in the example we are switching the animation on (rather important!), and we are saying that we want a ‘SMOOTH’ animation, which means that the texture will simply be scrolled across the surface of the prim (actually, this is not quite an accurate description of what SMOOTH does, but I’ll explain it in more detail in the next article).

Finally we are specifying ‘LOOP’, which means that the animation will keep going continuously.

Instead of LOOP we could have specified PING-PONG, which reverses the animation when it reaches the end. In the case of a smooth animation, it will scroll the texture for the entire length, then reverse direction and scroll it back again.

If you want to stop an animation, simply set this parameter to 0. All the other parameters are irrelevant in this case.

The next parameter — 0 in this example — is the face of the prim that the animation should be applied to. All the other faces will be static. However, if you use ALL_SIDES for this parameter, all the faces of the prim will animate.

Unfortunately, it isn’t possible to animate some but not all of the faces – it’s either 1 face or all faces.

A couple of final notes. You’ll notice that the Repeat and Flip options for textures don’t have any effect on animated textures. Rotate, however, does.

That will do for now. In the next article, I’ll take a look at the traditional animated texture, which uses a sequence of frames like an animated movie.

More Steampunk Goodness

August 15th, 2009

Yes, a new set of Steampunk textures! Not only that, but sets 4, 5, and 6 (the new set) are now available as a combined Steampunk Textures Collection 2, for a discounted price of L$250.

A couple of samples pictures from the new set. There are actually four textures in each picture, but they fit together seamlessly, so it might not be immediately obvious!

Steampunk Textures Sample 1

Steampunk Textures Sample 1

Steampunk Textures Sample 2

Steampunk Textures Sample 2

You can get these in-world at the main store (see the SLURL link in the right-hand sidebar), or you can find them on the XStreetSL pages:

Steampunk Textures Set 6

Steampunk Textures Collection 2