cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Discussions

knightcrawler25
Journeyman III

Trying to get environment lights to work in ProRender SDK

I'm playing around with the ProRender SDK and have gone through the initial set of tutorials from https://radeon-pro.github.io/RadeonProRenderDocs/sdk/tutorials.html

I've got point lights to work but the environment lights do not seem to work. Attached are images with the point light and environment light. Here is how i'm setting the environment lights in code but all I get is a black screen

rpr_light env_light;
{
    CHECK(rprContextCreateEnvironmentLight(context, &env_light));

    rpr_image img;
    const std::string pathImageFile = "studio015.hdr";
    CHECK(rprContextCreateImageFromFile(context, pathImageFile.c_str(), &img));

    // Set an image for the light to take the radiance values from
    CHECK(rprEnvironmentLightSetImage(env_light, img));
    CHECK(rprEnvironmentLightSetIntensityScale(env_light, 10.0f));

    // Set IBL as a background for the scene.
    CHECK(rprSceneAttachLight(scene, env_light));
}

Could someone help show where i'm going wrong or if i'm missing something. Thanks

0 Likes
3 Replies
bsavery
Staff

Thank's for the interest in the SDK.  Are you getting any error output from the check calls?  Also I'll attach the entire tutorial code.

knightcrawler25
Journeyman III

Thanks a lot for the sample code! It works now. Turns out I missed out a call to rprContextSetScene()

0 Likes

Ah yes,  that is an important step 

0 Likes