diff options
| author | David Reid <[email protected]> | 2018-07-05 22:33:16 +1000 |
|---|---|---|
| committer | David Reid <[email protected]> | 2018-07-05 22:33:16 +1000 |
| commit | 1d354bc7045f14ed47c153c031d68641a80fc6fe (patch) | |
| tree | 9affe50bcb06515d6cbd123df37b6a30a4c7518a /examples/models/models_skybox.c | |
| parent | 63cf43b72947e80791c2a74d98a20e4a96c9af9e (diff) | |
| parent | 7c362370488d740ec89cbdd0803b85ee8336711e (diff) | |
| download | raylib-1d354bc7045f14ed47c153c031d68641a80fc6fe.tar.gz raylib-1d354bc7045f14ed47c153c031d68641a80fc6fe.zip | |
Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
Diffstat (limited to 'examples/models/models_skybox.c')
| -rw-r--r-- | examples/models/models_skybox.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 589f139b..6f6002b8 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -36,12 +36,17 @@ int main() Shader shdrCubemap = LoadShader("resources/shaders/cubemap.vs", "resources/shaders/cubemap.fs"); SetShaderValuei(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, 1); - Texture2D texHDR = LoadTexture("resources/pinetree.hdr"); + // 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_ORBITAL); // Set an orbital camera mode + SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -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 //-------------------------------------------------------------------------------------- |
