Jump to content

Features->Light will always emanate from center of a mesh?


Codex Alpha
 Share

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

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

Recommended Posts

I'm working with Blender to make meshes for 2nd Life.


It appears as though my hanging lights, standing lights, etc do not emanate light from where I would expect them to; in a radius from the source 'face' or 'material' assigned to do so.


For example, you create a hanging light or chandelier, and the light appears to be displaying a radius around the ENTIRE mesh, rather than from the source face.

If you make a mesh creature who is holding a light source, the same thing occurs. One would expect the creature's face to be illuminated, but it is not; only the surroundings are.


Is this normal for 2nd Life currently, or am I missing something, like changing the source/pivot/center point of a mesh so that the light displays correctly.

Kind of weird to expect a hanging light to illuminate a counter/bar top in-game, but it's lighting up the ceiling and everything else instead...

NOTE:  In theory, I could add an object/mesh after the fact in-game, as either a part of the mesh's design, and therefore have control over light source (eg., adding a small invisible sphere), but that adds to Land Impact cost, and defeats the purpose of creating an intact mesh that works from the start...

Light Source of Mesh from center?

Thanks for your responses.

Link to comment
Share on other sites

Prim Point Light does not illuminate the object that generates it.  It is intended to illuminate areas.  Like particles and several other secondary effects, it is generated at the prim's geometric center. If you want to make the surface of an object appear to be lit, you may use Prim FullBright or Prim Glow.  Fullbright is either On or Off; there's no in between.  If On, it makes the selected surface appear as it would with direct sunlight at SL noon.  Glow is adjustable, but you have to be very careful with it.  Values over about 0,05 can look increasingly radioactive.  I mentioned particles above only because it is also possible to create the effect of light around an object by creating a static glowing particle that is slightly larger that the object, giving it the appearance of a soft aura or halo.  That can be especially effective around, say, a street lamp. 

Link to comment
Share on other sites

If you want the light source to be emitting from the chandelier you have two options.

1. You can simply use a regular prim and place it inside the chandelier.

2. You can add another face to your mesh object probably near where the floor will be and to the left a bit making it so that the center of the mesh object is right where the chandelier is.  This will make the object bigger though and depending on how you made the mesh can increase the prim count.  You can make the new face invisible so no one will see it.  Just remember to add the face to all the lower LODs as well or you will get an error when trying to upload the mesh.

Hope that helps. :)

Cathy

Link to comment
Share on other sites

As said by the others - light source is a property of the prim (mesh or other), not of a face. This is true for projected lights in the advanced lighting model as well as for the traditional omindirectional lights. The effective location of the source is always the center of the prim's bounding box. You have to take that into account to get the desired effects.

 

Link to comment
Share on other sites

That's what I figured, thanks. Was hoping I was doing something wrong, and change the center of the source of light.

We need spotlights or source->targets in 2nd Life, similar to the game engines I have worked in before, so spotlights and areas of effect could be done :D

Link to comment
Share on other sites

Projectors are only available with Advanced lighting. For residents not using this because of lower power gpus, they will beheve as traditional lights. There is a limitb of six simultaneous traditional lights allowed to be visible - the mearest six. there is no limit I know of for projected lights.You need to take these factors into account if you want your lighting to be satisfactory for both those with amd those without advanced lighting enebled.

 

Link to comment
Share on other sites

For chandeliers, street lamps and such; the mesh/prim hybrid is usually the way to go. A (not tortured!) prim box or cylinder carries only 0.1 download weight, can be set to physics None and its 0.5 server weight usually means you can add at least one to a mesh without raising the effective LI. If your mesh itself has a LI of 3 or so, you may even be able to add even more. I made a streetlamp whose effective LI was 4, with or without its 3 sphere lights.

 

The advantages are numerous, having your light source originating from exact position(s), your light will now illuminate the mesh itself, using full bright and glow to enhance the illusion of a light source and using the diffuse color of your prim to influence pin point lighting. You can also use nearby texture faces on your mesh to further enhance the illusion with selective use of full bright, making it appear that the prim lighting is stronger than it actually is.

 

The only disadvantage to this approach is you lose the ability to directly scale independently on an axis, the object can only be made bigger or smaller overall.

 [ETA: The following pics show light source prims using full bright, glow and pin point lighting. The point lighting is set to extreme values to show max effect possible, much more subtle effects are possible.

I also realize I had overlooked another advantage to this approach- particles! Each prim within the build can be used as a particle emitter, making for an unlimited number of controlled effects that are simply impossible to achieve with a simple mesh.]

StreetLamp03-11_Off_002_001.pngStreetLamp03-11_On_001.png

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

You don't have to change much.  Name your new light bulb prim and then look for it with llGetLinkName instead of llGetLinkNumber in the script.  That way, if you relink for any reason you won't need to go through the hassle of renumbering everything in the script. 

  • Like 1
Link to comment
Share on other sites

Now you're going the right direction!

 

Notice that library functions such as lSetLinkPrimitiveParamsFast handle actions by using link number, which may change if the object is linked with other prims or there are prims removed from the object. So the idea is to associate a variable(which may have to be a list!) that carries the number(s) of the prim(s) you wish to control AND update it where necessary.

 

In other words, in a mesh/prim hybrid where you are wishing to only make the "light" prims actively GLOW at some level, go FULL_BRIGHT or actually emit light with  PRIM_POINT_LIGHT settings; you need to "find" these prims and make note of their link number(s). The places you need to update that information is within the default state_entry() and changed() event handlers (using  the CHANGED_LINK flag)

 

Doing it this way enables you to precisely place light sources (real or apparent) exactly where you wish!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3869 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...