Roland Posted February 23, 2017 Share Posted February 23, 2017 Hi What's needed to get the Fog shader included in Shadmar's PP-shader pack working in C++. I thought this was the only thing to do but the result is no fog at all. Adding the fog to the editor works and gives a nice fog, but only in the editor auto cam = reinterpret_cast<Camera*>(lb.getEntity("cam")); // this is my camera cam->AddPostEffect("Shaders/PostEffects/02_pp_fog_by_klepto.lua"); cam->SetKeyValue("fog_fogrange", "0,20"); cam->SetKeyValue("fog_fogcolor", "0.57,0.53,0.55,1.0"); cam->SetKeyValue("fog_fogangle", "5,21"); cam->SetKeyValue("fog_fogislocal", "0"); In editor In C++ program Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 23, 2017 Share Posted February 23, 2017 For me it works with the lines you posted (though I used a custom created camera). Are you sure, that is actually your camera? Does AddPostEffect return anything for you (on error you should get -1, otherwise an index). Quote Link to comment Share on other sites More sharing options...
Roland Posted February 23, 2017 Author Share Posted February 23, 2017 The camera is a camera created in the editor and I'm 100% sure that the loaded entity is that camera as I use it my FPS player code later on Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Roland Posted February 24, 2017 Author Share Posted February 24, 2017 Solved now. I created the camera in C++ instead of loading a camera created in the editor and then it works. auto cam = Camera::Create(); cam->AddPostEffect("Shaders/PostEffects/02_pp_fog_by_klepto.lua"); cam->SetKeyValue("fog_fogrange", "0,20"); cam->SetKeyValue("fog_fogcolor", "0.57,0.53,0.55,1.0"); cam->SetKeyValue("fog_fogangle", "5,21"); cam->SetKeyValue("fog_fogislocal", "0"); 3 Quote Roland Strålberg Website: https://rstralberg.com 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.