Jump to content

Recommended Posts

Posted

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

post-395-0-52870500-1487845961.png

 

In C++ program

post-395-0-75874300-1487845970.png

Roland Strålberg
Website: https://rstralberg.com

Posted

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).

Posted

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");

  • Upvote 3

Roland Strålberg
Website: https://rstralberg.com

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.

×
×
  • Create New...