Make Your Prims Count Part 2: Lighting

Welcome to my second post on ways to cut back on prim use for your home, shop, or club. Today I’m going to do a bit on lighting. It’s kind of surprising how prim-intensive lighting can get, especially in objects like candles and torches. I once saw a wall torch with twenty-two prims, and can’t for the life of me figure out how they can even get that many on there! I own a taper candle in a holder, a gift from a friend, which has 8 prims. And so today I’m going to show you how to take a huge bite out of your prim usage, as well as show you some of the basics of lighting.

Candles


One of the most prim-intensive lighting items I’ve seen is the simple candle. But what if I told you that all of the candles above have only one prim apiece? That’s it! I’m going to show you how to make a basic candle, and from there, you can experiment with shapes, tapers, and twisting to make your own unique designs.

Basic Pillar Candle

Steps 1-3: Click to enlarge.

1. Rez a Cyllinder prim.
2. Set its size dimensions:

  • X: 0.1
  • Y: 0.1
  • Z: 0.5

3. Set its Slice settings (bottom right of the build window) to
B: 0.00 E: 0.50

Steps 4-6: Click to Enlarge

4. Click the Texture Tab.

5. Select a blank texture: click the texture box and select “blank”.

6. Select the color you want for your candle: click the “color” box, choose your color, and then “select”. Optional: set the shine to “low” to give it a shiny wax look.

Steps 7-9: Click to enlarge.

7. Click on the “Features” tab.

8. Click the box next to “Light” to enable light. Set the color to yellow by clicking on the “color” box, selecting yellow, and clicking “select”.

9. Set the Intensity to .5, the Radius to 5m (or smaller), and leave the falloff at .75.

10. Click the “Content” tab, and click “New Script.”

"Hello, Avatar!"

11. Double-click the “New Script” to open and edit it. Select the entire script (CTRL+A on a PC; CMD+A on a Mac) and paste the following script in its place:

//// “Jet Flame” PARTICLE TEMPLATE v1 – by Jopsy Pendragon – 4/8/2008
//// You are free to use this script as you please, so long as you include this line:
//** The original ‘free’ version of this script came from THE PARTICLE LABORATORY. **//

// SETUP: Drop one optional particle texture and this script into a prim.
// Particles should start automatically. (Reset) the script if you insert a
// particle texture later on. Add one or more CONTROLLER TEMPLATES to any
// prims in the linked object to control when particles turn ON and OFF.

// Customize the particle_parameter values below to create your unique
// particle effect and click SAVE. Values are explained along with their
// min/max and default values further down in this script.

string CONTROLLER_ID = “A”; // See comments at end regarding CONTROLLERS.
integer AUTO_START = TRUE; // Optionally FALSE only if using CONTROLLERS.

list particle_parameters=[]; // stores your custom particle effect, defined below.
list target_parameters=[]; // remembers targets found using TARGET TEMPLATE scripts.

default {
state_entry() {
particle_parameters = [ // start of particle settings
// Texture Parameters:
PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
PSYS_PART_START_SCALE, <.05,0.1, FALSE>, PSYS_PART_END_SCALE, <.01,.2, FALSE>,
PSYS_PART_START_COLOR, <1,1,0>, PSYS_PART_END_COLOR, <1,.5,0>,
PSYS_PART_START_ALPHA, (float)1.0, PSYS_PART_END_ALPHA, (float)0.0,

// Production Parameters:
PSYS_SRC_BURST_PART_COUNT, (integer) 1,
PSYS_SRC_BURST_RATE, (float) 0.1,
PSYS_PART_MAX_AGE, (float)0.2,
PSYS_SRC_MAX_AGE,(float) 0.0,

// Placement Parameters:
PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,

// Placement Parameters (for any non-DROP pattern):
PSYS_SRC_BURST_SPEED_MIN, (float).05, PSYS_SRC_BURST_SPEED_MAX, (float).25,
// PSYS_SRC_BURST_RADIUS, 0.0,

// Placement Parameters (only for ANGLE & CONE patterns):
PSYS_SRC_ANGLE_BEGIN, (float) 0.01*PI, PSYS_SRC_ANGLE_END,(float) 0.0*PI,
PSYS_SRC_OMEGA, <0,0,0>,

// After-Effect & Influence Parameters:
PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
// PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1),

PSYS_PART_FLAGS, (integer)( 0 // Texture Options:
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
// After-effect & Influence Options:
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// | PSYS_PART_TARGET_POS_MASK
// | PSYS_PART_TARGET_LINEAR_MASK
)
//end of particle settings
];

if ( AUTO_START ) llParticleSystem( particle_parameters );

}

link_message( integer sibling, integer num, string mesg, key target_key ) {
if ( mesg != CONTROLLER_ID ) { // this message isn’t for me. Bail out.
return;
} else if ( num == 0 ) { // Message says to turn particles OFF:
llParticleSystem( [ ] );
} else if ( num == 1 ) { // Message says to turn particles ON:
llParticleSystem( particle_parameters + target_parameters );
} else if ( num == 2 ) { // Turn on, and remember and use the key sent us as a target:
target_parameters = [ PSYS_SRC_TARGET_KEY, target_key ];
llParticleSystem( particle_parameters + target_parameters );
} else { // bad instruction number
// do nothing.
}
}

}

//============================= About Parameters =============================
// There are 22-ish NAMED attributes that affect a particle display.
// To customize a display you give each a VALUE.
// For example: PSYS_PART_START_COLOR is a named attribute,
// and <1.0, 0.5, 0.0> is a color VALUE (orange, in this case).
//
// As long as your ‘names’ and ‘values’ are paired up properly, they can
// be in any order! Any you omit a pair, it reverts to a default value.

//============================= Texture Parameters =============================
//
// TEXTURE, can be an “Asset UUID” key copied from a texture
// that you have full permissions to, or the name of
// a texture in the prim’s inventory.
//
// SCALE, (size) 0.0 to 4.0 meters wide, by 0.0 to 4.0 meters tall. (default 1×1)
// Textures are FLAT, so the ‘z’ part of the vector is ignored.
// Values smaller than 0.04×0.04 may not get rendered at all.
// Tiny particles vanish if the viewer is not near them.
//
// BEGIN_SCALE sets particle start size.
// END_SCALE (end size) is ignored, if the INTERP_SCALE_MASK option is disabled.
//
// COLOR, < RED, GREEN, BLUE > from <0.00,0.00,0.00> (black) to <1.00,1.00,1.00> (white/default)
// ALPHA, 1.0 = 100% visible(default), 0.0 = invisible. Less than 0.1 might not get seen.
// START_COLOR and START_ALPHA set the color and transparency of newly created particles.
// END_COLOR and END_ALPHA are ignored, if the INTERP_COLOR_MASK option is disabled.

//============================= Production Parameters =============================
//
// BURST_PART_COUNT: quantity of particles per burst, 1 to 4096 (default 1),
//
// BURST_RATE: seconds to delay between particle bursts. 0.0 to 30.0 (default 0.1)
//
// PART_MAX_AGE: particle lifespan in seconds, 0.00 to 30.0 (default=10.0)
// PART_MAX_AGE less than 0.5 might not be visible.
//
// The default total number of particles that can be seen is 4096, if one or more
// emitters try to create more than that, many will not be seen, and it may cause
// viewer lag. Use as few particles as you can for your effect:
// AGE/RATE * COUNT will tell you approximately how many particles your emitter creates.
//
// SRC_MAX_AGE: emitter auto shut-off timer. 1.0 to 60.0 seconds. 0.0 = never stop. (default)

//============================= Placement Parameters =============================
//
// PATTERN:
// DROP, ignores all other placement settings.
// EXPLODE, spray particles in all directions
// ANGLE, sprays a flat “fan” shape defined by ANGLE_BEGIN and END values
// CONE, sprays “ring” or “cone” shapes defined by ANGLE_BEGIN and END values
//
// RADIUS: 0.0 to 50.0? distance from emitter to create new particles
// (RADIUS is disabled with DROP pattern and the FOLLOW_SRC & TARGET_LINEAR options)
//
// SPEED: 0.00 to 50.0? Sets min/max starting velocities for non-drop patterns. (default: 1.0)
//
// ANGLE_BEGIN & END: 0.00*PI (up) to 1.00*PI (down), (Only for ANGLE & CONE patterns)
// (Values work much like the Sphere-prim’s DIMPLE attributes.) (defaults: 0.0)
//
// OMEGA: Sets how much to rotate angle/cone spray direction after
// every burst. 0.0 to PI? (default: <0,0,0>)

//======================== After-Effects & Influence Parameters ================
//
// ACCEL, x,y,z 0.0 to 50.0? sets a constant force, (affects all patterns)
// Causes particles to drift up/down or in a compass direction.
// Use ACCEL to create the illusion of (anti-)gravity or a directional wind.
// (ineffective with TARGET_LINEAR option)
//
// TARGET_KEY, “key”, (requires the TARGET option be enabled).
// “key” can be a variety of many different things:
// llGetOwner()
// llGetKey() target self
// llGetLinkKey(1) target parent prim
// llGetLinkKey(llGetLinkNum() + 1) target next prim in link set
//
// WARNING: New copies of objects get new keys, you can’t simply paste
// a prim’s key into your script and expect it to always work. Visit
// the Particle Laboratory’s section on TARGETS for a variety of ways
// to dynamically find your target’s key. There are different ‘best ways’
// depending on if your target is linked to your emitter or not.

//============================= About Options =============================
//
// Each option may be ON/ENABLED (no leading // )
// or OFF/DISABLED (by putting a // in front of it.)
// Options are combined together in a special way, (using the | symbol).
// This creates one single Parameter for PSYS_PART_FLAGS.

//============================= Texture Options =============================
//
// EMISSIVE: identical to “full bright” setting on prims
//
// FOLLOW_VELOCITY: particle texture ’tilts’ towards the direction it’s moving
//
// INTERP_COLOR: causes particle COLOR and ALPHA(transparency) to change over it’s lifespan
//
// INTERP_SCALE: causes particle SCALE(size) to change over it’s lifespan

//======================== After-Effects & Influences Options ================
//
// BOUNCE: particles bounce up from the z-altitude of emitter, and cannot fall below it.
//
// WIND: the sim’s wind will push particles around
//
// FOLLOW_SRC: makes particles move (but not rotate) if their emitter moves, (disables RADIUS)
//
// TARGET_POS: causes particles to arrive at a some target at end of of their lifespan.
//
// TARGET_LINEAR: forces particles to form into an even line from emitter to target
// and forces a DROP-like pattern and disables effects of WIND and ACCEL

//========================================================================
//======================== USING CONTROL TEMPLATES =======================
//
// Want to control when your particles turn ON and OFF? You can!
//
// Drop one (or more) of the CONTROL TEMPLATES from the particle laboratory
// into your object containing this script. That’s it!

// Your controls should be effective immediately. (Some controllers can be
// adjusted and tuned, open them and read the USAGE notes to see.)
//
// One control template can control several particle templates in the
// same object. (keep in mind that each prim can only have ONE
// particle effect active at a time).
//
// The ‘particle_effect_name’ value must be the same in both the control
// and particle template to work. You can change that value and have
// a controller for one effect, and a different controller for a different
// effect in the same object.
//

//======================================== END ===============================


Don’t worry about editing the script. Everything’s already done; you only need to copy the script and paste it.

12. Save the new script. This should give your candle a flickering flame, like below.

Finished pillar candle

OPTIONAL TIP: The Particle Laboratory has a pile of free particle scripts, including Candle Flame. If you prefer to use it, you can drop the Candle Flame script in place of this one.

OPTIONAL TIP: Experiment with different shapes, taper settings, and sizes to customize your candle.

Wrought-Iron Pillar Candle Holder

The candle and holder on the left total 7 prims. The candle and holder on the right have only 3.

This standing candle holder has less than half the prims of the one on which it was modeled. It gives off light, using the Basic Candle from above.

Click to enlarge.


1. Rez a Tube prim.

2. Set its size dimensions to:

  • X: 1.250
  • Y: 0.200
  • Z: 0.200

3. Set its rotation (if it’s not already) to:

  • X: 0.0
  • Y: 90.0
  • Z: 0.0

4. Set its Hollow to 85.0, and the Hollow Shape to Circle.

5. Set its Path cut to:
B: 0.300 E: 0.925

Tip: Position your prim on even meters. This makes it easier to align with other prims.

Click to Enlarge.

6. Directly beneath your tube prim, rez a Box prim.

7. Set its dimensions to:

  • X: 0.400
  • Y: 0.400
  • Z: 0.100

8. Set its Taper to:
X: 0.25 Y: 0.25

9. Move the Tube prim so that it’s connected to the tapered Box prim. While you still have the Tube prim selected, hold SHIFT and click on the box prim.

10. Link the prims by going to Tools > Link (or CTRL + L on a PC; CMD +L on a Mac). (See below.)

11. Texture the candleholder. Click the Texture tab, choose the Gray Scratched Metal texture from your Library and a dark gray color. Set shine to Medium.

12. Add your Basic Candle (above) and link (if desired).

One Prim Modern Floor Lamp

Now let’s do something a little more modern. This floor lamp is a great addition to a home or boutique.

Click to enlarge.


1. Rez a Tube Prim.

2. Set its dimensions to:

  • X: 1.500
  • Y: 0.500
  • Z: 0.500

3. Set the Hollow setting to 90.0. Keep the Hollow shape at Default.

4. Set the Hole Size to:
B: 1.00 E: 0.50

5. Set Profile Cut to:
B: 0.150 E: 0.850

Click to enlarge.


6. Texture the lamp. Choose the handy-dandy Gray Scratched Metal from the Library, set the tint to dark grey, and the shininess to Low.

7. Click the Select Texture option (just below Stretch). Holding the shift key, click the outer “shade” of the lamp, as well as the lower narrow ring surface just beneath it.

Click to enlarge.

8. Change the texture to blank, and the color to the color of your choice. I went with the coral-orange color. Optional: set the Glow to 0.10.

Click to Enlarge.

9. Release the Shift key (if you haven’t already) and select the very top of the lamp. Texture it using a Transparent texture from the Library.

10. (not shown) Click the Features tab. Click the checkbox for Light, and alter the settings as desired (for example, you might make the light color the same as that of the lampshade.

One-Prim Overhead Light Fixture

Finally today, we’re going to make a nice-looking overhead light that only consists of one prim.

Click to enlarge.

1. Rez a Tube prim.

2. Keep its dimensions (.5, .5, .5) and the rotation (0,90,0) at their default settings.

3. Set the Hollow to 70.0 and the Hollow Shape to Circle.

4. Set the Hole Size to:
X: 1.00 Y: 0.50

5. Set the Profile Cut to:
B: 0.375 E: 1.00

Click to Enlarge.

6. Texture as shown above.

7. Choose “Select Texture” (just below “Stretch”) and click just the bottom surface of the prim.

Click to enlarge.

8. Make the surface Blank, colored white, set to Full Bright, and set the Glow to 0.10.

9. Click the Features tab.

10. Check the box to enable “Light”.


Let me know what you think of these tutorials, and ask any questions you may have. Be sure to let your friends know about them as well. Thanks and enjoy!


Part 1: Bar and Stools|Part 2: Lighting|Part 3: Tables|Part 4: Artwork and Signage

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s