Skip to content

Commit

Permalink
Moved vsglights and vsgshadow into examples/lighting. Fixed error and
Browse files Browse the repository at this point in the history
warning.
  • Loading branch information
robertosfield committed Apr 29, 2024
1 parent cb57ef7 commit 59d1fdf
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 2 additions & 0 deletions examples/lighting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(vsglights)
add_subdirectory(vsgshadow)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/nodes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ vsg::ref_ptr<vsg::Node> createLargeTestScene(vsg::ref_ptr<vsg::Options> options,
if (requiresBase)
{
float diameter = static_cast<float>(vsg::length(bounds.max - bounds.min));
geomInfo.position.set(static_cast<float>((bounds.min.x + bounds.max.x)*0.5, static_cast<float>((bounds.min.y + bounds.max.y)*0.5), static_cast<float>(bounds.min.z);
geomInfo.position.set(static_cast<float>((bounds.min.x + bounds.max.x)*0.5), static_cast<float>((bounds.min.y + bounds.max.y)*0.5), static_cast<float>(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);
Expand Down
2 changes: 1 addition & 1 deletion examples/volume/vsgvolume/vsgvolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 59d1fdf

Please sign in to comment.