From 45718d1531533a9b1bf21b599c68d156301046e5 Mon Sep 17 00:00:00 2001 From: LeeRiva <76054616+LeeRiva@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:26:29 +0200 Subject: [PATCH 1/2] Fixed misspellings, reworded some comments --- examples/app/vsgmultiviews/vsgmultiviews.cpp | 4 ++-- examples/nodes/vsglights/vsglights.cpp | 10 +++++----- .../state/vsgdynamictexture/vsgdynamictexture.cpp | 10 +++++----- examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp | 6 +++--- examples/threading/vsgdynamicload/vsgdynamicload.cpp | 12 ++++++------ .../threading/vsgdynamicviews/vsgdynamicviews.cpp | 5 ++--- examples/utils/vsgbuilder/vsgbuilder.cpp | 2 +- 7 files changed, 24 insertions(+), 25 deletions(-) diff --git a/examples/app/vsgmultiviews/vsgmultiviews.cpp b/examples/app/vsgmultiviews/vsgmultiviews.cpp index 5f27fdf9..e67f81bc 100644 --- a/examples/app/vsgmultiviews/vsgmultiviews.cpp +++ b/examples/app/vsgmultiviews/vsgmultiviews.cpp @@ -34,7 +34,7 @@ class ViewHandler : public vsg::Inherit vsg::ref_ptr renderGraph; - ViewHandler(vsg::ref_ptr in_renderGrah) : renderGraph(in_renderGrah) {} + ViewHandler(vsg::ref_ptr in_renderGraph) : renderGraph(in_renderGraph) {} void apply(vsg::KeyPressEvent& keyPress) override { @@ -144,7 +144,7 @@ int main(int argc, char** argv) auto secondary_camera = createCameraForScene(scenegraph2, (width * 3) / 4, 0, width / 4, height / 4); auto secondary_view = vsg::View::create(secondary_camera, scenegraph2); - // add close handler to respond to the close window button and pressing escape + // add close handler to respond to the close window button and to pressing escape viewer->addEventHandler(vsg::CloseHandler::create(viewer)); // add event handlers, in the order we wish events to be handled. diff --git a/examples/nodes/vsglights/vsglights.cpp b/examples/nodes/vsglights/vsglights.cpp index 6697de70..92a38891 100644 --- a/examples/nodes/vsglights/vsglights.cpp +++ b/examples/nodes/vsglights/vsglights.cpp @@ -83,14 +83,14 @@ int main(int argc, char** argv) auto outputFilename = arguments.value("", "-o"); - bool add_amient = true; + bool add_ambient = true; bool add_directional = true; bool add_point = true; bool add_spotlight = true; bool add_headlight = arguments.read("--headlight"); if (add_headlight || arguments.read({"--no-lights", "-n"})) { - add_amient = false; + add_ambient = false; add_directional = false; add_point = false; add_spotlight = false; @@ -117,14 +117,14 @@ int main(int argc, char** argv) // compute the bounds of the scene graph to help position camera auto bounds = vsg::visit(scene).bounds; - if (add_amient || add_directional || add_point || add_spotlight || add_headlight) + if (add_ambient || add_directional || add_point || add_spotlight || add_headlight) { auto span = vsg::length(bounds.max - bounds.min); auto group = vsg::Group::create(); group->addChild(scene); // ambient light - if (add_amient) + if (add_ambient) { auto ambientLight = vsg::AmbientLight::create(); ambientLight->name = "ambient"; @@ -246,7 +246,7 @@ int main(int argc, char** argv) view->camera = camera; view->addChild(scene); - // add close handler to respond the close window button and pressing escape + // add close handler to respond to the close window button and to pressing escape viewer->addEventHandler(vsg::CloseHandler::create(viewer)); viewer->addEventHandler(vsg::Trackball::create(camera)); diff --git a/examples/state/vsgdynamictexture/vsgdynamictexture.cpp b/examples/state/vsgdynamictexture/vsgdynamictexture.cpp index df7853fa..380793f4 100644 --- a/examples/state/vsgdynamictexture/vsgdynamictexture.cpp +++ b/examples/state/vsgdynamictexture/vsgdynamictexture.cpp @@ -149,21 +149,21 @@ int main(int argc, char** argv) textureData->properties.format = VK_FORMAT_R32_SFLOAT; break; case (USE_RGB): - // note, RGB image data has to be converted to RGBA when copying to a vkImage, - // the VSG will do this automatically do the RGB to RGBA conversion for you each time the data is copied + // note, RGB image data has to be converted to RGBA when copying to a vkImage; + // while VSG will do this automatically for you each time the data is copied // this makes RGB substantially slower than using RGBA data. // one approach, illustrated in the vsgdynamictexture_cs example, for avoiding this conversion overhead is to use a compute shader to map the RGB data to RGBA. textureData = vsg::vec3Array2D::create(image_size, image_size); textureData->properties.format = VK_FORMAT_R32G32B32_SFLOAT; break; case (USE_RGBA): - // R, RG and RGBA data can be copied to vkImage without any conversion so is efficient, while RGB requires conversion, see below explanation + // R, RG and RGBA data can be copied to vkImage without any conversion so is efficient, while RGB requires conversion, see above textureData = vsg::vec4Array2D::create(image_size, image_size); textureData->properties.format = VK_FORMAT_R32G32B32A32_SFLOAT; break; } - // set the dynmaic hint to tell the Viewer::compile() to assign this vsg::Data to a vsg::TransferTask + // set the dynamic hint to tell the Viewer::compile() to assign this vsg::Data to a vsg::TransferTask textureData->properties.dataVariance = lateTransfer ? vsg::DYNAMIC_DATA_TRANSFER_AFTER_RECORD : vsg::DYNAMIC_DATA; // initialize the image @@ -177,7 +177,7 @@ int main(int argc, char** argv) if (heightfield) { - // create height field use the texture data as a displacementMap + // create height field and use the texture data as a displacementMap stateInfo.displacementMap = textureData; scenegraph->addChild(builder.createHeightField(geomInfo, stateInfo)); } diff --git a/examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp b/examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp index a565b1ed..9400c5e8 100644 --- a/examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp +++ b/examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp @@ -63,7 +63,7 @@ int main(int argc, char** argv) // set up defaults and read command line arguments to override them vsg::CommandLine arguments(&argc, argv); - // set up vsg::Options to pass in filepaths and ReaderWriter's and other IO related options to use when reading and writing files. + // set up vsg::Options to pass in filepaths, ReaderWriter's and other IO related options to use when reading and writing files. auto options = vsg::Options::create(); options->fileCache = vsg::getEnv("VSG_FILE_CACHE"); options->paths = vsg::getEnvPaths("VSG_FILE_PATH"); @@ -148,7 +148,7 @@ int main(int argc, char** argv) viewer->addWindow(window); - // compute the bounds of the scene graph to help position camera + // compute the bounds of the scene graph to help position the camera vsg::ComputeBounds computeBounds; vsg_scene->accept(computeBounds); vsg::dvec3 centre = (computeBounds.bounds.min + computeBounds.bounds.max) * 0.5; @@ -171,7 +171,7 @@ int main(int argc, char** argv) auto camera = vsg::Camera::create(perspective, lookAt, vsg::ViewportState::create(window->extent2D())); - // assign a CloseHandler to the Viewer to respond to pressing Escape or press the window close button + // assign a CloseHandler to the Viewer to respond to pressing Escape or a press of the window close button viewer->addEventHandler(vsg::CloseHandler::create(viewer)); // add trackball to control the Camera diff --git a/examples/threading/vsgdynamicload/vsgdynamicload.cpp b/examples/threading/vsgdynamicload/vsgdynamicload.cpp index 349c1471..3ee0cb07 100644 --- a/examples/threading/vsgdynamicload/vsgdynamicload.cpp +++ b/examples/threading/vsgdynamicload/vsgdynamicload.cpp @@ -114,7 +114,7 @@ int main(int argc, char** argv) if (argc <= 1) { - std::cout << "Please specify a 3d models on the command line." << std::endl; + std::cout << "Please specify at least one 3d model on the command line." << std::endl; return 1; } @@ -134,7 +134,7 @@ int main(int argc, char** argv) viewer->addWindow(window); - // set up the grid dimensions to place the loaded models on. + // set up the grid dimensions to place the loaded model(s) on. vsg::dvec3 origin(0.0, 0.0, 0.0); vsg::dvec3 primary(2.0, 0.0, 0.0); vsg::dvec3 secondary(0.0, 2.0, 0.0); @@ -143,7 +143,7 @@ int main(int argc, char** argv) int numColumns = static_cast(std::ceil(std::sqrt(static_cast(numModels)))); int numRows = static_cast(std::ceil(static_cast(numModels) / static_cast(numColumns))); - // compute the bounds of the scene graph to help position camera + // compute the bounds of the scene graph to help position the camera vsg::dvec3 centre = origin + primary * (static_cast(numColumns - 1) * 0.5) + secondary * (static_cast(numRows - 1) * 0.5); double viewingDistance = std::sqrt(static_cast(numModels)) * 3.0; double nearFarRatio = 0.001; @@ -154,7 +154,7 @@ int main(int argc, char** argv) auto viewportState = vsg::ViewportState::create(window->extent2D()); auto camera = vsg::Camera::create(perspective, lookAt, viewportState); - // add close handler to respond the close window button and pressing escape + // add close handler to respond to the close window button and to pressing escape viewer->addEventHandler(vsg::CloseHandler::create(viewer)); viewer->addEventHandler(vsg::Trackball::create(camera)); @@ -170,12 +170,12 @@ int main(int argc, char** argv) resourceHints->descriptorPoolSizes.push_back(VkDescriptorPoolSize{VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 256}); } - // configure the viewers rendering backend, initialize and compile Vulkan objects, passing in ResourceHints to guide the resources allocated. + // configure the viewer's rendering backend, initialize and compile Vulkan objects, passing in ResourceHints to guide the resources allocated. viewer->compile(resourceHints); auto loadThreads = vsg::OperationThreads::create(numThreads, viewer->status); - // assign the LoadOperation that will do the load in the background and once loaded and compiled merged then via Merge operation that is assigned to updateOperations and called from viewer.update() + // assign the LoadOperation that will do the load in the background and once loaded and compiled merge them via Merge operation that is assigned to updateOperations and called from viewer.update() vsg::observer_ptr observer_viewer(viewer); for (int i = 1; i < argc; ++i) { diff --git a/examples/threading/vsgdynamicviews/vsgdynamicviews.cpp b/examples/threading/vsgdynamicviews/vsgdynamicviews.cpp index 140e829a..d1042e3d 100644 --- a/examples/threading/vsgdynamicviews/vsgdynamicviews.cpp +++ b/examples/threading/vsgdynamicviews/vsgdynamicviews.cpp @@ -180,8 +180,7 @@ int main(int argc, char** argv) vsg::dvec3 primary(2.0, 0.0, 0.0); vsg::dvec3 secondary(0.0, 2.0, 0.0); - // compute the bounds of the scene graph to help position camera - // compute the bounds of the scene graph to help position camera + // compute the bounds of the scene graph to help position the camera vsg::ComputeBounds computeBounds; vsg_scene->accept(computeBounds); vsg::dvec3 centre = (computeBounds.bounds.min + computeBounds.bounds.max) * 0.5; @@ -223,7 +222,7 @@ int main(int argc, char** argv) resourceHints->descriptorPoolSizes.push_back(VkDescriptorPoolSize{VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 256}); } - // configure the viewers rendering backend, initialize and compile Vulkan objects, passing in ResourceHints to guide the resources allocated. + // configure the viewer's rendering backend, initialize and compile Vulkan objects, passing in ResourceHints to guide the resources allocated. viewer->compile(resourceHints); // create threads to load models and views in background diff --git a/examples/utils/vsgbuilder/vsgbuilder.cpp b/examples/utils/vsgbuilder/vsgbuilder.cpp index df5a14e9..4b68606b 100644 --- a/examples/utils/vsgbuilder/vsgbuilder.cpp +++ b/examples/utils/vsgbuilder/vsgbuilder.cpp @@ -277,7 +277,7 @@ int main(int argc, char** argv) vsg::ref_ptr lookAt; - // compute the bounds of the scene graph to help position camera + // compute the bounds of the scene graph to help position the camera //vsg::ComputeBounds computeBounds; //scene->accept(computeBounds); //vsg::dvec3 centre = (computeBounds.bounds.min + computeBounds.bounds.max) * 0.5; From 3ba5f3ef66141c034afde852e6f5b57545ed5528 Mon Sep 17 00:00:00 2001 From: LeeRiva <76054616+LeeRiva@users.noreply.github.com> Date: Fri, 11 Aug 2023 08:38:34 +0200 Subject: [PATCH 2/2] Removed link to 'traversals' example folder since that seems to have been removed in 2a13cc6cd0397bb9c05d2801d234b11f3ecbf4a5 --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f35ef24d..61c8625d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ Example programs that test and illustrate how to use the [VulkanSceneGraph](http * [commands](examples/commands/) examples * [io](examples/io/) examples * [ui](examples/ui/) examples -* [traversals](examples/traversals/) examples * [platform](examples/platform/) examples * [utils](examples/utils/) examples