Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Functions | Variables
SceneExport Namespace Reference

Helpers to export a Rendu scene. More...

Classes

struct  Material
 Contain exported texture infos for a given material. More...
 

Functions

int saveColor (const std::string &outputPath, const glm::vec3 &color)
 
Material saveMaterial (const std::string &baseName, const CompositeObj::Material &material, const std::string &outputDirPath)
 
int saveDescription (const std::vector< CompositeObj::Object > &objects, const std::unordered_map< std::string, Material > &materials, const std::string &outputPath)
 

Variables

const int textureSize = 8
 Default uniform texture size.
 

Detailed Description

Helpers to export a Rendu scene.

Function Documentation

◆ saveColor()

int SceneExport::saveColor ( const std::string &  outputPath,
const glm::vec3 &  color 
)

Save a small colored texture.

Parameters
outputPaththe output image file path
colorthe color to store in the texture
Returns
an error code or 0

◆ saveDescription()

int SceneExport::saveDescription ( const std::vector< CompositeObj::Object > &  objects,
const std::unordered_map< std::string, Material > &  materials,
const std::string &  outputPath 
)

Save a scene description, listing all objects with materials. The file can then be decoded by Codable objects.

Parameters
objectsthe scene objects
materialsthe scene materials
outputPaththe destination file
Returns
an error code or 0

◆ saveMaterial()

Material SceneExport::saveMaterial ( const std::string &  baseName,
const CompositeObj::Material material,
const std::string &  outputDirPath 
)

Save a material parameters as a series of textures.

Parameters
baseNamematerial base name
materialthe material to export
outputDirPaththe output directory
Returns
the exported material information