aiaf Posted December 16, 2015 Share Posted December 16, 2015 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 Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
cassius Posted December 16, 2015 Share Posted December 16, 2015 have you set position of liht? Why not do it all in he editor exept ambient ligh? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
aiaf Posted December 17, 2015 Author Share Posted December 17, 2015 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 ? Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
AeonYue Posted December 17, 2015 Share Posted December 17, 2015 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 Quote Noob... in training... Link to comment Share on other sites More sharing options...
cassius Posted December 17, 2015 Share Posted December 17, 2015 Yes. You can manipulate (rotate) the light in the editor to get the best effect. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
aiaf Posted December 17, 2015 Author Share Posted December 17, 2015 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 Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
cassius Posted December 17, 2015 Share Posted December 17, 2015 I don't see what that tutorial has to do with lighting.Try increasing the ambient light. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
aiaf Posted December 18, 2015 Author Share Posted December 18, 2015 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 Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
aiaf Posted December 18, 2015 Author Share Posted December 18, 2015 Heres a better screenshot showing the light circles at the left of the cube. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
AeonYue Posted December 18, 2015 Share Posted December 18, 2015 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. Quote Noob... in training... Link to comment Share on other sites More sharing options...
aiaf Posted December 18, 2015 Author Share Posted December 18, 2015 I increased the light colors to around 3.0 and set the material color for the ground very small. (like 0.004). It looks good and pretty close to what i was aiming. Thanks for help guys Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
Recommended Posts
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.