From 59d1fdf12eca3731a7bd628da78c229988aa8071 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 29 Apr 2024 16:28:50 +0100 Subject: [PATCH] Moved vsglights and vsgshadow into examples/lighting. Fixed error and warning. --- CMakeLists.txt | 25 ++++++++++--------- examples/lighting/CMakeLists.txt | 2 ++ .../vsglights/CMakeLists.txt | 0 .../vsglights/vsglights.cpp | 0 .../vsgshadow/CMakeLists.txt | 0 .../vsgshadow/vsgshadow.cpp | 0 examples/nodes/CMakeLists.txt | 2 -- .../vsgtextureprojection.cpp | 2 +- examples/volume/vsgvolume/vsgvolume.cpp | 2 +- 9 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 examples/lighting/CMakeLists.txt rename examples/{nodes => lighting}/vsglights/CMakeLists.txt (100%) rename examples/{nodes => lighting}/vsglights/vsglights.cpp (100%) rename examples/{nodes => lighting}/vsgshadow/CMakeLists.txt (100%) rename examples/{nodes => lighting}/vsgshadow/vsgshadow.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebf3c2a3..df6139dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,23 +68,24 @@ endif() # install data install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/ DESTINATION share/vsgExamples) -# pure VSG examples +# VSG examples +add_subdirectory(examples/animation) +add_subdirectory(examples/app) +add_subdirectory(examples/commands) add_subdirectory(examples/core) -add_subdirectory(examples/maths) add_subdirectory(examples/io) -add_subdirectory(examples/ui) -add_subdirectory(examples/state) -add_subdirectory(examples/commands) -add_subdirectory(examples/nodes) -add_subdirectory(examples/threading) -add_subdirectory(examples/app) -add_subdirectory(examples/vk) -add_subdirectory(examples/text) +add_subdirectory(examples/lighting) +add_subdirectory(examples/maths) add_subdirectory(examples/meshshaders) -add_subdirectory(examples/raytracing) +add_subdirectory(examples/nodes) add_subdirectory(examples/platform) +add_subdirectory(examples/raytracing) +add_subdirectory(examples/state) +add_subdirectory(examples/text) +add_subdirectory(examples/threading) +add_subdirectory(examples/ui) add_subdirectory(examples/utils) +add_subdirectory(examples/vk) add_subdirectory(examples/volume) -add_subdirectory(examples/animation) vsg_add_feature_summary() diff --git a/examples/lighting/CMakeLists.txt b/examples/lighting/CMakeLists.txt new file mode 100644 index 00000000..6f56331c --- /dev/null +++ b/examples/lighting/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(vsglights) +add_subdirectory(vsgshadow) diff --git a/examples/nodes/vsglights/CMakeLists.txt b/examples/lighting/vsglights/CMakeLists.txt similarity index 100% rename from examples/nodes/vsglights/CMakeLists.txt rename to examples/lighting/vsglights/CMakeLists.txt diff --git a/examples/nodes/vsglights/vsglights.cpp b/examples/lighting/vsglights/vsglights.cpp similarity index 100% rename from examples/nodes/vsglights/vsglights.cpp rename to examples/lighting/vsglights/vsglights.cpp diff --git a/examples/nodes/vsgshadow/CMakeLists.txt b/examples/lighting/vsgshadow/CMakeLists.txt similarity index 100% rename from examples/nodes/vsgshadow/CMakeLists.txt rename to examples/lighting/vsgshadow/CMakeLists.txt diff --git a/examples/nodes/vsgshadow/vsgshadow.cpp b/examples/lighting/vsgshadow/vsgshadow.cpp similarity index 100% rename from examples/nodes/vsgshadow/vsgshadow.cpp rename to examples/lighting/vsgshadow/vsgshadow.cpp diff --git a/examples/nodes/CMakeLists.txt b/examples/nodes/CMakeLists.txt index 4e671909..f993d3ab 100644 --- a/examples/nodes/CMakeLists.txt +++ b/examples/nodes/CMakeLists.txt @@ -1,8 +1,6 @@ add_subdirectory(vsgannotation) add_subdirectory(vsggroups) -add_subdirectory(vsglights) add_subdirectory(vsgtransform) -add_subdirectory(vsgshadow) add_subdirectory(vsgtextureprojection) add_subdirectory(vsglayers) diff --git a/examples/nodes/vsgtextureprojection/vsgtextureprojection.cpp b/examples/nodes/vsgtextureprojection/vsgtextureprojection.cpp index 148beb29..3b47c10d 100644 --- a/examples/nodes/vsgtextureprojection/vsgtextureprojection.cpp +++ b/examples/nodes/vsgtextureprojection/vsgtextureprojection.cpp @@ -68,7 +68,7 @@ vsg::ref_ptr createLargeTestScene(vsg::ref_ptr options, if (requiresBase) { float diameter = static_cast(vsg::length(bounds.max - bounds.min)); - geomInfo.position.set(static_cast((bounds.min.x + bounds.max.x)*0.5, static_cast((bounds.min.y + bounds.max.y)*0.5), static_cast(bounds.min.z); + geomInfo.position.set(static_cast((bounds.min.x + bounds.max.x)*0.5), static_cast((bounds.min.y + bounds.max.y)*0.5), static_cast(bounds.min.z)); geomInfo.dx.set(diameter, 0.0f, 0.0f); geomInfo.dy.set(0.0f, diameter, 0.0f); geomInfo.dz.set(0.0f, 0.0f, 1.0f); diff --git a/examples/volume/vsgvolume/vsgvolume.cpp b/examples/volume/vsgvolume/vsgvolume.cpp index 7c68d77e..f622c688 100644 --- a/examples/volume/vsgvolume/vsgvolume.cpp +++ b/examples/volume/vsgvolume/vsgvolume.cpp @@ -134,7 +134,7 @@ void updateBaseTexture3D(vsg::floatArray3D& image, float value) float angle = atan2(delta.x, delta.y); float distance_from_center = sqrt(d_ratio * d_ratio + r_ratio * r_ratio); - float intensity = (sin(1.0 * angle + 30.0f * distance_from_center + 10.0 * value) + 1.0f) * 0.5f; + float intensity = (sin(1.0f * angle + 30.0f * distance_from_center + 10.0f * value) + 1.0f) * 0.5f; image.set(c, r, d, 1.0f - intensity); } }