KiCad PCB EDA Suite
render_3d_raytrace.h File Reference

Go to the source code of this file.

Classes

class  RENDER_3D_RAYTRACE
 

Macros

#define USE_SRGB_SPACE
 

Typedefs

typedef std::vector< BLINN_PHONG_MATERIALMODEL_MATERIALS
 Vector of materials. More...
 
typedef std::map< const S3DMODEL *, MODEL_MATERIALSMAP_MODEL_MATERIALS
 Maps a S3DMODEL pointer with a created BLINN_PHONG_MATERIAL vector. More...
 

Enumerations

enum  RT_RENDER_STATE {
  RT_RENDER_STATE_TRACING = 0, RT_RENDER_STATE_POST_PROCESS_SHADE, RT_RENDER_STATE_POST_PROCESS_BLUR_AND_FINISH, RT_RENDER_STATE_FINISH,
  RT_RENDER_STATE_MAX
}
 

Functions

SFVEC3F ConvertSRGBToLinear (const SFVEC3F &aSRGBcolor)
 

Macro Definition Documentation

◆ USE_SRGB_SPACE

#define USE_SRGB_SPACE

Definition at line 213 of file render_3d_raytrace.h.

Typedef Documentation

◆ MAP_MODEL_MATERIALS

typedef std::map< const S3DMODEL* , MODEL_MATERIALS > MAP_MODEL_MATERIALS

Maps a S3DMODEL pointer with a created BLINN_PHONG_MATERIAL vector.

Definition at line 43 of file render_3d_raytrace.h.

◆ MODEL_MATERIALS

typedef std::vector< BLINN_PHONG_MATERIAL > MODEL_MATERIALS

Vector of materials.

Definition at line 40 of file render_3d_raytrace.h.

Enumeration Type Documentation

◆ RT_RENDER_STATE

Enumerator
RT_RENDER_STATE_TRACING 
RT_RENDER_STATE_POST_PROCESS_SHADE 
RT_RENDER_STATE_POST_PROCESS_BLUR_AND_FINISH 
RT_RENDER_STATE_FINISH 
RT_RENDER_STATE_MAX 

Definition at line 45 of file render_3d_raytrace.h.

Function Documentation

◆ ConvertSRGBToLinear()

SFVEC3F ConvertSRGBToLinear ( const SFVEC3F aSRGBcolor)

Definition at line 431 of file render_3d_raytrace.cpp.

432 {
433  const float gammaCorrection = SRGB_GAMA;
434 
435  return glm::mix( glm::pow( ( aSRGBcolor + SFVEC3F( 0.055f ) )
436  * SFVEC3F( 0.94786729857819905213270142180095f ),
437  SFVEC3F( gammaCorrection ) ),
438  aSRGBcolor * SFVEC3F( 0.07739938080495356037151702786378f ),
439  glm::lessThanEqual( aSRGBcolor, SFVEC3F( 0.04045f ) ) );
440 }
#define SRGB_GAMA
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44

References SRGB_GAMA.

Referenced by RENDER_3D_RAYTRACE::addModels(), RENDER_3D_RAYTRACE::createItemsFromContainer(), RENDER_3D_RAYTRACE::createObject(), RENDER_3D_RAYTRACE::getModelMaterial(), RENDER_3D_RAYTRACE::insertHole(), RENDER_3D_RAYTRACE::Reload(), RENDER_3D_RAYTRACE::render(), and RENDER_3D_RAYTRACE::setupMaterials().