Birdman Posted May 31, 2011 Share Posted May 31, 2011 I have a sbx which haves a skybox that works on the editor, on my c++ code the sky is totally black. I checked the log and the enviroment object is loading OK. Also i tried this: //Set SkyBox SetSkybox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")); It results on the Shader of objects reflecting the Sky, but the sky i still black. Im using: TFramework fw=CreateFramework(); TEntity scene=LoadScene(".."); Loop RenderFramework(); UpdateFramework(); Etc.. Maybe im missing something to initalize the enviroment on the Framework. Any idea? Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 1, 2011 Share Posted June 1, 2011 For the C++ code when using the SetSkyBox() command, you have to set the background color: http://www.leadwerks.com/wiki/index.php?title=Framework#SetBackgroundColor. The default is Vec4(0,0,0,0). Set it to Vec4(1,1,1,1). The atmosphere script also does this. For the C++ code when using the atmosphere object script, you need to make sure you are passing the framework to the lua state since the script is using the 'fw' framework variable: TFramework framework=CreateFramework(); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Birdman Posted June 1, 2011 Author Share Posted June 1, 2011 For the C++ code when using the atmosphere object script, you need to make sure you are passing the framework to the lua state since the script is using the 'fw' framework variable: The scripts are loading OK, even the Atmosphere object of the Scene is loading, i can check that in the log, i already have that lines of code to setup script, most scripts do their work, except for the skybox. I will check setting the background but im a bit lost on what im missing to be honest. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 1, 2011 Share Posted June 1, 2011 I had to use the background command when I loaded it manually in my code or I too got a black sky, but as Mack suggests, if you have the atmosphere object in your level then the Lua script should take care of that. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Birdman Posted June 1, 2011 Author Share Posted June 1, 2011 I had the 4 LUA lines commented, now i got it workiong, since most scripts were working i didn't cared to check that until now. Thanks for your response guys. Edit:This lines were giving me problems with physics in general, vehicle related mostly, there was a script that was messing up my c++ code, thats why i had this lines commented, now i at least found the real problem, and got all working. 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.