Skip to content

Commit

Permalink
Merge pull request #241 from LeeRiva/specific_commit
Browse files Browse the repository at this point in the history
Fixed misspellings, documentation changes
  • Loading branch information
robertosfield authored Aug 11, 2023
2 parents 2f00eca + 3ba5f3e commit 1e0652a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions examples/app/vsgmultiviews/vsgmultiviews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ViewHandler : public vsg::Inherit<vsg::Visitor, ViewHandler>

vsg::ref_ptr<vsg::RenderGraph> renderGraph;

ViewHandler(vsg::ref_ptr<vsg::RenderGraph> in_renderGrah) : renderGraph(in_renderGrah) {}
ViewHandler(vsg::ref_ptr<vsg::RenderGraph> in_renderGraph) : renderGraph(in_renderGraph) {}

void apply(vsg::KeyPressEvent& keyPress) override
{
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions examples/nodes/vsglights/vsglights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ int main(int argc, char** argv)

auto outputFilename = arguments.value<std::string>("", "-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;
Expand All @@ -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<vsg::ComputeBounds>(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";
Expand Down Expand Up @@ -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));

Expand Down
10 changes: 5 additions & 5 deletions examples/state/vsgdynamictexture/vsgdynamictexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
}
Expand Down
6 changes: 3 additions & 3 deletions examples/state/vsgdynamicvertex/vsgdynamicvertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions examples/threading/vsgdynamicload/vsgdynamicload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand All @@ -143,7 +143,7 @@ int main(int argc, char** argv)
int numColumns = static_cast<int>(std::ceil(std::sqrt(static_cast<float>(numModels))));
int numRows = static_cast<int>(std::ceil(static_cast<float>(numModels) / static_cast<float>(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<double>(numColumns - 1) * 0.5) + secondary * (static_cast<double>(numRows - 1) * 0.5);
double viewingDistance = std::sqrt(static_cast<float>(numModels)) * 3.0;
double nearFarRatio = 0.001;
Expand All @@ -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));
Expand All @@ -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<vsg::Viewer> observer_viewer(viewer);
for (int i = 1; i < argc; ++i)
{
Expand Down
5 changes: 2 additions & 3 deletions examples/threading/vsgdynamicviews/vsgdynamicviews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/utils/vsgbuilder/vsgbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int main(int argc, char** argv)

vsg::ref_ptr<vsg::LookAt> 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;
Expand Down

0 comments on commit 1e0652a

Please sign in to comment.