VeTaL Posted October 22, 2010 Share Posted October 22, 2010 Got a new strange problem: ambient light dont work in game (in editor it works good in both edit and game modes). All other types of lightning works quite fine, except ambient. I made level from Underground models just to test animation hands in GUI, and stuck with this problem. Also, i made search through all files in project (with Ctrl+Shift+F), where i mention "Ambient" and i find, that i didnt use it nowhere. Then i searched for text "Ambient" with Total commander searching tool and again found nothing strange. Finally, i added AmbientLight(Vec3(1)); into the main loop and again there isnt ambient lightning on the scene at all (not only on mine, also on tunnels.sbx) What can cause this? I think i have missed something small, but i spend a all evening trying to fix this before writing here. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
AggrorJorn Posted October 23, 2010 Share Posted October 23, 2010 Things to try: Is the ambient light in your project folder? Are there multiple ambient lights? (perhaps causing interference) Delete the ambient light in your editor and project folder and update your SDK. Remove the ambient light from your scene and drag a new one in. Resave the scene as a different level and try to load that level. good luck! Quote Link to comment Share on other sites More sharing options...
VeTaL Posted October 23, 2010 Author Share Posted October 23, 2010 1. Of course, its all right in log file. 2. Nope, just one 3. Updating now. 4. Tried that, no results. Also, i noted that i cant see any ambient light in any level in game, in editor its allright. I'll try updated version now Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Canardia Posted October 23, 2010 Share Posted October 23, 2010 You have the wrong Entities folder in your project. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VeTaL Posted October 23, 2010 Author Share Posted October 23, 2010 Just deleted my Entities project folder and paste Entities from fresh 2.4 folder, add ambient light, set it to 0.3 + added player_info marker, because player placed here, and got still the same result: there is ambient light in Editor, but no in game. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 23, 2010 Author Share Posted October 23, 2010 I tried it on different maps: direct, spot and point lights work good in game, but not ambient. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 24, 2010 Author Share Posted October 24, 2010 Looking like this trouble is only in my current project: i added another simple project, load the same settings and the same map there and i see ambient light.... But i cant find any line of code, connected to ambients. Strange indeed. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Canardia Posted October 24, 2010 Share Posted October 24, 2010 You could temporarily rename the AmbientLight function in engine.cpp to make it cause compiler errors in places where you used the function. Then you could find where you have used it. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VeTaL Posted October 24, 2010 Author Share Posted October 24, 2010 I do that last night: no errors while recompile. I also shut down HDR and all posteffects - result is the same. Got an idea that this can be caused by CEGUI, because in other project, that used the same assets ambient is okay. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 24, 2010 Author Share Posted October 24, 2010 Its not CEGUI. Just from desperate, change RenderFramework(); to SetBuffer(_buffer); RenderWorld(); //Render lighting SetBuffer(BackBuffer()); RenderLights(_buffer); got a strange picture, but now i can see ambient. I'll test simple level with framework and ambient, maybe problem is there. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 24, 2010 Author Share Posted October 24, 2010 In simple demo with framework its okay with ambient... looking like i need to refactoring my project class by class and see, what happened. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 26, 2010 Author Share Posted October 26, 2010 Looking like its really Framework bug. Can somebody else try this? Initialize() ; RegisterAbstractPath("../Assets/"); SetAppTitle( "Racing" ) ; Graphics( 800, 600 ) ; AFilter() ; TFilter() ; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); camera=GetLayerCamera(layer); TEntity _scene = LoadScene("abstract::underground.sbx"); //PositionEntity(camera,Vec3(0,0,-2)); TEntity playerStart = FindChild(_scene,"playerstart_1"); PositionEntity(camera, EntityPosition(playerStart) + Vec3(0.0, 1.0, 0.0)); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } } Its just standard template, underground.sbx is level with some tunnels, one point light and one ambient light. When i tried with RenderWorld and so on - i saw ambient light and point light, but now i can see only point light. Also, even when i add AmbientLight(Vec3(1)); before main loop, i also cannot see ambient. So, looking like framework dont render world for ambients. (maybe this is not planned?) Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 26, 2010 Author Share Posted October 26, 2010 Also, i tested http://leadwerks.com/werkspace/index.php?/topic/381-scene-loading-example/page__p__5623#entry5623 but the result is the same: no ambient light, only spot. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
AggrorJorn Posted October 26, 2010 Share Posted October 26, 2010 does the scene contain a directional light? Perhaps they both need to be used in order to have proper ambient lights. Quote Link to comment Share on other sites More sharing options...
VeTaL Posted October 26, 2010 Author Share Posted October 26, 2010 I need directional light to use ambient light? Strange indeed, because if i would have indoor level (like inside tunnels), i dont need directional light. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 26, 2010 Author Share Posted October 26, 2010 Anyway, when i use RenderWorld - UpdateWorld, i see ambient without direct light: my scene have only one source of ambient light and one source of point light. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 26, 2010 Author Share Posted October 26, 2010 Okay, i just added directional light, set it to 0 and now i can see ambient... It works, but i spend too many time to understand that ambient light need directional light. PS: Aggror, thank you for idea about directional light. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
cassius Posted October 26, 2010 Share Posted October 26, 2010 There was an ambient light bug but it was fixed some weeks ago.Maybe a clean install is needed. 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...
AggrorJorn Posted October 26, 2010 Share Posted October 26, 2010 Well I didn't know it for sure either, but I remembered a topic were there was a problem with ambient lighting and a directional light bug. Anyway, glad the issue is solved now. Quote 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.