TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ LoadHDRI()

void SkyManager::LoadHDRI ( std::string  path)
private

Definition at line 37 of file SkySettings.cpp.

38{
39 // load hdr or ldr image
40 int cubemapResolution = 1024;
41 bool linearFilter = true;
42 HdriToCubemap<unsigned char> hdriToCube_ldr(path, cubemapResolution, linearFilter);
43 cubemap->facesData[TEXTURE_CUBEMAP_PX] = hdriToCube_ldr.getLeft();
44 cubemap->facesSizes[TEXTURE_CUBEMAP_PX] = IVec2(hdriToCube_ldr.getCubemapResolution());
45 cubemap->facesData[TEXTURE_CUBEMAP_NX] = hdriToCube_ldr.getRight();
46 cubemap->facesSizes[TEXTURE_CUBEMAP_NX] = IVec2(hdriToCube_ldr.getCubemapResolution());
47 cubemap->facesData[TEXTURE_CUBEMAP_PY] = hdriToCube_ldr.getDown();
48 cubemap->facesSizes[TEXTURE_CUBEMAP_PY] = IVec2(hdriToCube_ldr.getCubemapResolution());
49 cubemap->facesData[TEXTURE_CUBEMAP_NY] = hdriToCube_ldr.getUp();
50 cubemap->facesSizes[TEXTURE_CUBEMAP_NY] = IVec2(hdriToCube_ldr.getCubemapResolution());
51 cubemap->facesData[TEXTURE_CUBEMAP_PZ] = hdriToCube_ldr.getBack();
52 cubemap->facesSizes[TEXTURE_CUBEMAP_PZ] = IVec2(hdriToCube_ldr.getCubemapResolution());
53 cubemap->facesData[TEXTURE_CUBEMAP_NZ] = hdriToCube_ldr.getFront();
54 cubemap->facesSizes[TEXTURE_CUBEMAP_NZ] = IVec2(hdriToCube_ldr.getCubemapResolution());
55 cubemap->UploadDataToGPU();
56}
Definition: BaseMath.h:4