Jump to content
Sign in to follow this  
dmarkwick

Lights, illumination, brightness...

Recommended Posts

I'd like some of my particle effects lit up, what's the best way to do this? I don't know anything about light objects, illuminated textures (if such a thing is even possible) and of course searching hasn't brought anything up.

I see that default fire & explosion effects have dynamic lighting effects. Can anyone (wait for it......) shed any light on this for me?

smile_o.gif

Share this post


Link to post
Share on other sites

Here's an example for you wink_o.gif.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_fireLight = "#lightpoint" createVehicleLocal _buildingPosition;

_fireLight setLightColor [0.1,0.05,0.01];

_fireLight setLightBrightness 0.02 * _size - _timeElapsed/500 + random 0.02 - 0.01;

_fireLight setLightAmbient [0.3,0.2,0.1];

_fireLight LightAttachObject [_building,[0,0,0]];

I used this in a loop to create a nifty flickering effect:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_fireLight setLightBrightness 0.02 * _size - _timeElapsed/500 + random 0.02 - 0.01;

Basically, it's just like creating a particlesource, except much simpler.

For your convenience, references for the commands used.

http://community.bistudio.com/wiki/createVehicleLocal

http://community.bistudio.com/wiki/setLightAmbient

http://community.bistudio.com/wiki/setLightBrightness

http://community.bistudio.com/wiki/setLightColor

http://community.bistudio.com/wiki/lightAttachObject

Share this post


Link to post
Share on other sites

What would be the practical difference between setLightColor and setLightAmbience?

Share this post


Link to post
Share on other sites

If I recall correctly, and I may not, ambient is the color of the light at the center of the light source and color is the color of the light at the edge of the light source. To find out for sure, set one to red and the other to green and see what happens wink_o.gif. Since it's not very clear, you may want to let us know the result for sure.

Share this post


Link to post
Share on other sites

After doing what you suggested CSL I found that setLightAmbient does the thing you expect a light colour command to do - the terrain and surrounding objects are bathed in this colour.

As for setLightColor, it controls the "haze" seen around the lightsource, the flare, the ice-ring type optical effect.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×