Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Tree lights

Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
12-10-2005 10:39
I am not sure if this is a building, texturing or scripting question really.

I have built a basic Christmas tree and would like to put several lights on it. Preferably a type that blinks on and off and different colours. But I am not sure how to go about it.
I am a bit reluctant to put a script in each object for fear of increasing lag. A slowly flashing texture? Any ideas please.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-10-2005 10:46
I'd go with a basic texture animation script in each light. Make a texture with a frame for each color change, and then apply it to each light and drop in your script. To make the light appear to flicker, use lighter and darker versions of each color. For example, have a bright red frame & a dim red frame, a bright green frame & a dim green frame, a white frame & a gray frame, etc.

If you're concerend about lag, don't be. Texture animation uses zero sim resources, and very little client resources. Keep the texture small, use the same one in each light, use full bright instead of material light, and lag won't be an issue at all.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
12-10-2005 10:55
Thanks chosen, that makes a lot of sense. Do you know if the script is available in the public domain. I had noticed some street lights have had a nice yellow glow. Would that be done with a simple texture also?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-10-2005 11:52
Yes, the glow around lights would usually be done just with texturing. A subtle alpha gradient on two intersecting planes (flat cubes) usually does the trick. You could also create a similar effect with particles if you're short on prims.

To answer you question about the texture animation script, see http://secondlife.com/badgeo/wakka.php?wakka=llSetTextureAnim
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
12-13-2005 06:32
Having read the wiki for llSetTextureAnim I am still a little confused.

"start and length specify which texture frames to animate.

start: frame number to begin animating from (frames are numbered from left to right, top to bottom, starting at 0)
length: how many frames to animate (length = 0 means animate all frames)
rate is the frame rate at which to animate. 1 means 1 frame per second, 10 means 10 frames per second, etc."

The left to right top to bottom is confusing me. I was under the impression I would supply textures to the prim inventory texture01 texture02 etc. and these would cycle according to the rest of the parameters. Am I wrong?
Keith Extraordinaire
Build! Must Build!
Join date: 8 Jul 2004
Posts: 59
12-13-2005 18:37
Hi Bobby,

I’ve made a few sets of animated lights.

How the animation script works is like frames of a film. How many changes you want to make and how subtle the changes need to be will determine the number of frames. All the frames are laid out on one texture in a grid. The trick is making sure the texture is repeated and lined up perfectly on the texture or else you’ll get a waver in the final image. I’ve found using nice round numbers for my texture sizes, using key marks for the edges, and using the snap function very helpful when laying it all out. Then when it’s all done I’ll resize it for uploading.

The script will need to know how many columns and rows you are using in the texture. In the example it would be 2, 2. Once set it will cycle through them like frames of a film and the grid will be unseen you will just see 1, 2, 3, 4 looped. For lights you can easily get by with just two frames.

KX
_____________________
KX Designs Studio ~ Serenite ~