25#ifndef RENDER_3D_RAYTRACE_BASE_H
26#define RENDER_3D_RAYTRACE_BASE_H
30#include "../render_3d_base.h"
32#include "../post_shader_ssao.h"
68 bool aOnlyLoadCopperAndShapes );
77 float aLayerZOffset );
85 bool applyColorSpaceConversion );
88 bool is_testShadow,
SFVEC4F* aOutHitColor );
98 bool aIsInsideObject,
unsigned int aRecursiveLevel,
99 bool is_testShadow )
const;
115 const glm::mat4& aModelMatrix,
float aFPOpacity,
116 bool aSkipMaterialInformation,
BOARD_ITEM* aBoardItem );
212#define USE_SRGB_SPACE
218#define ConvertSRGBToLinear( v ) ( v )
219#define ConvertSRGBAToLinear( v ) ( v )
constexpr double PCB_IU_PER_MM
define an internal structure to be used by the 3D renders
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model.
Helper class to handle information needed to display 3D board.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
A class used to derive camera objects from.
Procedural generation of the copper normals.
A light source based only on a directional vector.
Base material class that can be used to derive other material implementations.
Procedural generation of the plastic normals.
Procedural generation of the shiny plastic normals.
This is a base class to hold data and functions for render targets.
void renderBlockTracing(uint8_t *ptrPBO, signed int iBlock)
virtual void deletePbo()=0
static SFVEC4F premultiplyAlpha(const SFVEC4F &aInput)
BLINN_PHONG_MATERIAL m_NonPlatedCopper
BLINN_PHONG_MATERIAL m_EpoxyBoard
SILK_SCREEN_NORMAL m_silkScreenMaterial
void Reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter, bool aOnlyLoadCopperAndShapes)
void renderFinalColor(uint8_t *ptrPBO, const SFVEC4F &rgbColor, bool applyColorSpaceConversion)
~RENDER_3D_RAYTRACE_BASE()
BOARD_NORMAL m_boardMaterial
CONTAINER_3D m_objectContainer
Store the list of created objects special for RT that will be clear in the end.
HITINFO_PACKET * m_firstHitinfo
COPPER_NORMAL m_copperMaterial
void renderTracing(uint8_t *ptrPBO, REPORTER *aStatusReporter)
void render(uint8_t *ptrPBO, REPORTER *aStatusReporter)
void postProcessBlurFinish(uint8_t *ptrPBO, REPORTER *aStatusReporter)
void renderAntiAliasPackets(const SFVEC4F *aBgColorY, const HITINFO_PACKET *aHitPck_X0Y0, const HITINFO_PACKET *aHitPck_AA_X1Y1, const RAY *aRayPck, SFVEC4F *aOutHitColor)
BLINN_PHONG_MATERIAL m_Paste
BLINN_PHONG_MATERIAL m_Copper
POST_SHADER_SSAO m_postShaderSsao
void load3DModels(CONTAINER_3D &aDstContainer, bool aSkipMaterialInformation)
void insertHole(const PCB_VIA *aVia)
bool m_is_canvas_initialized
void postProcessShading(uint8_t *ptrPBO, REPORTER *aStatusReporter)
BRUSHED_METAL_NORMAL m_brushedMetalMaterial
std::vector< int > m_blockPositionsWasProcessed
Encode the Morton code positions (on fast preview mode).
static constexpr float MIN_DISTANCE_IU
PLATED_COPPER_NORMAL m_platedCopperMaterial
PLASTIC_NORMAL m_plasticMaterial
ACCELERATOR_3D * m_accelerator
void createItemsFromContainer(const BVH_CONTAINER_2D *aContainer2d, PCB_LAYER_ID aLayer_id, const MATERIAL *aMaterialLayer, const SFVEC3F &aLayerColor, float aLayerZOffset)
DIRECTIONAL_LIGHT * m_cameraLight
PLASTIC_SHINE_NORMAL m_shinyPlasticMaterial
BOARD_ITEM * IntersectBoardItem(const RAY &aRay)
unsigned int m_convertedDummyBlockCount
RT_RENDER_STATE m_renderState
State used on quality render.
BLINN_PHONG_MATERIAL m_Floor
SFVEC2UI m_fastPreviewModeSize
void renderRayPackets(const SFVEC4F *bgColorY, const RAY *aRayPkt, HITINFO_PACKET *aHitPacket, bool is_testShadow, SFVEC4F *aOutHitColor)
int GetWaitForEditingTimeOut() override
Give the interface the time (in ms) that it should wait for editing or movements before (this works f...
std::vector< SFVEC2UI > m_blockPositionsFast
struct RENDER_3D_RAYTRACE_BASE::@5 m_materials
SFVEC4F shadeHit(const SFVEC4F &aBgColor, const RAY &aRay, HITINFO &aHitInfo, bool aIsInsideObject, unsigned int aRecursiveLevel, bool is_testShadow) const
BLINN_PHONG_MATERIAL m_SilkS
CONTAINER_2D * m_outlineBoard2dObjects
SFVEC4F m_backgroundColorBottom
Used to see if the windows size changed.
SFVEC4F m_backgroundColorTop
BVH_CONTAINER_2D * m_antioutlineBoard2dObjects
void restartRenderState()
CONTAINER_2D m_containerWithObjectsToDelete
BLINN_PHONG_MATERIAL m_SolderMask
MODEL_MATERIALS * getModelMaterial(const S3DMODEL *a3DModel)
wxSize m_oldWindowsSize
Encode Morton code positions.
void renderPreview(uint8_t *ptrPBO)
SOLDER_MASK_NORMAL m_solderMaskMaterial
void addModels(CONTAINER_3D &aDstContainer, const S3DMODEL *a3DModel, const glm::mat4 &aModelMatrix, float aFPOpacity, bool aSkipMaterialInformation, BOARD_ITEM *aBoardItem)
std::list< LIGHT * > m_lights
MAP_MODEL_MATERIALS m_modelMaterialMap
Stores materials of the 3D models.
void createObject(CONTAINER_3D &aDstContainer, const OBJECT_2D *aObject2D, float aZMin, float aZMax, const MATERIAL *aMaterial, const SFVEC3F &aObjColor)
Create one or more 3D objects form a 2D object and Z positions.
size_t m_blockRenderProgressCount
Save the number of blocks progress of the render.
unsigned int m_converted2dRoundSegmentCount
int64_t m_renderStartTime
Time that the render starts.
void initializeBlockPositions()
std::vector< SFVEC2UI > m_blockPositions
Flag if a position was already processed (cleared each new render).
SFVEC2UI m_realBufferSize
A pure virtual class used to derive REPORTER objects from.
Procedural generation of the solder mask.
PCB_LAYER_ID
A quick note on layer IDs:
Declare and implement light sources.
SFVEC3F ConvertSRGBToLinear(const SFVEC3F &aSRGBcolor)
std::vector< BLINN_PHONG_MATERIAL > MODEL_MATERIALS
Vector of materials.
@ RT_RENDER_STATE_POST_PROCESS_SHADE
@ RT_RENDER_STATE_POST_PROCESS_BLUR_AND_FINISH
@ RT_RENDER_STATE_TRACING
SFVEC4F ConvertSRGBAToLinear(const SFVEC4F &aSRGBAcolor)
std::map< const S3DMODEL *, MODEL_MATERIALS > MAP_MODEL_MATERIALS
Maps a S3DMODEL pointer with a created BLINN_PHONG_MATERIAL vector.
Stores the hit information of a ray with a point on the surface of a object.
Store the a model based on meshes and materials.