Skip to content

Commit

Permalink
Debug: Removed unused debug output parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonJoker committed Nov 20, 2024
1 parent 8708da0 commit 333be71
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 249 deletions.
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ namespace castor3d
*/
C3D_API void registerLightingModel( castor::String const & baseName
, shader::LightingModelDesc const & defaultDesc
, shader::LightingModelCreator creator )const;
, shader::LightingModelCreator const & creator )const;
/**
*\~english
*\brief Unregisters a lighting model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,22 @@ namespace castor3d::shader
, uint32_t & binding
, uint32_t set );

sdw::RetVec3 computeDiffuseReflection( sdw::Vec3 const & wsNormal
, DebugOutputCategory const & debugOutput )override;
sdw::RetVec3 computeDiffuseReflection( sdw::Vec3 const & wsNormal )override;
sdw::RetVec3 computeSpecularReflection( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, sdw::Float const & roughness
, DebugOutputCategory const & debugOutput )override;
, sdw::Float const & roughness )override;
sdw::RetVec4 computeSheenReflection( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, sdw::Float const & NdotV
, BlendComponents & components
, sdw::CombinedImage2DRgba32 const & brdf
, DebugOutputCategory const & debugOutput )override;
, sdw::CombinedImage2DRgba32 const & brdf )override;

sdw::RetVec3 computeRefraction( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, BlendComponents & components
, DebugOutputCategory const & debugOutput )override;
, BlendComponents & components )override;
sdw::RetVec3 computeSpecularRefraction( sdw::Vec3 const & fresnel
, sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
Expand All @@ -57,8 +53,7 @@ namespace castor3d::shader
, DebugOutputCategory const & debugOutput )override;

sdw::RetVec3 computeDiffuse( sdw::Vec3 const & wsDirection
, BlendComponents & components
, DebugOutputCategory const & debugOutput )override;
, BlendComponents & components )override;

public:
static castor::String const Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ namespace castor3d::shader
, sdw::Vec3 const & V
, BlendComponents & components
, sdw::Vec3 & reflectedDiffuse
, sdw::Vec3 & reflectedSpecular
, DebugOutputCategory const & debugOutput )override;
, sdw::Vec3 & reflectedSpecular )override;
sdw::RetVec3 computeRefraction( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, BlendComponents & components
, DebugOutputCategory const & debugOutput )override;
, BlendComponents & components )override;

sdw::RetVec3 computeDiffuse( sdw::Vec3 const & wsDirection
, BlendComponents & components
, DebugOutputCategory const & debugOutput )override;
, BlendComponents & components )override;

public:
static castor::String const Name;
Expand Down
18 changes: 6 additions & 12 deletions include/Core/Castor3D/Shader/Shaders/GlslBackground.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,23 @@ namespace castor3d::shader
, sdw::Vec3 const & V
, BlendComponents & components
, sdw::Vec3 & reflectedDiffuse
, sdw::Vec3 & reflectedSpecular
, DebugOutputCategory const & debugOutput );
C3D_API virtual sdw::RetVec3 computeDiffuseReflection( sdw::Vec3 const & wsNormal
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & reflectedSpecular );
C3D_API virtual sdw::RetVec3 computeDiffuseReflection( sdw::Vec3 const & wsNormal );
C3D_API virtual sdw::RetVec3 computeSpecularReflection( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, sdw::Float const & roughness
, DebugOutputCategory const & debugOutput );
, sdw::Float const & roughness );
C3D_API virtual sdw::RetVec4 computeSheenReflection( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, sdw::Float const & NdotV
, BlendComponents & components
, sdw::CombinedImage2DRgba32 const & brdf
, DebugOutputCategory const & debugOutput );
, sdw::CombinedImage2DRgba32 const & brdf );

C3D_API virtual sdw::RetVec3 computeRefraction( sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, BlendComponents & components
, DebugOutputCategory const & debugOutput );
, BlendComponents & components );
C3D_API virtual sdw::RetVec3 computeSpecularRefraction( sdw::Vec3 const & fresnel
, sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
Expand All @@ -65,8 +60,7 @@ namespace castor3d::shader
, DebugOutputCategory const & debugOutput );

C3D_API virtual sdw::RetVec3 computeDiffuse( sdw::Vec3 const & wsDirection
, BlendComponents & components
, DebugOutputCategory const & debugOutput );
, BlendComponents & components );

C3D_API virtual void applyVolume( sdw::Vec2 const fragCoord
, sdw::Float const linearDepth
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Shader/Shaders/GlslDebugOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace castor3d::shader
private:
friend class DebugOutputCategory;

C3D_API castor::String concatenateCategories();
C3D_API castor::String concatenateCategories()const;

void popBlock()
{
Expand Down
15 changes: 5 additions & 10 deletions include/Core/Castor3D/Shader/Shaders/GlslGlobalIllumination.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,22 @@ namespace castor3d::shader
, LightSurface lightSurface
, sdw::Float roughness
, sdw::CombinedImage2DRgba32 brdfMap
, IndirectLighting & indirectLighting
, DebugOutput & debugOutput );
, IndirectLighting & indirectLighting );
C3D_API void computeOcclusion( SceneFlags sceneFlags
, LightSurface lightSurface
, IndirectLighting & indirectLighting
, DebugOutput & debugOutput );
, IndirectLighting & indirectLighting );
C3D_API void computeDiffuse( SceneFlags sceneFlags
, LightSurface lightSurface
, IndirectLighting & indirectLighting
, DebugOutput & debugOutput );
, IndirectLighting & indirectLighting );
C3D_API void computeAmbient( SceneFlags sceneFlags
, SceneData const & sceneData
, BlendComponents const & components
, IndirectLighting & indirectLighting
, DebugOutput & debugOutput );
, IndirectLighting & indirectLighting );
C3D_API void computeSpecular( SceneFlags sceneFlags
, LightSurface lightSurface
, sdw::Float roughness
, sdw::CombinedImage2DRgba32 brdfMap
, IndirectLighting & indirectLighting
, DebugOutput & debugOutput );
, IndirectLighting & indirectLighting );
C3D_API sdw::Vec4 traceConeRadiance( sdw::CombinedImage3DRgba32 const & voxels
, LightSurface lightSurface
, VoxelData const & voxelData );
Expand Down
11 changes: 0 additions & 11 deletions include/Core/Castor3D/Shader/Shaders/GlslMaterial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@ namespace castor3d::shader
sdw::UInt lightingModel;
sdw::Float alphaRef;
sdw::Float opacity;
/*
sdw::Vec3 colour;
sdw::Vec3 specular;
sdw::Float transmission;
sdw::UInt hasTransmission;
sdw::UInt hasReflection;
sdw::Float refractionRatio;
sdw::Vec3 attenuationColour;
sdw::Float attenuationDistance;
sdw::Float thicknessFactor;
*/

private:
static sdw::expr::ExprPtr makeInit( sdw::ShaderWriter const & writer
Expand Down
39 changes: 13 additions & 26 deletions include/Core/Castor3D/Shader/Shaders/GlslReflection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,15 @@ namespace castor3d::shader
, BackgroundModel & background
, sdw::UInt const & envMapIndex
, sdw::Vec3 & reflectedDiffuse
, sdw::Vec3 & reflectedSpecular
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & reflectedSpecular );
C3D_API sdw::Boolean computeWithoutTransmission( BlendComponents & components
, sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, BackgroundModel & background
, sdw::UInt envMapIndex
, sdw::Vec3 & reflectedDiffuse
, sdw::Vec3 & reflectedSpecular
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & reflectedSpecular );
C3D_API void computeWithoutTransmission( BlendComponents & components
, sdw::Vec3 const & wsNormal
, sdw::Vec3 const & wsPosition
Expand Down Expand Up @@ -166,43 +164,37 @@ namespace castor3d::shader
, sdw::Vec3 const & wsNormal
, sdw::Float const & roughness
, sdw::UInt const & envMapIndex
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, DebugOutputCategory const & debugOutput );
, sdw::CombinedImageCubeArrayRgba32 const & envMap );
sdw::RetVec4 computeSheenReflEnvMaps( sdw::CombinedImage2DRgba32 const & brdf
, sdw::Vec3 const & wsIncident
, sdw::Vec3 const & wsNormal
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::UInt const & envMapIndex
, sdw::Float const & NdotV
, BlendComponents & components
, DebugOutputCategory const & debugOutput );
, BlendComponents & components );
sdw::RetVec3 computeRefrEnvMaps( sdw::Vec3 const & wsIncident
, sdw::Vec3 const & wsNormal
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::UInt const & envMapIndex
, BlendComponents & f0
, DebugOutputCategory const & debugOutput );
, BlendComponents & f0 );
sdw::RetVec3 computeDiffuseEnvMaps( sdw::Vec3 const & wsDirection
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::UInt const & envMapIndex
, BlendComponents & components
, DebugOutputCategory const & debugOutput );
, BlendComponents & components );
sdw::RetVec3 doComputeSpecularTransmission( sdw::Vec3 const & wsIncident
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & wsNormal
, sdw::CombinedImage2DRgba32 const & sceneMap
, CameraData const & camera
, sdw::Vec2 sceneUv
, BlendComponents & components
, DebugOutputCategory const & debugOutput );
, BlendComponents & components );
sdw::RetVec3 doComputeRefrEnvMaps( sdw::Vec3 const & wsIncident
, sdw::Vec3 const & wsNormal
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::UInt const & envMapIndex
, sdw::Float const & refractionRatio
, sdw::Vec3 & albedo
, sdw::Float const & roughness
, DebugOutputCategory const & debugOutput );
, sdw::Float const & roughness );
void doComputeReflection( sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::Boolean const & hasEnvMap
, BackgroundModel & background
Expand All @@ -212,8 +204,7 @@ namespace castor3d::shader
, sdw::UInt const & envMapIndex
, BlendComponents & components
, sdw::Vec3 & reflectedDiffuse
, sdw::Vec3 & reflectedSpecular
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & reflectedSpecular );
void doComputeSpecularTransmission( sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::Boolean const & hasEnvMap
, BackgroundModel & background
Expand All @@ -222,25 +213,22 @@ namespace castor3d::shader
, sdw::Vec3 const & V
, sdw::UInt const & envMapIndex
, BlendComponents & components
, sdw::Vec3 & refracted
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & refracted );
void doComputeDiffuse( sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::Boolean const & hasEnvMap
, BackgroundModel & background
, sdw::Vec3 const & wsDirection
, sdw::UInt const & envMapIndex
, BlendComponents & components
, sdw::Vec3 & result
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & result );
void doComputeClearcoat( sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::Boolean const & hasEnvMap
, BackgroundModel & background
, sdw::Vec3 const & wsPosition
, sdw::Vec3 const & V
, sdw::UInt const & envMapIndex
, BlendComponents & components
, sdw::Vec3 & coatReflected
, DebugOutputCategory const & debugOutput );
, sdw::Vec3 & coatReflected );
void doComputeSheen( sdw::CombinedImage2DRgba32 const & brdf
, sdw::CombinedImageCubeArrayRgba32 const & envMap
, sdw::Boolean const & hasEnvMap
Expand All @@ -251,8 +239,7 @@ namespace castor3d::shader
, sdw::Float const & NdotV
, sdw::UInt const & envMapIndex
, BlendComponents & components
, sdw::Vec4 & sheenReflected
, DebugOutputCategory const & debugOutput );
, sdw::Vec4 & sheenReflected );

private:
sdw::ShaderWriter & m_writer;
Expand Down
8 changes: 4 additions & 4 deletions source/Core/Castor3D/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ namespace castor3d
| VK_IMAGE_USAGE_TRANSFER_DST_BIT
| VK_IMAGE_USAGE_SAMPLED_BIT ) };
result.create();
castor::PxBufferBaseRPtr bufferRG;
castor::PxBufferBaseRPtr bufferB;
castor::PxBufferBase const * bufferRG;
castor::PxBufferBase const * bufferB;
{
auto imagePath = Engine::getEngineDirectory() / cuT( "Core" ) / cuT( "brdf_ggx.png" );
castor::ImageResPtr created;
Expand Down Expand Up @@ -795,11 +795,11 @@ namespace castor3d

void Engine::registerLightingModel( castor::String const & baseName
, shader::LightingModelDesc const & defaultDesc
, shader::LightingModelCreator creator )const
, shader::LightingModelCreator const & creator )const
{
getLightingModelFactory().registerType( baseName
, defaultDesc
, castor::move( creator ) );
, creator );
}

void Engine::unregisterLightingModel( castor::String const & baseName )const
Expand Down
5 changes: 2 additions & 3 deletions source/Core/Castor3D/Render/Opaque/VisibilityResolvePass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ namespace castor3d
}

auto incident = writer.declLocale( "incident"
, reflections.computeIncident( shader::getXYZ( baseSurface.worldPosition ), c3d_cameraDataMain.position() ) );
, shader::ReflectionModel::computeIncident( shader::getXYZ( baseSurface.worldPosition ), c3d_cameraDataMain.position() ) );

if ( components.transmissionFactor )
{
Expand Down Expand Up @@ -1372,8 +1372,7 @@ namespace castor3d
, lightSurface
, components.perceptualRoughness
, c3d_mapBrdf
, indirectLighting
, output );
, indirectLighting );

// Reflection/Refraction
auto reflRefrResult = writer.declLocale( "reflRefrResult"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ namespace castor3d

in.registerDebug( flags, components, output.pushBlock( cuT( "Surface" ) ) );
auto incident = writer.declLocale( "incident"
, reflections.computeIncident( in.worldPosition.xyz(), c3d_cameraData.position() ) );
, shader::ReflectionModel::computeIncident( in.worldPosition.xyz(), c3d_cameraData.position() ) );

if ( !checkFlag( m_filters, RenderFilter::eOpaque ) )
{
Expand Down Expand Up @@ -456,8 +456,7 @@ namespace castor3d
, lightSurface
, components.perceptualRoughness
, c3d_mapBrdf
, indirectLighting
, output );
, indirectLighting );

// Reflections/Refraction
auto reflRefrResult = writer.declLocale( "reflRefrResult"
Expand Down
5 changes: 2 additions & 3 deletions source/Core/Castor3D/Render/Transparent/TransparentPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ namespace castor3d
, lightSurface
, components.perceptualRoughness
, c3d_mapBrdf
, indirectLighting
, output );
, indirectLighting );

// Reflections/Refraction
auto reflRefrResult = writer.declLocale( "reflRefrResult"
Expand All @@ -430,7 +429,7 @@ namespace castor3d
}

auto incident = writer.declLocale( "incident"
, reflections.computeIncident( lightSurface.worldPosition().value().xyz(), c3d_cameraData.position() ) );
, shader::ReflectionModel::computeIncident( lightSurface.worldPosition().value().xyz(), c3d_cameraData.position() ) );
lightSurface.updateN( components.getDerivNormal() );
passShaders.backgroundBrdfWithTransmission( reflections
, components
Expand Down
Loading

0 comments on commit 333be71

Please sign in to comment.