Namespaces | Typedefs | Functions
GraphicsUtilities.h File Reference

The code in here is supposed to help create materials correctly, a lot of it is boilerplate that is repeated over for each material. More...

#include <memory>
#include <unordered_map>
#include <string>
#include "SurgSim/Math/Vector.h"

Go to the source code of this file.

Namespaces

 SurgSim
 
 SurgSim::Graphics
 
 SurgSim::Framework
 
 SurgSim::Blocks
 

Typedefs

typedef std::unordered_map< std::string, std::shared_ptr< SurgSim::Graphics::OsgMaterial > > SurgSim::Blocks::Materials
 

Functions

void SurgSim::Blocks::enable2DTexture (std::shared_ptr< SurgSim::Graphics::OsgMaterial > material, const std::string &uniform, int unit, const std::string &filename="", bool repeat=false)
 Provide a consistent interface to add texture uniforms on materials, adds the actual texture with a given minimum unit, or provides a placeholder uniform for the unit. More...
 
std::shared_ptr< SurgSim::Graphics::OsgMaterialSurgSim::Blocks::createPlainMaterial (const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess)
 Create a basic material. More...
 
std::shared_ptr< SurgSim::Graphics::OsgMaterialSurgSim::Blocks::createTexturedMaterial (const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess, const std::string &diffuseMap="")
 Create a basic textured material. More...
 
std::shared_ptr< Graphics::OsgMaterial > SurgSim::Blocks::createNormalMappedMaterial (const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess, const std::string &diffuseMap="", const std::string &normalMap="")
 Create a basic textured material. More...
 
void SurgSim::Blocks::applyMaterials (std::shared_ptr< SurgSim::Framework::Scene > scene, std::string materialFilename, const Materials &materials)
 Reads a material file, iterates over the components listed up in the material file and applies the materials and the appropriate material properties (if present) to the component, if the component is not found it will be ignored The material file is a yaml file with the following format. More...
 

Detailed Description

The code in here is supposed to help create materials correctly, a lot of it is boilerplate that is repeated over for each material.

It will have to be changed if the shaders being used change.