diff options
author | Aki <please@ignore.pl> | 2023-01-31 01:01:32 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-01-31 01:01:32 +0100 |
commit | 8f718662fcecd4fcf46057f01696ffa1373d4ac3 (patch) | |
tree | 83b27b3f763791744d6d9d4cc841740f58ab2cb3 | |
parent | dd997209468bde60f57089960f46067a375890ca (diff) | |
download | kurator-8f718662fcecd4fcf46057f01696ffa1373d4ac3.zip kurator-8f718662fcecd4fcf46057f01696ffa1373d4ac3.tar.gz kurator-8f718662fcecd4fcf46057f01696ffa1373d4ac3.tar.bz2 |
Removed prototype Skybox
-rw-r--r-- | kurator/CMakeLists.txt | 7 | ||||
-rw-r--r-- | kurator/resources/shaders/330/skybox.fs | 14 | ||||
-rw-r--r-- | kurator/resources/shaders/330/skybox.vs | 17 | ||||
-rw-r--r-- | kurator/resources/skybox.png | bin | 3141841 -> 0 bytes | |||
-rw-r--r-- | kurator/src/Skybox.cpp | 49 | ||||
-rw-r--r-- | kurator/src/Skybox.h | 23 |
6 files changed, 0 insertions, 110 deletions
diff --git a/kurator/CMakeLists.txt b/kurator/CMakeLists.txt index 5b49bfb..c547acd 100644 --- a/kurator/CMakeLists.txt +++ b/kurator/CMakeLists.txt @@ -13,7 +13,6 @@ add_executable( src/SceneBuilder.cpp src/SceneFrame.cpp src/Session.cpp - src/Skybox.cpp src/Summary.cpp src/Title.cpp src/Window.cpp @@ -33,9 +32,3 @@ target_sources( ${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/version.cpp" ) -add_resources( - kurator_resources FILES - resources/skybox.png - resources/shaders/330/skybox.fs - resources/shaders/330/skybox.vs -) diff --git a/kurator/resources/shaders/330/skybox.fs b/kurator/resources/shaders/330/skybox.fs deleted file mode 100644 index ccc97d4..0000000 --- a/kurator/resources/shaders/330/skybox.fs +++ /dev/null @@ -1,14 +0,0 @@ -#version 330 - -in vec3 fragPosition; - -uniform samplerCube environmentMap; - -out vec4 finalColor; - - -void main() -{ - vec3 color = texture(environmentMap, fragPosition).rgb; - finalColor = vec4(color, 1.0); -} diff --git a/kurator/resources/shaders/330/skybox.vs b/kurator/resources/shaders/330/skybox.vs deleted file mode 100644 index cfb2599..0000000 --- a/kurator/resources/shaders/330/skybox.vs +++ /dev/null @@ -1,17 +0,0 @@ -#version 330 - -in vec3 vertexPosition; - -uniform mat4 matProjection; -uniform mat4 matView; - -out vec3 fragPosition; - - -void main() -{ - fragPosition = vertexPosition; - mat4 rotView = mat4(mat3(matView)); - vec4 clipPos = matProjection * rotView * vec4(vertexPosition, 1.0); - gl_Position = clipPos; -} diff --git a/kurator/resources/skybox.png b/kurator/resources/skybox.png Binary files differdeleted file mode 100644 index a351869..0000000 --- a/kurator/resources/skybox.png +++ /dev/null diff --git a/kurator/src/Skybox.cpp b/kurator/src/Skybox.cpp deleted file mode 100644 index 036f2a7..0000000 --- a/kurator/src/Skybox.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "Skybox.h" - -#include <string> - -#include <raylib.h> -#include <rlgl.h> - - -namespace kurator -{ - - -Skybox::Skybox(const std::string& texture) -{ - Mesh cube = GenMeshCube(1.f, 1.f, 1.f); - model = LoadModelFromMesh(cube); - model.materials[0].shader = LoadShader("resources/shaders/330/skybox.vs", "resources/shaders/330/skybox.fs"); - int value {MATERIAL_MAP_CUBEMAP}; - SetShaderValue( - model.materials[0].shader, - GetShaderLocation(model.materials[0].shader, "environmentMap"), - &value, - SHADER_UNIFORM_INT); - Image image = LoadImage(texture.c_str()); - model.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(image, CUBEMAP_LAYOUT_AUTO_DETECT); - UnloadImage(image); -} - - -Skybox::~Skybox() -{ - UnloadShader(model.materials[0].shader); - UnloadTexture(model.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture); - UnloadModel(model); -} - - -void -Skybox::draw() const -{ - rlDisableBackfaceCulling(); - rlDisableDepthMask(); - DrawModel(model, {0.f, 0.f, 0.f}, 1.0f, WHITE); - rlEnableBackfaceCulling(); - rlEnableDepthMask(); -} - - -} // namespace kurator diff --git a/kurator/src/Skybox.h b/kurator/src/Skybox.h deleted file mode 100644 index 3f71837..0000000 --- a/kurator/src/Skybox.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include <string> - -#include <raylib.h> - - -namespace kurator -{ - - -class Skybox -{ -public: - explicit Skybox(const std::string& texture); - ~Skybox(); - void draw() const; -private: - Model model; -}; - - -} // namespace kurator |