Page 1 of 1

Light

PostPosted: Mon Nov 01, 2010 2:57 am
by Egon
Some time ago I started to rebuilding Maps Gallery in order to start using lighmaps instead of Vertex paining.
When I finnallly had light setup for generating good lightmaps in Blender in one of rooms, I notice that most of blender lamps are not correectly reprezented in Plasma.
For example I had a spot lamp at the top of my room. When I have set it's energy to full 10 (I don't know why Blender does not allow to set up more) it lighted whole room in Blender, but in game my avatar was lighted by this lamp, only when I flyed to it very closely.

So, does anybody can wrtie a tutorial, some basic info, on what lamps are imported into an Age, and reprezetned in Plasma engine, and in such way?
(For example: if You using "Sun" type Lamp, it will iluminate everything in an Age no mater of where objects are).

Re: Light

PostPosted: Mon Nov 01, 2010 8:36 am
by andylegate
To keep lights from shining "in" where you don't want them, you need to use Soft Volumes.

Using Soft Volumes you can keep things like the sun light that lights up your outside from lighting up the inside of your cave/building, etc.

You can also use Soft Volumes to block sounds. IE: you have it raining outside, but you want that sound to stop or become muted inside a building. You can use Soft Volumes for this too.

Here's a link to the wiki where there is an article on how Soft Volumes work. It's not a tutorial, but he does show you how to set up the ALCscripting for it in Blender (in Max with Cyan's Plugin it's different):

http://www.guildofwriters.com/wiki/Soft_Volumes

Re: Light

PostPosted: Tue Nov 02, 2010 12:36 am
by Egon
Yes I saw this article before. It's interesting, but it's dealing whith very narrow problem, and need I something more generic.
Like: "why my spot lights shine on avatar only when he is in the distance of 1-1,5 meter, despite the fact that they are set to full Energy in blender?"

Re: Light

PostPosted: Tue Nov 02, 2010 1:30 am
by tachzusamm
Egon wrote:Like: "why my spot lights shine on avatar only when he is in the distance of 1-1,5 meter, despite the fact that they are set to full Energy in blender?"

Hello Egon.

It's simply because energy isn't distance. ;)
Okay, in a "real" world, we experience that a lamp with more energy tends to influence objects more far away. Brigthen them up, that is.
But - not in Blender, and not in URU. This is true especially for spot type lamps.

So, the energy determines the amount of light your avatar receives, the distance determines - well, the distance of influence.
And with spot type lamps, this distance is sort of abrupt. If you leave the distance, the influence is zero.

There is a separate value for distance in Blender.
It's the "Dist:" field in Blender, directly above the Energy slider.

I mostly manage it this way:
a) Draw a help circle around your lamp (with lamp in center) and scale the circle until it fits/includes the area to be lit.
b) Use the circle's radius to determine the distance to be chosen for the lamp.
(The small Transform Properties menu - invoke it by pressing the N key - gives you the information for the circle diameter. DimX or DimY values.)
c) Remove the help circle (don't export to uru) or set it's page_num to a page that is not used.


Some additional hints about different lamp types:
1. Type "Lamp": Gives a soft fade-out when the avatar moves away from the lamp in URU.
In my opinion this is the most natural looking lamp type.
Radiation distance in URU matches the Dist: value in Blender.

2. Type "Area": If you ask me, avoid this in URU. I never got pleasing results in URU with this type.
But it may be useful to create light maps. Depends on your needs.

3. Type "Spot": Gives an abrupt fade-out when the avatar leaves the distance.
Radiation distance in URU matches the Dist: value in Blender.
Keep in mind there's an additional SpotSi (spot size) value for the lamp, which determines the radiation angle.
This angle does not affect energy or distance.
A nice lamp type if you want to lit the avatar limited to an area (determined by the distance an radiation angle).

About shadows:
Shadows seems to get generated (well, sometimes) a bit more far away than the lamp's distance value for spot lamps.
If you want to match the light and shadows distance, or get more control of them separately, just use TWO lamps.
The first one setup to produce only the light (Ray Shadow button off) and Dist: set to your desired distance.
The second lamp set to Ray Shadow plus "ShadowOnly" - set Dist: value for this type to about half the distance, or a bit less than the desired distance.
You may have to play with the shadow's lamp distance to correct it.
For "Lamp" type lamps, this seems to match better (light distance = shadow distance). Mostly.
Note:
URU already treats lights and shadows separately, so if you use two lamps (one for light + one for shadow) this does not introduce more CPU/GPU load in URU than a single lamp with light+shadow would.

Hints for creating Lightmaps:
I normally insert extra lamps in Blender with the purpose of just creating light maps, separated from my lamps used for URU.
This gives me better control.
The light maps lamps get the logic property (type: "string"), (name: "page_num"), (value: "12345"), so they don't export to URU, but I can keep them in my Blender file to generate / modify my light maps, even later.
For the lamps I want in URU, I switch off the "Restrict / Allow renderability" button in the outliner (it's the rightmost image icon) - this way they are only exported to URU but don't affect my lightmap generation.

Hope this helps. :)

And sorry for my bad english.

tach