mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-17 03:45:35 +00:00
Update models_skybox_rendering.c
This commit is contained in:
@@ -54,7 +54,8 @@ int main(void)
|
|||||||
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||||
Model skybox = LoadModelFromMesh(cube);
|
Model skybox = LoadModelFromMesh(cube);
|
||||||
|
|
||||||
// Set this to true to use an HDR Texture, Note that raylib must be built with HDR Support for this to work SUPPORT_FILEFORMAT_HDR
|
// Set this to true to use an HDR Texture
|
||||||
|
// NOTE: raylib must be built with HDR Support for this to work: SUPPORT_FILEFORMAT_HDR
|
||||||
bool useHDR = false;
|
bool useHDR = false;
|
||||||
|
|
||||||
// Load skybox shader and set required locations
|
// Load skybox shader and set required locations
|
||||||
@@ -91,9 +92,11 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Image img = LoadImage("resources/skybox.png");
|
// TODO: WARNING: On PLATFORM_WEB it requires a big amount of memory to process input image
|
||||||
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT); // CUBEMAP_LAYOUT_PANORAMA
|
// and generate the required cubemap image to be passed to rlLoadTextureCubemap()
|
||||||
UnloadImage(img);
|
Image image = LoadImage("resources/skybox.png");
|
||||||
|
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(image, CUBEMAP_LAYOUT_AUTO_DETECT);
|
||||||
|
UnloadImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisableCursor(); // Limit cursor to relative movement inside the window
|
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||||
@@ -132,9 +135,9 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Image img = LoadImage(droppedFiles.paths[0]);
|
Image image = LoadImage(droppedFiles.paths[0]);
|
||||||
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT);
|
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(image, CUBEMAP_LAYOUT_AUTO_DETECT);
|
||||||
UnloadImage(img);
|
UnloadImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextCopy(skyboxFileName, droppedFiles.paths[0]);
|
TextCopy(skyboxFileName, droppedFiles.paths[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user