diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index bc2617ae8..6f6002b8f 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -36,10 +36,15 @@ int main() Shader shdrCubemap = LoadShader("resources/shaders/cubemap.vs", "resources/shaders/cubemap.fs"); SetShaderValuei(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, 1); + // Load HDR panorama (sphere) texture Texture2D texHDR = LoadTexture("resources/dresden_square.hdr"); + + // Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture + // NOTE: New texture is generated rendering to texture, shader computes the sphre->cube coordinates mapping skybox.material.maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, texHDR, 512); - UnloadShader(shdrCubemap); // Cubemap generation shader not required any more + UnloadTexture(texHDR); // Texture not required anymore, cubemap already generated + UnloadShader(shdrCubemap); // Unload cubemap generation shader, not required anymore SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode @@ -76,7 +81,7 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - UnloadModel(skybox); // Unload skybox model + UnloadModel(skybox); // Unload skybox model (and textures) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_skybox.png b/examples/models/models_skybox.png index 31694fa5a..feb0f737c 100644 Binary files a/examples/models/models_skybox.png and b/examples/models/models_skybox.png differ