Skip to content

Commit

Permalink
Removed support for unstable V_Ward/G_Ward
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed Sep 13, 2018
1 parent f6693d6 commit 306d8bf
Show file tree
Hide file tree
Showing 18 changed files with 5 additions and 477 deletions.
8 changes: 3 additions & 5 deletions MAGE/Rendering/src/renderer/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,14 @@ namespace mage::rendering {
This contains:
@c Lambertian,
@c BlinnPhong,
@c CookTorrance,
@c Frostbite, and
@c WardDuer.
@c CookTorrance, and
@c Frostbite.
*/
enum class BRDF : U8 {
Lambertian = 0,
BlinnPhong,
CookTorrance,
Frostbite,
WardDuer
Frostbite
};

#pragma endregion
Expand Down
26 changes: 0 additions & 26 deletions MAGE/Rendering/src/resource/shader/shader_factory_deferred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,22 @@
#include "deferred\deferred_emissive_CS.hpp"
#include "deferred\deferred_frostbite_CS.hpp"
#include "deferred\deferred_lambertian_CS.hpp"
#include "deferred\deferred_ward_duer_CS.hpp"
// Deferred: Opaque + VCT
#include "deferred\deferred_vct_blinn_phong_CS.hpp"
#include "deferred\deferred_vct_cook_torrance_CS.hpp"
#include "deferred\deferred_vct_frostbite_CS.hpp"
#include "deferred\deferred_vct_lambertian_CS.hpp"
#include "deferred\deferred_vct_ward_duer_CS.hpp"
// Deferred MSAA: Opaque
#include "deferred\deferred_msaa_blinn_phong_PS.hpp"
#include "deferred\deferred_msaa_cook_torrance_PS.hpp"
#include "deferred\deferred_msaa_emissive_PS.hpp"
#include "deferred\deferred_msaa_frostbite_PS.hpp"
#include "deferred\deferred_msaa_lambertian_PS.hpp"
#include "deferred\deferred_msaa_ward_duer_PS.hpp"
// Deferred MSAA: Opaque + VCT
#include "deferred\deferred_msaa_vct_blinn_phong_PS.hpp"
#include "deferred\deferred_msaa_vct_cook_torrance_PS.hpp"
#include "deferred\deferred_msaa_vct_frostbite_PS.hpp"
#include "deferred\deferred_msaa_vct_lambertian_PS.hpp"
#include "deferred\deferred_msaa_vct_ward_duer_PS.hpp"

#pragma endregion

Expand Down Expand Up @@ -98,15 +94,6 @@ namespace mage::rendering {
: CreateCS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_lambertian_CS));
}

ComputeShaderPtr CreateDeferredWardDuerCS(ResourceManager& resource_manager,
bool vct) {

return vct ? CreateCS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_vct_ward_duer_CS))
: CreateCS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_ward_duer_CS));
}
}

ComputeShaderPtr CreateDeferredCS(ResourceManager& resource_manager,
Expand All @@ -121,8 +108,6 @@ namespace mage::rendering {
return CreateDeferredCookTorranceCS(resource_manager, vct);
case BRDF::Frostbite:
return CreateDeferredFrostbiteCS(resource_manager, vct);
case BRDF::WardDuer:
return CreateDeferredWardDuerCS(resource_manager, vct);
default:
return nullptr;
}
Expand Down Expand Up @@ -178,15 +163,6 @@ namespace mage::rendering {
: CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_msaa_lambertian_PS));
}

PixelShaderPtr CreateDeferredMSAAWardDuerPS(ResourceManager& resource_manager,
bool vct) {

return vct ? CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_msaa_vct_ward_duer_PS))
: CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_deferred_msaa_ward_duer_PS));
}
}

PixelShaderPtr CreateDeferredMSAAPS(ResourceManager& resource_manager,
Expand All @@ -201,8 +177,6 @@ namespace mage::rendering {
return CreateDeferredMSAACookTorrancePS(resource_manager, vct);
case BRDF::Frostbite:
return CreateDeferredMSAAFrostbitePS(resource_manager, vct);
case BRDF::WardDuer:
return CreateDeferredMSAAWardDuerPS(resource_manager, vct);
default:
return nullptr;
}
Expand Down
66 changes: 0 additions & 66 deletions MAGE/Rendering/src/resource/shader/shader_factory_forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,42 @@
#include "forward\forward_emissive_PS.hpp"
#include "forward\forward_frostbite_PS.hpp"
#include "forward\forward_lambertian_PS.hpp"
#include "forward\forward_ward_duer_PS.hpp"
// Forward: Opaque + VCT
#include "forward\forward_vct_blinn_phong_PS.hpp"
#include "forward\forward_vct_cook_torrance_PS.hpp"
#include "forward\forward_vct_frostbite_PS.hpp"
#include "forward\forward_vct_lambertian_PS.hpp"
#include "forward\forward_vct_ward_duer_PS.hpp"
// Forward: Opaque + TSNM
#include "forward\forward_tsnm_blinn_phong_PS.hpp"
#include "forward\forward_tsnm_cook_torrance_PS.hpp"
#include "forward\forward_tsnm_frostbite_PS.hpp"
#include "forward\forward_tsnm_lambertian_PS.hpp"
#include "forward\forward_tsnm_ward_duer_PS.hpp"
// Forward: Opaque + VCT + TSNM
#include "forward\forward_vct_tsnm_blinn_phong_PS.hpp"
#include "forward\forward_vct_tsnm_cook_torrance_PS.hpp"
#include "forward\forward_vct_tsnm_frostbite_PS.hpp"
#include "forward\forward_vct_tsnm_lambertian_PS.hpp"
#include "forward\forward_vct_tsnm_ward_duer_PS.hpp"
// Forward: Transparent
#include "forward\forward_transparent_blinn_phong_PS.hpp"
#include "forward\forward_transparent_cook_torrance_PS.hpp"
#include "forward\forward_transparent_emissive_PS.hpp"
#include "forward\forward_transparent_frostbite_PS.hpp"
#include "forward\forward_transparent_lambertian_PS.hpp"
#include "forward\forward_transparent_ward_duer_PS.hpp"
// Forward: Transparent + VCT
#include "forward\forward_transparent_vct_blinn_phong_PS.hpp"
#include "forward\forward_transparent_vct_cook_torrance_PS.hpp"
#include "forward\forward_transparent_vct_frostbite_PS.hpp"
#include "forward\forward_transparent_vct_lambertian_PS.hpp"
#include "forward\forward_transparent_vct_ward_duer_PS.hpp"
// Forward: Transparent + TSNM
#include "forward\forward_transparent_tsnm_blinn_phong_PS.hpp"
#include "forward\forward_transparent_tsnm_cook_torrance_PS.hpp"
#include "forward\forward_transparent_tsnm_frostbite_PS.hpp"
#include "forward\forward_transparent_tsnm_lambertian_PS.hpp"
#include "forward\forward_transparent_tsnm_ward_duer_PS.hpp"
// Forward: Transparent + VCT + TSNM
#include "forward\forward_transparent_vct_tsnm_blinn_phong_PS.hpp"
#include "forward\forward_transparent_vct_tsnm_cook_torrance_PS.hpp"
#include "forward\forward_transparent_vct_tsnm_frostbite_PS.hpp"
#include "forward\forward_transparent_vct_tsnm_lambertian_PS.hpp"
#include "forward\forward_transparent_vct_tsnm_ward_duer_PS.hpp"

#pragma endregion

Expand Down Expand Up @@ -340,62 +332,6 @@ namespace mage::rendering {
return nullptr;
}
}

/**
Creates a forward pixel shader with a Ward-Duer BRDF.
@param[in] resource_manager
A reference to the resource manager.
@param[in] transparency
@c true if transparency should be enabled. @c false
otherwise.
@param[in] vct
@c true if voxel cone tracing should be enabled. @c
false otherwise.
@param[in] tsnm
@c true if tangent space normal mapping should be
enabled. @c false otherwise.
@return A pointer to the forward pixel shader with a Ward-Duer
BRDF.
@throws Exception
Failed to create the pixel shader.
*/
PixelShaderPtr CreateForwardWardDuerPS(ResourceManager& resource_manager,
bool transparency,
bool vct,
bool tsnm) {

const auto mask = GetPermutationMask(transparency, vct, tsnm);
switch (mask) {

case 0b000:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_ward_duer_PS));
case 0b001:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_tsnm_ward_duer_PS));
case 0b010:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_vct_ward_duer_PS));
case 0b011:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_vct_tsnm_ward_duer_PS));
case 0b100:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_transparent_ward_duer_PS));
case 0b101:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_transparent_tsnm_ward_duer_PS));
case 0b110:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_transparent_vct_ward_duer_PS));
case 0b111:
return CreatePS(resource_manager,
MAGE_SHADER_ARGS(g_forward_transparent_vct_tsnm_ward_duer_PS));
default:
return nullptr;
}
}
}

PixelShaderPtr CreateForwardPS(ResourceManager& resource_manager,
Expand All @@ -414,8 +350,6 @@ namespace mage::rendering {
return CreateForwardCookTorrancePS(resource_manager, transparency, vct, tsnm);
case BRDF::Frostbite:
return CreateForwardFrostbitePS(resource_manager, transparency, vct, tsnm);
case BRDF::WardDuer:
return CreateForwardWardDuerPS(resource_manager, transparency, vct, tsnm);
default:
return nullptr;
}
Expand Down
6 changes: 2 additions & 4 deletions MAGE/Scripts/src/editor_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,13 @@ namespace mage::script {
"Lambertian",
"Blinn-Phong",
"Cook-Torrance",
"Frostbite",
"Ward-Duer"
"Frostbite"
};
static constexpr BRDF brdfs[] = {
BRDF::Lambertian,
BRDF::BlinnPhong,
BRDF::CookTorrance,
BRDF::Frostbite,
BRDF::WardDuer
BRDF::Frostbite
};
static_assert(std::size(brdf_names) == std::size(brdfs));

Expand Down
Loading

0 comments on commit 306d8bf

Please sign in to comment.