KiCad PCB EDA Suite
c3d_render_createscene.cpp File Reference
#include "c3d_render_raytracing.h"
#include "shapes3D/cplane.h"
#include "shapes3D/croundseg.h"
#include "shapes3D/clayeritem.h"
#include "shapes3D/ccylinder.h"
#include "shapes3D/ctriangle.h"
#include "shapes2D/citemlayercsg2d.h"
#include "shapes2D/cring2d.h"
#include "shapes2D/cpolygon2d.h"
#include "shapes2D/cfilledcircle2d.h"
#include "accelerators/cbvh_pbrt.h"
#include "3d_fastmath.h"
#include "3d_math.h"
#include <class_board.h>
#include <class_module.h>
#include <base_units.h>
#include <profile.h>

Go to the source code of this file.

Macros

#define UNITS3D_TO_UNITSPCB   (IU_PER_MM)
 Scale convertion from 3d model units to pcb units. More...
 

Functions

static float TransparencyControl (float aGrayColorValue, float aTransparency)
 TransparencyAlphaControl Perform an interpolation step to easy control the transparency based on the gray color value and transparency. More...
 

Macro Definition Documentation

◆ UNITS3D_TO_UNITSPCB

#define UNITS3D_TO_UNITSPCB   (IU_PER_MM)

Scale convertion from 3d model units to pcb units.

Definition at line 73 of file c3d_render_createscene.cpp.

Function Documentation

◆ TransparencyControl()

static float TransparencyControl ( float  aGrayColorValue,
float  aTransparency 
)
static

TransparencyAlphaControl Perform an interpolation step to easy control the transparency based on the gray color value and transparency.

Parameters
aGrayColorValue- diffuse gray value
aTransparency- control
Returns
transparency to use in material

Definition at line 59 of file c3d_render_createscene.cpp.

60 {
61  const float aaa = aTransparency * aTransparency * aTransparency;
62 
63  // 1.00-1.05*(1.0-x)^3
64  float ca = 1.0f - aTransparency;
65  ca = 1.00f - 1.05f * ca * ca * ca;
66 
67  return glm::max( glm::min( aGrayColorValue * ca + aaa, 1.0f ), 0.0f );
68 }

Referenced by C3D_RENDER_RAYTRACING::setupMaterials().