chrono::vsg3d Namespace Reference

Description

Namespace with classes for the VSG module.

Classes

class  ChEventHandlerVSG
 Base class for a user-defined event handler for the VSG run-time visualization system. More...
 
class  ChForceNetworkVSG
 Renderer of a force network as a set of segments between arbitrary points. More...
 
class  ChGuiComponentVSG
 Base class for a GUI component for the VSG run-time visualization system. More...
 
class  ChInstancedShapesVSG
 Renderer of granular bodies as GPU instances of shape templates. More...
 
class  ChVisualSystemVSG
 VSG-based Chrono run-time visualization system. More...
 
class  ChVisualSystemVSGPlugin
 Base class for a plugin for a VSG visual system. More...
 

Typedefs

using VertexKey = std::array< long long, 8 >
 

Functions

void TextCentered (const char *text, float offset)
 
ChFrame PointPointFrame (const ChVector3d &P1, const ChVector3d &P2, double &dist)
 
vsg::ref_ptr< vsg::Node > createSkysphere (const vsg::Path &filename, vsg::ref_ptr< vsg::Options > options, double azimuth_offset, bool yup)
 
vsg::ref_ptr< vsg::Node > createSkybox (const vsg::Path &filename, vsg::ref_ptr< vsg::Options > options, double azimuth, bool yup)
 
vsg::ref_ptr< vsg::ShaderSet > createLineShaderSet (vsg::ref_ptr< const vsg::Options > options, bool skipZbuffer)
 
vsg::ref_ptr< vsg::ShaderSet > createPbrShaderSet (vsg::ref_ptr< const vsg::Options > options, std::shared_ptr< ChVisualMaterial > material)
 
vsg::ref_ptr< vsg::StateGroup > createLineStateGroup (vsg::ref_ptr< const vsg::Options > options, VkPrimitiveTopology topology, float line_width, bool skipZbuffer)
 
vsg::ref_ptr< vsg::StateGroup > createPbrStateGroup (vsg::ref_ptr< const vsg::Options > options, std::shared_ptr< ChVisualMaterial > material, bool double_faced, bool wireframe, float wire_width)
 
vsg::ref_ptr< vsg::StateGroup > createPbrInstancedStateGroup (vsg::ref_ptr< const vsg::Options > options, std::shared_ptr< ChVisualMaterial > material, bool double_faced=false)
 Create a state group for PBR shapes drawn as GPU instances with vsg::InstanceDrawIndexed. More...
 
vsg::ref_ptr< vsg::PbrMaterialValue > createPbrMaterialFromChronoMaterial (std::shared_ptr< ChVisualMaterial > chronoMat)
 
vsg::ref_ptr< vsg::PhongMaterialValue > createPhongMaterialFromChronoMaterial (std::shared_ptr< chrono::ChVisualMaterial > chronoMat)
 
vsg::ref_ptr< vsg::PhongMaterialValue > createPhongMaterialFromChronoMaterial (std::shared_ptr< ChVisualMaterial > chronoMat)
 
VertexKey makeVertexKey (const Vertex &vert)
 
std::vector< PatchRect > computeBoxPatchRects (const ChVector3f &inner, float r)
 
std::vector< PatchRect > computeCylinderPatchRects (float innerRadius, float outerRadius, float wallHalfHeight, float edgeRadius)
 
std::vector< AtlasCell > packAtlas (const std::vector< PatchRect > &rects)
 

Variables

constexpr float pi = (float)CH_PI
 
constexpr float pi_2 = (float)CH_PI_2
 

Function Documentation

◆ createPbrInstancedStateGroup()

vsg::ref_ptr< vsg::StateGroup > chrono::vsg3d::createPbrInstancedStateGroup ( vsg::ref_ptr< const vsg::Options >  options,
std::shared_ptr< ChVisualMaterial >  material,
bool  double_faced = false 
)

Create a state group for PBR shapes drawn as GPU instances with vsg::InstanceDrawIndexed.

The pipeline takes vertex positions and normals per vertex, and colors, translations, rotations, and scales per instance (from the vsg::InstanceNode above the draw command). The instance colors replace the diffuse color of the material; all other material properties apply to all instances. Back faces are culled unless double_faced is true.