KiCad PCB EDA Suite
c3d_render_raytracing.h File Reference

Go to the source code of this file.

Classes

class  C3D_RENDER_RAYTRACING
 

Macros

#define USE_SRGB_SPACE
 

Typedefs

typedef std::vector< CBLINN_PHONG_MATERIALMODEL_MATERIALS
 Vector of materials. More...
 
typedef std::map< const S3DMODEL *, MODEL_MATERIALSMAP_MODEL_MATERIALS
 Maps a S3DMODEL pointer with a created CBLINN_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

#define USE_SRGB_SPACE

Definition at line 210 of file c3d_render_raytracing.h.

Typedef Documentation

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

Maps a S3DMODEL pointer with a created CBLINN_PHONG_MATERIAL vector.

Definition at line 48 of file c3d_render_raytracing.h.

typedef std::vector< CBLINN_PHONG_MATERIAL > MODEL_MATERIALS

Vector of materials.

Definition at line 45 of file c3d_render_raytracing.h.

Enumeration Type Documentation

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 50 of file c3d_render_raytracing.h.

Function Documentation

SFVEC3F ConvertSRGBToLinear ( const SFVEC3F aSRGBcolor)

Definition at line 453 of file c3d_render_raytracing.cpp.

References SRGB_GAMA.

Referenced by C3D_RENDER_RAYTRACING::add_3D_models(), C3D_RENDER_RAYTRACING::create_3d_object_from(), C3D_RENDER_RAYTRACING::insert3DPadHole(), C3D_RENDER_RAYTRACING::insert3DViaHole(), C3D_RENDER_RAYTRACING::reload(), C3D_RENDER_RAYTRACING::render(), and C3D_RENDER_RAYTRACING::setupMaterials().

454 {
455  const float gammaCorrection = SRGB_GAMA;
456 
457  return glm::mix(
458  glm::pow( (aSRGBcolor + SFVEC3F(0.055f)) * SFVEC3F(0.94786729857819905213270142180095f),
459  SFVEC3F(gammaCorrection) ),
460  aSRGBcolor * SFVEC3F(0.07739938080495356037151702786378f),
461  glm::lessThanEqual( aSRGBcolor, SFVEC3F(0.04045f) ) );
462 }
#define SRGB_GAMA
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47