Light in Brume

All about the core api and animation, input, sound, effect, collision and physics engines.
You can also post here your feature requests.

Moderator: Brume Dev Team

Light in Brume

Postby Mast10 on Fri May 30, 2008 1:18 pm

I have a question about the use of light in the Brume Engine.

How do I use a Light to act like the sun. And when the distance between an object and the sun have it become less bright?

Main point is I guess this: When I use a light object (directionalLight or PointLight) how do I make the light less bright? I tried to set the alpha-setting to about 50, but that doesn't do a thing. Where-ever I place the character the light is always the same brightness. Also if I where to place the light object above the character the bottom gets lighted to :? . Which off course is quite odd. I used the light tutorial you have on the site but results are the same. Could you maybe paste a piece of code which shows how to create a light that is A: Not intirely White (when Diffuse = Color.FromARGB("some aplha value", Color.White);) B: Creating a shadow of the object it is shining upon.

If anything is unclear please say so.

Thanks in advance, Matthijs.
User avatar
Mast10
Brume Rookie
 
Posts: 16
Joined: Thu Apr 24, 2008 1:10 pm

Re: Light in Brume

Postby Silmaryls on Sat May 31, 2008 11:42 pm

Hi Matthijs,

Can you try to set the ambient light to some dark color. I think that it may be the problem.

Code: Select all
this.GlobalAmbientLight = Color.Black;


Doing that will give you more range for other light sources (directional, spot...)

Setting directional light source color must always be done with the RGB components (not alpha). Here is an example :

Code: Select all
// setup light
light = new BrumeDirectionalLight("Directionnal Light", new BrumeVector(0.0f, 0.0f, 1.0f), new BrumeVector(1.0f, 1.0f, 0.0f), Color.Red);
light.Enabled = true;
light.Update();
User avatar
Silmaryls
Brume Team Member
 
Posts: 340
Joined: Tue Feb 21, 2006 10:09 pm
Location: Paris - France


Return to Technical discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron