Jump to content

lights help


aiaf
 Share

Recommended Posts

Hello

 

Have some problems with the lighting i setup below:

 

Light* light = DirectionalLight::Create();

light->SetRotation(45,45,0);

light->SetColor(0.3,0.3,0.4);

 

world->SetAmbientLight(0.5,0.5,0.6);

 

land = Model::Box(15, 0.0, 15);

land->SetPosition(0, -0.55, 0);

land->SetColor(0.15,0.15,0.15);

land->SetPickMode(0);

 

world->SetWaterMode(true);

world->SetWaterColor(0.1, 0.1, 0.15, 1.0);

world->SetWaterHeight(-0.55);

 

The lighting looks really bad on the land box, i put some arrows on the screenshot to pin point the problem. That circular grey shape is the lighting and it doesnt look good even in max resolutions.

 

Any ideea what am i doing wrong ? or how to improve this

 

post-15700-0-80385200-1450301465_thumb.png

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

I try with setting the postion, its the same effect.

cassius you say i should add the lights in a map file and then load it ?

The game graphics are created by code so i didnt use the editor so far.

 

Is there any difference(regarding lighting) if i use an editor map or write the code myself ?

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

What have you set the other properties of the light source as? The editor shows more variables associated with the Directional Light, which might have an impact on your scene. I'm still learning these bits myself but first thoughts would be to look at the values for Diffuse & Specular brightness. it may help :)

Noob... in training...

Link to comment
Share on other sites

I have read this tutorial:

http://www.leadwerks.com/werkspace/page/tutorials/_/materials-r7

 

I have some results, if i generate a material from a texture and put it on the plane it looks great.

 

But for non textured materials no luck i loaded just a color material and the lighting is still bad.

Also tried something like this:

land->SetColor(0.15,0.15,0.15, 1.0, Color::Specular);

land->SetColor(0.15,0.15,0.15, 1.0, Color::Diffuse);

land->SetIntensity(1.5, Color::Diffuse);

 

Seems that im not setting everything that is needed from code.

Im off to analyze the material file to see why the textured material works well with the ligthing.

 

Thanks guys for pointing to the right direction

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

Yeah your right i was under the impression Diffuse and Specular colors on the material affects the lighting.

 

light->SetColor(1.3,1.3,1.3);

world->SetAmbientLight(0.9,0.9,0.9);

 

With above settings lighting looks great, no artefacts on the plane.

 

But im after a darker feel for this game so its not good.

It seems this artifacts appear when there is little light in the scene.

 

With this settings the circles pattern appear pretty clear

light->SetColor(0.2,0.2,0.2)

world->SetAmbientLight(0.9,0.9,0.9)

 

cassius can you reproduce this on your machine ? I mean its just me having this kind of problem

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

I tried to reproduce this effect in the editor and found that I get the rings if the Directional Light's Specular Brightness is more than 0. The effect is more profound at low values but the rings blend into each other when the value is higher.

Hope the screen shots help. smile.png

post-15942-0-16663200-1450450576.jpg

post-15942-0-26394000-1450450585.jpg

Noob... in training...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...