Add UseAlpha to RenderBuffers for pass-though renderer with alpha channel

This commit is contained in:
Wojtek Figat
2022-08-01 22:58:22 +02:00
parent fe1cab6a7f
commit a6e9abfceb
14 changed files with 136 additions and 107 deletions

View File

@@ -13,9 +13,6 @@
#define GBUFFER2_FORMAT PixelFormat::R8G8B8A8_UNorm
#define GBUFFER3_FORMAT PixelFormat::R8G8B8A8_UNorm
// Light accumulation buffer format (direct+indirect light, materials emissive)
#define LIGHT_BUFFER_FORMAT PixelFormat::R11G11B10_Float
/// <summary>
/// The scene rendering buffers container.
/// </summary>
@@ -39,6 +36,7 @@ protected:
int32 _width = 0;
int32 _height = 0;
float _aspectRatio = 0.0f;
bool _useAlpha = false;
Viewport _viewport;
Array<GPUTexture*, FixedAllocation<32>> _resources;
@@ -153,6 +151,21 @@ public:
return _viewport;
}
/// <summary>
/// Gets the output buffers format (R11G11B10 or R16G16B16A16 depending on UseAlpha property).
/// </summary>
API_PROPERTY() PixelFormat GetOutputFormat() const;
/// <summary>
/// True if support alpha output in the rendering buffers and pass-though alpha mask of the scene during rendering (at cost of reduced performance).
/// </summary>
API_PROPERTY() bool GetUseAlpha() const;
/// <summary>
/// True if support alpha output in the rendering buffers and pass-though alpha mask of the scene during rendering (at cost of reduced performance).
/// </summary>
API_PROPERTY() void SetUseAlpha(bool value);
const CustomBuffer* FindCustomBuffer(const StringView& name) const;
template<class T>