From 2aa56e2c867fb4acdc2e68eb7a50d27742590c3c Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Sun, 15 May 2022 00:49:39 +0100 Subject: [PATCH] 3D-Viewer: assign correct copper material based on render plated option. change plated material intensity. --- 3d-viewer/3d_rendering/raytracing/create_scene.cpp | 11 ++++++++--- 3d-viewer/3d_rendering/raytracing/material.cpp | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index 15d6fa5678..90a7559b65 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2022 Mario Luzeiro + * Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -632,16 +632,21 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe if( m_boardAdapter.m_Cfg->m_Render.realistic ) { if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) + { layerColor = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f ); + materialLayer = &m_materials.m_NonPlatedCopper; + } else + { layerColor = m_boardAdapter.m_CopperColor; + materialLayer = &m_materials.m_Copper; + } } else { layerColor = m_boardAdapter.GetLayerColor( layer_id ); } - materialLayer = &m_materials.m_NonPlatedCopper; break; } diff --git a/3d-viewer/3d_rendering/raytracing/material.cpp b/3d-viewer/3d_rendering/raytracing/material.cpp index f0f2fc5016..e06b5632f6 100644 --- a/3d-viewer/3d_rendering/raytracing/material.cpp +++ b/3d-viewer/3d_rendering/raytracing/material.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015-2020 Mario Luzeiro - * Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2022 Mario Luzeiro + * Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -223,7 +223,7 @@ SFVEC3F PLATED_COPPER_NORMAL::Generate( const RAY& aRay, const HITINFO& aHitInfo const float noise1 = ( s_perlinNoise.noise( hitPos.x, hitPos.y ) - 0.5f ); const float noise2 = ( s_perlinNoise.noise( hitPos.y, hitPos.x ) - 0.5f ); - return SFVEC3F( noise1, noise2, -( noise1 + noise2 ) ) * 0.02f; + return SFVEC3F( noise1, noise2, 0.0f ) * 0.1f; }