4#ifndef GREM_GRAPHICS_3D_RENDERER_3D_HPP
5#define GREM_GRAPHICS_3D_RENDERER_3D_HPP
387 template <
typename... ExtraBuffers>
392 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles, {});
416 template <
typename... ExtraBuffers>
421 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles, {.unordered =
true});
445 template <
typename... ExtraBuffers>
447 const ExtraBuffers&... extraBuffers) {
449 sky.
sky->flush(*
this);
454 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
483 template <
typename... ExtraBuffers>
485 const ExtraBuffers&... extraBuffers) {
487 sky.
sky->flush(*
this);
492 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
522 template <
typename... ExtraBuffers>
524 const ExtraBuffers&... extraBuffers) {
526 sky.
sky->flush(*
this);
531 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
562 template <
typename... ExtraBuffers>
564 const ExtraBuffers&... extraBuffers) {
566 sky.
sky->flush(*
this);
571 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
604 template <
typename... ExtraBuffers>
614 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
620 environmentBuffers.setBuffers(
nullptr);
648 template <
typename... ExtraBuffers>
651 const ExtraBuffers&... extraBuffers) {
659 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
666 environmentBuffers.setBuffers(
nullptr);
693 template <
typename... ExtraBuffers>
696 const ExtraBuffers&... extraBuffers) {
704 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
711 environmentBuffers.setBuffers(
nullptr);
739 template <
typename... ExtraBuffers>
742 const ExtraBuffers&... extraBuffers) {
750 drawFrameImplementation(renderPass, instanceBatches, camera, extraBufferHandles,
758 environmentBuffers.setBuffers(
nullptr);
763 return renderer2D.getInvisibleTexture2D();
768 return renderer2D.getInvisibleTexture2DArray();
773 return renderer2D.getInvisibleTextureCube();
778 return renderer2D.getInvisibleTextureCubeArray();
783 return renderer2D.getWhiteTexture2D();
788 return renderer2D.getWhiteTextureCube();
793 return renderer2D.getFlatNormalTexture2D();
798 return renderer2D.getDefaultDepthTexture2D();
803 return renderer2D.getDefaultDepthTexture2DArray();
808 return renderer2D.getDefaultDepthTextureCube();
813 return renderer2D.getDefaultDepthTextureCubeArray();
818 return renderer2D.getDefaultModel2DVertexShader();
823 return renderer2D.getPlainModel2DFragmentShader();
828 return renderer2D.getPlainModel2DShaderPipeline();
833 return renderer2D.getTextModel2DFragmentShader();
838 return renderer2D.getTextModel2DShaderPipeline();
843 return renderer2D.getTonemappingModel2DFragmentShader();
848 return renderer2D.getTonemappingModel2DShaderPipeline();
853 return renderer2D.getUnitSquareModel2D();
858 return renderer2D.getUnitRightAngledTriangleModel2D();
867 return model3DDataBuffers;
887 if (inverseBindPoseMatrices.
empty()) {
892 throw std::bad_alloc{};
895 [[maybe_unused]]
const auto [it, inserted] = model3DInverseBindPoseMatrixRangeReferenceCounts.emplace(allocation->begin,
size_t{1});
915 const auto it = model3DInverseBindPoseMatrixRangeReferenceCounts.find(allocation.begin);
916 GREM_ASSERT(it != model3DInverseBindPoseMatrixRangeReferenceCounts.end());
931 if (allocation.begin == allocation.end) {
934 const auto it = model3DInverseBindPoseMatrixRangeReferenceCounts.find(allocation.begin);
935 GREM_ASSERT(it != model3DInverseBindPoseMatrixRangeReferenceCounts.end());
936 if (it->second-- == 1) {
937 model3DInverseBindPoseMatrixRangeAllocator.deallocateRange(allocation);
938 model3DInverseBindPoseMatrixRangeReferenceCounts.erase(it);
959 if (morphTargetValues.
empty()) {
964 throw std::bad_alloc{};
967 [[maybe_unused]]
const auto [it, inserted] = model3DMorphTargetValueRangeReferenceCounts.emplace(allocation->begin,
size_t{1});
987 const auto it = model3DMorphTargetValueRangeReferenceCounts.find(allocation.begin);
988 GREM_ASSERT(it != model3DMorphTargetValueRangeReferenceCounts.end());
1003 if (allocation.begin == allocation.end) {
1006 const auto it = model3DMorphTargetValueRangeReferenceCounts.find(allocation.begin);
1007 GREM_ASSERT(it != model3DMorphTargetValueRangeReferenceCounts.end());
1008 if (it->second-- == 1) {
1009 model3DMorphTargetValueRangeAllocator.deallocateRange(allocation);
1010 model3DMorphTargetValueRangeReferenceCounts.erase(it);
1055 if (!plain3DTransformedModel2DShaderPipeline) {
1065 return *plain3DTransformedModel2DShaderPipeline;
1093 if (!plain3DTransformedTextShaderPipeline) {
1103 return *plain3DTransformedTextShaderPipeline;
1146 if (!unlitModel3DShaderPipelineSet) {
1151 return *unlitModel3DShaderPipelineSet;
1169 if (!hdrUnlitModel3DShaderPipelineSet) {
1171 hdrUnlitModel3DShaderPipelineSet.emplace(
1180 return *hdrUnlitModel3DShaderPipelineSet;
1197 if (!wireframeModel3DShaderPipelineSet) {
1207 return *wireframeModel3DShaderPipelineSet;
1226 if (!hdrWireframeModel3DShaderPipelineSet) {
1228 hdrWireframeModel3DShaderPipelineSet.emplace(
1242 return *hdrWireframeModel3DShaderPipelineSet;
1271 switch (shaderConfiguration.materialType) {
1293 if (!pbrModel3DShaderPipelineSet) {
1298 return *pbrModel3DShaderPipelineSet;
1317 if (!hdrPBRModel3DShaderPipelineSet) {
1319 hdrPBRModel3DShaderPipelineSet.emplace(
1328 return *hdrPBRModel3DShaderPipelineSet;
1401 if (!unlitSky3DShaderPipeline) {
1406 return *unlitSky3DShaderPipeline;
1421 if (!hdrUnlitSky3DShaderPipeline) {
1426 return *hdrUnlitSky3DShaderPipeline;
1454 if (!pbrSky3DShaderPipeline) {
1459 return *pbrSky3DShaderPipeline;
1474 if (!hdrPBRSky3DShaderPipeline) {
1479 return *hdrPBRSky3DShaderPipeline;
1514 if (!specularSplitSumBRDFIntegrationMap) {
1515 specularSplitSumBRDFIntegrationMap = generateSpecularSplitSumBRDFIntegrationMap(device, renderer2D, options.specularSplitSumBRDFIntegrationMapResolution,
1516 options.specularSplitSumBRDFIntegrationMapSampleCount);
1518 return specularSplitSumBRDFIntegrationMap;
1546 GREM_API(graphics_3d)
1575 renderShadowMap(lights, lightID, totalShadowCasterBoundingBox, observerCamera.getProjectionMatrix(), observerCamera.getViewMatrix(), drawShadowCasters);
1598 GREM_API(graphics_3d)
1622 renderAllShadowMaps(lights, totalShadowCasterBoundingBox, observerCamera.getProjectionMatrix(), observerCamera.getViewMatrix(), drawShadowCasters);
1689 GREM_API(graphics_3d)
1719 renderViewDependentShadowMap(lights, lightID, totalShadowCasterBoundingBox, observerCamera.getProjectionMatrix(), observerCamera.getViewMatrix(), drawShadowCasters);
1742 GREM_API(graphics_3d)
1766 renderAllViewDependentShadowMaps(lights, totalShadowCasterBoundingBox, observerCamera.getProjectionMatrix(), observerCamera.getViewMatrix(), drawShadowCasters);
1790 GREM_API(graphics_3d)
1811 GREM_API(graphics_3d)
1832 GREM_API(graphics_3d)
1838 friend Bootstrapper;
1840 struct SpecularSplitSumBRDFIntegrationMapFragmentShaderConstants {
1841 uint32_t SPECULAR_SPLIT_SUM_BRDF_INTEGRATION_MAP_SAMPLE_COUNT;
1844 using SpecularSplitSumBRDFIntegrationMapFragmentShader =
1847 struct FrameOptions {
1851 bool unordered =
false;
1852 bool drawSky =
false;
1855 struct TransparentDrawCommandReference {
1857 uint16_t instanceBatchIndex;
1858 uint32_t drawCommandIndex;
1861 GREM_API(graphics_3d)
static const Array<vec3, 8> CUBE_MODEL_3D_VERTEX_POSITIONS;
1862 GREM_API(graphics_3d)
static const Array<uint32_t, 36> CUBE_MODEL_3D_INDICES;
1864 [[nodiscard]] GREM_API(graphics_3d)
static Texture
1865 generateSpecularSplitSumBRDFIntegrationMap(Device& device, Renderer2D& renderer2D, uint32_t resolution, uint32_t sampleCount);
1867 template <
typename... Buffers>
1868 void setTemporaryCombinedBufferHandles(
Span<
const Pair<BufferLayoutReference, SharedPointer<void>>> extraBufferHandles,
const Buffers&... buffers) {
1869 temporaryCombinedBufferHandles.clear();
1870 (temporaryCombinedBufferHandles.push_back(
Pair<BufferLayoutReference, SharedPointer<void>>{Buffers::LAYOUT_REFERENCE, buffers.lock()}), ...);
1871 for (
const Pair<BufferLayoutReference, SharedPointer<void>>& extraBufferHandle : extraBufferHandles) {
1872 temporaryCombinedBufferHandles.push_back(extraBufferHandle);
1877 GREM_API(graphics_3d)
1879 Span<
const Pair<BufferLayoutReference, SharedPointer<void>>> extraBufferHandles, FrameOptions frameOptions);
1881 GREM_API(graphics_3d)
1882 void flushPBRBuffers(
Extent2D framebufferSize,
const Viewport& viewport,
const Camera3D& camera,
const Fog3D& fog,
const Sky3D& sky,
const Decals3D& decals,
1883 const Lights3D& lights,
const LightProbeVolumes3D& lightProbeVolumes,
const ReflectionProbes3D& reflectionProbes);
1886 Renderer2D& renderer2D;
1887 Renderer3DOptions options;
1889 RangeAllocator<uint32_t> model3DInverseBindPoseMatrixRangeAllocator{};
1890 HashMap<uint32_t, size_t> model3DInverseBindPoseMatrixRangeReferenceCounts{};
1891 RangeAllocator<uint32_t> model3DMorphTargetValueRangeAllocator{};
1892 HashMap<uint32_t, size_t> model3DMorphTargetValueRangeReferenceCounts{};
1893 Optional<Model2DTransformed3DVertexShader> default3DTransformedModel2DVertexShader{};
1894 Optional<Model2DTransformed3DFragmentShader> plain3DTransformedModel2DFragmentShader{};
1895 Optional<ShaderPipeline<Model2D::Mesh>> plain3DTransformedModel2DShaderPipeline{};
1896 Optional<Model2DTransformed3DFragmentShader> raw3DTransformedModel2DFragmentShader{};
1897 Optional<ShaderPipeline<Model2D::Mesh>> raw3DTransformedModel2DShaderPipeline{};
1898 Optional<Model2DTransformed3DFragmentShader> plain3DTransformedTextFragmentShader{};
1899 Optional<ShaderPipeline<Model2D::Mesh>> plain3DTransformedTextShaderPipeline{};
1900 Optional<Model2DTransformed3DFragmentShader> raw3DTransformedTextFragmentShader{};
1901 Optional<ShaderPipeline<Model2D::Mesh>> raw3DTransformedTextShaderPipeline{};
1902 Optional<DefaultModel3DVertexShader> defaultModel3DVertexShader{};
1903 Optional<UnlitModel3DFragmentShader> unlitModel3DFragmentShader{};
1904 Optional<UnlitModel3DShaderPipelineSet> unlitModel3DShaderPipelineSet{};
1905 Optional<UnlitModel3DShaderPipelineSet> hdrUnlitModel3DShaderPipelineSet{};
1906 Optional<UnlitModel3DShaderPipelineSet> wireframeModel3DShaderPipelineSet{};
1907 Optional<UnlitModel3DShaderPipelineSet> hdrWireframeModel3DShaderPipelineSet{};
1908 Optional<PBRModel3DFragmentShader> pbrModel3DFragmentShader{};
1909 Optional<PBRModel3DShaderPipelineSet> pbrModel3DShaderPipelineSet{};
1910 Optional<PBRModel3DShaderPipelineSet> hdrPBRModel3DShaderPipelineSet{};
1911 Optional<ShadowMapModel3DShaderPipelineSet> shadowMapModel3DShaderPipelineSet{};
1912 Optional<DistanceModel3DShaderPipelineSet> distanceModel3DShaderPipelineSet{};
1913 Optional<DefaultSky3DVertexShader> defaultSky3DVertexShader{};
1914 Optional<UnlitSky3DFragmentShader> unlitSky3DFragmentShader{};
1915 Optional<Sky3D::ShaderPipeline> unlitSky3DShaderPipeline{};
1916 Optional<Sky3D::ShaderPipeline> hdrUnlitSky3DShaderPipeline{};
1917 Optional<PBRSky3DFragmentShader> pbrSky3DFragmentShader{};
1918 Optional<Sky3D::ShaderPipeline> pbrSky3DShaderPipeline{};
1919 Optional<Sky3D::ShaderPipeline> hdrPBRSky3DShaderPipeline{};
1920 Model3D cubeModel3D{device, *
this, resource::Model{CUBE_MODEL_3D_VERTEX_POSITIONS, CUBE_MODEL_3D_INDICES}};
1921 Cubemap3D cubemap3D{device};
1922 Texture specularSplitSumBRDFIntegrationMap{};
1923 Text2D temporaryText{};
1924 resource::Model::Transformation temporaryModelTransformation{};
1925 Camera3D shadowMapCamera3D{device};
1926 ArrayList<Pair<BufferLayoutReference, SharedPointer<void>>> temporaryCombinedBufferHandles{};
1929 DrawCommandBuffer<Model3D::Mesh> transparentDrawCommandBuffer3D{device};
1930 DrawCommandBuffer<Model2D::Mesh> transparentDrawCommandBuffer2D{device};
1931 Buffer<TransparentDrawCommandReference> combined2DAnd3DTransparentDrawCommands{};
1932 Optional<DrawCommandBuffer<Cubemap3D::Mesh>> skyDrawCommandBuffer{};
1936 Arena<0> flushPBRBuffersArena{147456};
1937 bool pbrParameterBufferDirty =
true;
#define GREM_ASSERT(expression)
Definition assertions.hpp:77
Definition FunctionView.hpp:29
Optional value type that holds either a value or no value.
Definition Optional.hpp:58
Definition SharedPointer.hpp:65
constexpr bool empty() const noexcept
Definition Span.hpp:257
constexpr size_type size() const noexcept
Definition Span.hpp:207
Definition StridedSpan.hpp:427
Collection of GPU memory buffers to be read by a shader.
Definition buffers.hpp:580
static constexpr BufferLayoutReference LAYOUT_REFERENCE
Definition buffers.hpp:586
Combined view-projection matrix, defining a 3D perspective to render from.
Definition Camera3D.hpp:173
UniformBuffer< Parameters, "Camera3DParameters"> ParameterBuffer
Shader buffer for 3D camera parameters.
Definition Camera3D.hpp:191
Container for a cubemap mesh stored on the GPU.
Definition Cubemap3D.hpp:22
Set of decals in 3D space.
Definition Decals3D.hpp:255
UniformBuffer< Parameters, "Decals3DParameters"> ParameterBuffer
Shader buffer for decal parameters.
Definition Decals3D.hpp:264
Persistent system managing the rendering context of a Window.
Definition Device.hpp:68
Distance-based fog in 3D space.
Definition Fog3D.hpp:85
UniformBuffer< Parameters, "Fog3DParameters"> ParameterBuffer
Shader buffer for fog parameters.
Definition Fog3D.hpp:115
Compiled GPU fragment shader stage.
Definition shaders.hpp:1274
Set of light probe volumes in 3D space.
Definition LightProbeVolumes3D.hpp:89
UniformBuffer< AtlasParameters, "LightProbeVolumes3DAtlases"> AtlasBuffer
Shader buffer for light probe volume atlases.
Definition LightProbeVolumes3D.hpp:105
StorageBuffer< VolumeFields, "LightProbeVolumes3DVolumes"> VolumeBuffer
Shader buffer for light probe volumes.
Definition LightProbeVolumes3D.hpp:139
Set of direct light sources in 3D space.
Definition Lights3D.hpp:363
StorageBuffer< ShadowMatrixFields, "Lights3DShadowMatrices"> ShadowMatrixBuffer
Shader buffer for shadow matrices.
Definition Lights3D.hpp:390
UniformBuffer< Parameters, "Lights3DParameters"> ParameterBuffer
Shader buffer for light parameters.
Definition Lights3D.hpp:381
Container for a set of 2D triangle strip meshes stored on the GPU.
Definition Model2D.hpp:30
UniformBuffer< TextureParameters, "Model2DTexture"> TextureBuffer
Shader buffer for 2D model texture parameters.
Definition Model2D.hpp:97
graphics::Mesh< Vertex, NoIndex, NoParameters, Instance > Mesh
Type of a single mesh of a 2D model.
Definition Model2D.hpp:59
static constexpr FragmentShaderConstants DEFAULT_FRAGMENT_SHADER_CONSTANTS
Default 2D model fragment shader constants.
Definition Model2D.hpp:176
static constexpr VertexShaderConstants DEFAULT_VERTEX_SHADER_CONSTANTS
Default 2D model vertex shader constants.
Definition Model2D.hpp:171
graphics::FragmentShader< Mesh, Inputs, Constants, Outputs, Camera2D::ParameterBuffer, ExtraBuffers..., TextureBuffer > FragmentShaderBase
Fragment shader for drawing 2D models.
Definition Model2D.hpp:142
UniformBuffer< Transformation3DParameters, "Model2DTransformation3D"> Transformation3DBuffer
Shader buffer for 2D model 3D transformation parameters.
Definition Model2D.hpp:109
graphics::ShaderPipeline< Mesh > ShaderPipeline
Shader pipeline for drawing 2D models.
Definition Model2D.hpp:152
Shader pipeline set for drawing 3D models.
Definition Model3D.hpp:496
Container for a set of 3D triangle mesh nodes stored on the GPU.
Definition Model3D.hpp:67
@ UNLIT
The shader should use only the base color at full brightness.
Definition Model3D.hpp:75
@ METALLIC_ROUGHNESS
The shader should interpret the material according to the standard metallic-roughness model.
Definition Model3D.hpp:74
static constexpr auto DEFAULT_SHADER_PIPELINE_OPTIONS
Default 3D model graphics pipeline configuration.
Definition Model3D.hpp:668
ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList<>, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList<> > ShaderPipelineSet
Default shader pipeline set for drawing 3D models.
Definition Model3D.hpp:597
BufferSet< InverseBindPoseMatrixBuffer, MorphTargetValueBuffer > DataBuffers
Set of shader buffers related to the static data of 3D models.
Definition Model3D.hpp:325
StorageBuffer< InverseBindPoseMatrixFields, "Model3DInverseBindPoseMatrices"> InverseBindPoseMatrixBuffer
Shader buffer for 3D model inverse bind-pose matrices.
Definition Model3D.hpp:307
VertexShaderBase< VertexShaderConstants, VertexShaderOutputs > VertexShader
Default vertex shader for drawing 3D models.
Definition Model3D.hpp:373
static constexpr auto DEFAULT_FRAGMENT_SHADER_CONSTANTS
Default 3D model fragment shader constants.
Definition Model3D.hpp:646
FragmentShaderBase< VertexShaderOutputs, FragmentShaderConstants, FragmentShaderOutputs > FragmentShader
Default fragment shader type for drawing 3D models.
Definition Model3D.hpp:393
static constexpr auto DEFAULT_VERTEX_SHADER_CONSTANTS
Default 3D model vertex shader constants.
Definition Model3D.hpp:628
StorageBuffer< MorphTargetValueFields, "Model3DMorphTargetValues"> MorphTargetValueBuffer
Shader buffer for 3D model morph target values.
Definition Model3D.hpp:320
graphics::FragmentShader< Mesh, Inputs, Constants, Outputs, Camera3D::ParameterBuffer, DataBuffers, InstanceBuffers, ExtraBuffers... > FragmentShaderBase
Fragment shader for drawing 3D models.
Definition Model3D.hpp:388
Set of reflection probes in 3D space.
Definition ReflectionProbes3D.hpp:106
UniformBuffer< AtlasParameters, "ReflectionProbes3DAtlases"> AtlasBuffer
Shader buffer for reflection probe atlases.
Definition ReflectionProbes3D.hpp:125
StorageBuffer< ProbeFields, "LightProbeVolumes3DProbes"> ProbeBuffer
Shader buffer for reflection probes.
Definition ReflectionProbes3D.hpp:159
Backend-specific implementation of RenderPass.
Definition RenderPass.hpp:38
Extent2D getFramebufferSize()
Get the size of the framebuffer that the render pass will be rendering through.
const Viewport & getViewport()
Get the viewport that will be used for subsequently recorded draw commands.
Persistent system that provides 2D rendering capabilities.
Definition Renderer2D.hpp:46
Model2D::FragmentShader TonemappingModel2DFragmentShader
Default fragment shader type for tonemapping.
Definition Renderer2D.hpp:58
Model2D::FragmentShader PlainModel2DFragmentShader
Default fragment shader type for drawing plain 2D models.
Definition Renderer2D.hpp:52
Model2D::VertexShader DefaultModel2DVertexShader
Default vertex shader type for drawing 2D models.
Definition Renderer2D.hpp:49
Model2D::FragmentShader TextModel2DFragmentShader
Default fragment shader type for drawing text.
Definition Renderer2D.hpp:55
graphics::VertexShader< Model2D::Mesh, Model2D::VertexShaderConstants, Model2D::VertexShaderOutputs, Camera3D::ParameterBuffer, Model2D::Transformation3DBuffer > Model2DTransformed3DVertexShader
Default vertex shader for drawing 2D models with a 3D transformation.
Definition Renderer3D.hpp:123
const Sky3D::ShaderPipeline & getHDRPBRSky3DShaderPipeline()
Get the default non-tonemapped PBR skybox shader pipeline.
Definition Renderer3D.hpp:1473
void drawUnlitFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass, without any environment bu...
Definition Renderer3D.hpp:388
Renderer3D(Device &device, Renderer2D &renderer2D, const Renderer3DOptions &options={})
Construct a 3D renderer.
void reacquireModel3DInverseBindPoseMatrices(RangeAllocation< uint32_t > allocation) noexcept
Increment the reference count of an allocated range of 3D model inverse bind-pose matrices.
Definition Renderer3D.hpp:914
void renderViewDependentShadowMap(Lights3D &lights, LightID lightID, const Box< 3, float > &totalShadowCasterBoundingBox, const mat4 &observerProjectionMatrix, const mat4 &observerViewMatrix, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow map of a specific shadow mapped view- dependent light source in a s...
const Model3D::DataBuffers & getModel3DDataBuffers()
Get the set of 3D model data buffers.
Definition Renderer3D.hpp:866
const Texture & getFlatNormalTexture2D()
Get the default flat normal map 2D texture.
Definition Renderer3D.hpp:792
StorageBuffer< ScreenLightFields, "Renderer3DScreenLights"> ScreenLightBuffer
Shader buffer for on-screen lights.
Definition Renderer3D.hpp:194
Model3D::FragmentShaderBase< Model3D::VertexShaderOutputs, Model3D::FragmentShaderConstants, Model3D::FragmentShaderOutputs, EnvironmentBuffers, ScreenBuffers > PBRModel3DFragmentShader
Default fragment shader type for drawing 3D models using PBR.
Definition Renderer3D.hpp:301
void drawPBRFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const Fog3D &fog, Sky3DView sky, const Decals3D &decals, const Lights3D &lights, const LightProbeVolumes3D &lightProbeVolumes, const ReflectionProbes3D &reflectionProbes, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass.
Definition Renderer3D.hpp:605
const Texture & getInvisibleTexture2D()
Get the default invisible 2D texture.
Definition Renderer3D.hpp:762
Model3D::ShaderPipelineSet UnlitModel3DShaderPipelineSet
Default shader pipeline set for drawing 3D models at full brightness without any lighting.
Definition Renderer3D.hpp:298
const Texture & getWhiteTexture2D()
Get the default white 2D texture.
Definition Renderer3D.hpp:782
void drawPBRUnorderedFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const Fog3D &fog, Sky3DView sky, const Decals3D &decals, const Lights3D &lights, const LightProbeVolumes3D &lightProbeVolumes, const ReflectionProbes3D &reflectionProbes, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass, without sorting alpha-blen...
Definition Renderer3D.hpp:649
VertexShader< Sky3D::Mesh, Sky3D::VertexShaderConstants, Sky3D::VertexShaderOutputs, Camera3D::ParameterBuffer > DefaultSky3DVertexShader
Default vertex shader for drawing skyboxes.
Definition Renderer3D.hpp:309
const Texture & getDefaultDepthTextureCubeArray()
Get the default cube array depth texture.
Definition Renderer3D.hpp:812
const Model2DTransformed3DVertexShader & getDefault3DTransformedModel2DVertexShader()
Get the default 2D-model-in-3D vertex shader.
const Model2D::ShaderPipeline & getTonemappingModel2DShaderPipeline()
Get the default tonemapping shader pipeline.
Definition Renderer3D.hpp:847
Renderer3D(Renderer3D &&)=delete
Moving a renderer is not allowed.
graphics::FragmentShader< Model2D::Mesh, Model2D::VertexShaderOutputs, Model2D::FragmentShaderConstants, Model2D::FragmentShaderOutputs, Camera3D::ParameterBuffer, Model2D::Transformation3DBuffer, Model2D::TextureBuffer > Model2DTransformed3DFragmentShader
Default fragment shader for drawing 2D models with a 3D transformation.
Definition Renderer3D.hpp:127
const Texture & getInvisibleTexture2DArray()
Get the default invisible 2D array texture.
Definition Renderer3D.hpp:767
BufferSet< ScreenTileBuffer, ScreenDepthBinBuffer, ScreenItemBuffer, ScreenDecalBuffer, ScreenLightBuffer, ScreenParameterBuffer > ScreenBuffers
Set of shader buffers related to the screen.
Definition Renderer3D.hpp:289
StorageBuffer< ScreenItemFields, "Renderer3DScreenItems"> ScreenItemBuffer
Shader buffer for screen items.
Definition Renderer3D.hpp:249
Renderer3D & operator=(Renderer3D &&)=delete
Moving a renderer is not allowed.
UniformBuffer< PBRParameters, "Renderer3DPBRParameters"> PBRParameterBuffer
Shader buffer for PBR rendering parameters.
Definition Renderer3D.hpp:137
void releaseModel3DInverseBindPoseMatrices(RangeAllocation< uint32_t > allocation) noexcept
Decrement the reference count of an allocated range of 3D model inverse bind-pose matrices,...
Definition Renderer3D.hpp:930
UnlitModel3DShaderPipelineSet & getUnlitModel3DShaderPipelineSet()
Get the default unlit 3D model shader pipeline set, which renders models' base color at full brightne...
Definition Renderer3D.hpp:1145
StorageBuffer< ScreenDecalFields, "Renderer3DScreenDecals"> ScreenDecalBuffer
Shader buffer for on-screen decals.
Definition Renderer3D.hpp:173
void drawHDRUnlitFrameWithSky(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, Sky3DView sky, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches and a 3D sky to a render pass,...
Definition Renderer3D.hpp:523
const Sky3D::ShaderPipeline & getHDRUnlitSky3DShaderPipeline()
Get the default non-tonemapped unlit skybox shader pipeline.
Definition Renderer3D.hpp:1420
const Renderer2D::TextModel2DFragmentShader & getTextModel2DFragmentShader()
Get the default text fragment shader.
Definition Renderer3D.hpp:832
Model3D::ShaderPipelineSetBase< Model3D::VertexShaderConstants, Model3D::VertexShaderOutputs, meta::TypeList<>, Model3D::FragmentShaderConstants, ShadowMapFragmentShaderOutputs, meta::TypeList<> > ShadowMapModel3DShaderPipelineSet
Shader pipeline set for drawing 3D models to shadow maps.
Definition Renderer3D.hpp:326
const Texture & getDefaultDepthTextureCube()
Get the default cube depth texture.
Definition Renderer3D.hpp:807
ShadowMapModel3DShaderPipelineSet & getShadowMapModel3DShaderPipelineSet()
Get the default shadow map 3D model shader pipeline set, which renders models to the depth buffer,...
const Sky3D::ShaderPipeline & getUnlitSky3DShaderPipeline()
Get the default unlit skybox shader pipeline.
Definition Renderer3D.hpp:1400
void renderAllViewDependentShadowMaps(Lights3D &lights, const Box< 3, float > &totalShadowCasterBoundingBox, const mat4 &observerProjectionMatrix, const mat4 &observerViewMatrix, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Render the shadow maps of all shadow mapped view-dependent light sources in a set of lights with resp...
const Texture & getDefaultDepthTexture2D()
Get the default 2D depth texture.
Definition Renderer3D.hpp:797
void drawHDRPBRUnorderedFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const Fog3D &fog, Sky3DView sky, const Decals3D &decals, const Lights3D &lights, const LightProbeVolumes3D &lightProbeVolumes, const ReflectionProbes3D &reflectionProbes, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass, without sorting alpha-blen...
Definition Renderer3D.hpp:740
const Model2D::ShaderPipeline & getTextModel2DShaderPipeline()
Get the default text shader pipeline.
Definition Renderer3D.hpp:837
const Renderer2D::DefaultModel2DVertexShader & getDefaultModel2DVertexShader()
Get the default 2D model vertex shader.
Definition Renderer3D.hpp:817
void drawUnlitUnorderedFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass, without any environment bu...
Definition Renderer3D.hpp:417
const DefaultModel3DVertexShader & getDefaultModel3DVertexShader()
Get the default 3D model vertex shader.
const Texture & getWhiteTextureCube()
Get the default white cubemap texture.
Definition Renderer3D.hpp:787
void renderAllShadowMaps(Lights3D &lights, const Box< 3, float > &totalShadowCasterBoundingBox, const mat4 &observerProjectionMatrix, const mat4 &observerViewMatrix, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Render the shadow maps of shadow mapped light sources in a set of lights with respect to a future obs...
const Texture & getDefaultDepthTexture2DArray()
Get the default 2D array depth texture.
Definition Renderer3D.hpp:802
UniformBuffer< ScreenParameters, "Renderer3DScreenParameters"> ScreenParameterBuffer
Shader buffer for screen parameters.
Definition Renderer3D.hpp:282
UnlitModel3DShaderPipelineSet & getHDRUnlitModel3DShaderPipelineSet()
Get the default non-tonemapped unlit 3D model shader pipeline set, intended for high-dynamic-range re...
Definition Renderer3D.hpp:1168
const Model2D::ShaderPipeline & getPlainModel2DShaderPipeline()
Get the default plain 2D model shader pipeline.
Definition Renderer3D.hpp:827
RangeAllocation< uint32_t > uploadModel3DMorphTargetValues(Span< const Model3D::MorphTargetValueFields > morphTargetValues)
Allocate a range of morph targets and upload their values to the 3D model morph target value buffer.
Definition Renderer3D.hpp:958
UniformBuffer< ScreenTileParameters, "Renderer3DScreenTiles"> ScreenTileBuffer
Shader buffer for screen tiles.
Definition Renderer3D.hpp:219
void renderShadowMap(Lights3D &lights, LightID lightID, const Box< 3, float > &totalShadowCasterBoundingBox, const mat4 &observerProjectionMatrix, const mat4 &observerViewMatrix, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Render the shadow map of a specific shadow mapped light source in a set of lights with respect to a f...
Model3D::ShaderPipelineSetBase< Model3D::VertexShaderConstants, Model3D::VertexShaderOutputs, meta::TypeList<>, Model3D::FragmentShaderConstants, Model3D::FragmentShaderOutputs, meta::TypeList< EnvironmentBuffers, ScreenBuffers > > PBRModel3DShaderPipelineSet
Default shader pipeline set for drawing 3D models using PBR.
Definition Renderer3D.hpp:305
void renderViewIndependentShadowMap(Lights3D &lights, LightID lightID, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow map of a specific shadow mapped view- independent light source in a...
const Model3D & getCubeModel3D() const noexcept
Get the default 3D cube model.
Definition Renderer3D.hpp:1487
const Texture & getInvisibleTextureCube()
Get the default invisible cube texture.
Definition Renderer3D.hpp:772
Renderer3D(const Renderer3D &)=delete
Copying a renderer is not allowed.
UnlitModel3DShaderPipelineSet & getHDRWireframeModel3DShaderPipelineSet()
Get the default non-tonemapped wireframe 3D model shader pipeline set, intended for high-dynamic-rang...
Definition Renderer3D.hpp:1225
const UnlitSky3DFragmentShader & getUnlitSky3DFragmentShader()
Get the default unlit skybox fragment shader.
const Model2DTransformed3DFragmentShader & getPlain3DTransformedModel2DFragmentShader()
Get the default plain 2D-model-in-3D fragment shader.
void drawHDRUnlitUnorderedFrameWithSky(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, Sky3DView sky, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches and a 3D sky to a render pass,...
Definition Renderer3D.hpp:563
void renderViewDependentShadowMapForFullZoomedOutView(Lights3D &lights, LightID lightID, const Box< 3, float > &totalShadowCasterBoundingBox, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow map of a specific shadow mapped view- dependent light source in a s...
UnlitModel3DShaderPipelineSet & getWireframeModel3DShaderPipelineSet()
Get the default wireframe 3D model shader pipeline set, which renders the wireframe of models in thei...
Definition Renderer3D.hpp:1196
void renderAllViewDependentShadowMapsForFullZoomedOutView(Lights3D &lights, const Box< 3, float > &totalShadowCasterBoundingBox, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow maps of all shadow mapped view- dependent light sources in a set of...
Model3D::FragmentShaderBase< Model3D::VertexShaderOutputs, Model3D::FragmentShaderConstants, ShadowMapFragmentShaderOutputs > ShadowMapModel3DFragmentShader
Default fragment shader for drawing 3D models to shadow maps.
Definition Renderer3D.hpp:323
void renderAllShadowMapsForFullZoomedOutView(Lights3D &lights, const Box< 3, float > &totalShadowCasterBoundingBox, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow maps of all shadow mapped light sources in a set of lights,...
const Texture & getSpecularSplitSumBRDFIntegrationMap()
Get the default BRDF integration map for split-sum approximation of ambient specular reflections.
Definition Renderer3D.hpp:1513
void drawHDRPBRFrame(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, const Fog3D &fog, Sky3DView sky, const Decals3D &decals, const Lights3D &lights, const LightProbeVolumes3D &lightProbeVolumes, const ReflectionProbes3D &reflectionProbes, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches to a render pass, without tonemapping when d...
Definition Renderer3D.hpp:694
void drawUnlitFrameWithSky(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, Sky3DView sky, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches and a 3D sky to a render pass,...
Definition Renderer3D.hpp:446
Model3D::VertexShader DefaultModel3DVertexShader
Default vertex shader type for drawing 3D models.
Definition Renderer3D.hpp:292
Renderer3D & operator=(const Renderer3D &)=delete
Copying a renderer is not allowed.
void releaseModel3DMorphTargetValues(RangeAllocation< uint32_t > allocation) noexcept
Decrement the reference count of an allocated range of 3D model morph target values,...
Definition Renderer3D.hpp:1002
PBRModel3DShaderPipelineSet & getPBRModel3DShaderPipelineSet()
Get the default PBR 3D model shader pipeline set, which renders models using physically based renderi...
Definition Renderer3D.hpp:1292
FragmentShader< Sky3D::Mesh, Sky3D::VertexShaderOutputs, Sky3D::FragmentShaderConstants, Sky3D::FragmentShaderOutputs, Camera3D::ParameterBuffer, EnvironmentBuffers > PBRSky3DFragmentShader
Default fragment shader for drawing skyboxes using PBR.
Definition Renderer3D.hpp:316
void renderAllViewIndependentShadowMaps(Lights3D &lights, FunctionView< void(RenderPass &, const Camera3D &)> drawShadowCasters)
Unconditionally render the shadow maps of all shadow mapped view-independent light sources in a set o...
RangeAllocation< uint32_t > uploadModel3DInverseBindPoseMatrices(Span< const Model3D::InverseBindPoseMatrixFields > inverseBindPoseMatrices)
Allocate a range of matrices and upload their values to the 3D model inverse bind-pose matrix buffer.
Definition Renderer3D.hpp:886
const Renderer2D::TonemappingModel2DFragmentShader & getTonemappingModel2DFragmentShader()
Get the default tonemapping fragment shader.
Definition Renderer3D.hpp:842
UniformBuffer< ScreenDepthBinParameters, "Renderer3DScreenDepthBins"> ScreenDepthBinBuffer
Shader buffer for screen depth bins.
Definition Renderer3D.hpp:240
PBRModel3DShaderPipelineSet & getHDRPBRModel3DShaderPipelineSet()
Get the default non-tonemapped PBR 3D model shader pipeline set, intended for high-dynamic-range rend...
Definition Renderer3D.hpp:1316
const Renderer2D::PlainModel2DFragmentShader & getPlainModel2DFragmentShader()
Get the default plain 2D model fragment shader.
Definition Renderer3D.hpp:822
const PBRModel3DFragmentShader & getPBRModel3DFragmentShader()
Get the default PBR 3D model fragment shader, which renders models using physically based rendering p...
const Model2D & getUnitSquareModel2D() const noexcept
Get the default 2D unit square model, which holds a single mesh that forms a square using a triangle ...
Definition Renderer3D.hpp:852
Model3D::FragmentShader UnlitModel3DFragmentShader
Default fragment shader type for drawing 3D models at full brightness without any lighting.
Definition Renderer3D.hpp:295
void drawUnlitUnorderedFrameWithSky(RenderPass &renderPass, StridedSpan< const Instances3DView > instanceBatches, const Camera3D &camera, Sky3DView sky, const ExtraBuffers &... extraBuffers)
Push the draw commands of a frame of 3D instance batches and a 3D sky to a render pass,...
Definition Renderer3D.hpp:484
BufferSet< PBRParameterBuffer, Fog3D::ParameterBuffer, Sky3D::ParameterBuffer, Decals3D::ParameterBuffer, Lights3D::ParameterBuffer, Lights3D::ShadowMatrixBuffer, LightProbeVolumes3D::AtlasBuffer, LightProbeVolumes3D::VolumeBuffer, ReflectionProbes3D::AtlasBuffer, ReflectionProbes3D::ProbeBuffer > EnvironmentBuffers
Set of shader buffers related to the environment.
Definition Renderer3D.hpp:285
PBRModel3DShaderPipelineSet::FragmentShaderSelector getPBRModel3DFragmentShaderSelector()
Get the default PBR 3D model fragment shader selector, which renders models using physically based re...
Definition Renderer3D.hpp:1269
const Model2D & getUnitRightAngledTriangleModel2D() const noexcept
Get the default 2D unit right-angled triangle model, which holds a single mesh that forms a single tr...
Definition Renderer3D.hpp:857
DistanceModel3DShaderPipelineSet & getDistanceModel3DShaderPipelineSet()
Get the default distance 3D model shader pipeline set, which renders models' distance from the camera...
const Sky3D::ShaderPipeline & getPBRSky3DShaderPipeline()
Get the default PBR skybox shader pipeline.
Definition Renderer3D.hpp:1453
void reacquireModel3DMorphTargetValues(RangeAllocation< uint32_t > allocation) noexcept
Increment the reference count of an allocated range of 3D model morph target values.
Definition Renderer3D.hpp:986
const UnlitModel3DFragmentShader & getUnlitModel3DFragmentShader()
Get the default unlit 3D model fragment shader, which renders models' base color at full brightness w...
Model3D::FragmentShader DistanceModel3DFragmentShader
Default fragment shader for drawing the distance of 3D models from the camera.
Definition Renderer3D.hpp:330
Model3D::ShaderPipelineSet DistanceModel3DShaderPipelineSet
Shader pipeline set for drawing the distance of 3D models from the camera.
Definition Renderer3D.hpp:333
const ShaderPipeline< Model2D::Mesh > & getPlain3DTransformedTextShaderPipeline()
Get the default plain 3D text shader pipeline.
Definition Renderer3D.hpp:1092
const Model2DTransformed3DFragmentShader & getPlain3DTransformedTextFragmentShader()
Get the default plain 3D text fragment shader.
const Cubemap3D & getCubemap3D() const noexcept
Get the default 3D cubemap.
Definition Renderer3D.hpp:1496
FragmentShader< Sky3D::Mesh, Sky3D::VertexShaderOutputs, Sky3D::FragmentShaderConstants, Sky3D::FragmentShaderOutputs, Camera3D::ParameterBuffer, Sky3D::ParameterBuffer > UnlitSky3DFragmentShader
Default fragment shader for drawing skyboxes without fog.
Definition Renderer3D.hpp:312
const PBRSky3DFragmentShader & getPBRSky3DFragmentShader()
Get the default PBR skybox fragment shader.
const ShaderPipeline< Model2D::Mesh > & getPlain3DTransformedModel2DShaderPipeline()
Get the default plain 2D-model-in-3D shader pipeline.
Definition Renderer3D.hpp:1054
const DefaultSky3DVertexShader & getDefaultSky3DVertexShader()
Get the default skybox vertex shader.
const Texture & getInvisibleTextureCubeArray()
Get the default invisible cube array texture.
Definition Renderer3D.hpp:777
Linked GPU shader pipeline.
Definition shaders.hpp:1508
static constexpr VertexShaderConstants DEFAULT_VERTEX_SHADER_CONSTANTS
Default skybox vertex shader constants.
Definition Sky3D.hpp:134
UniformBuffer< Parameters, "Sky3DParameters"> ParameterBuffer
Shader buffer for sky parameters.
Definition Sky3D.hpp:128
graphics::ShaderPipeline< Mesh > ShaderPipeline
Shader pipeline for drawing skyboxes.
Definition Sky3D.hpp:131
static constexpr ShaderPipelineOptions DEFAULT_SHADER_PIPELINE_OPTIONS
Default skybox graphics pipeline configuration.
Definition Sky3D.hpp:142
GPU memory buffer containing an array of structs to be read by a shader program.
Definition buffers.hpp:493
Storage for multidimensional data, such as 2D images, on the GPU, combined with a sampler configurati...
Definition Texture.hpp:700
Compiled GPU vertex shader stage.
Definition shaders.hpp:1060
Definition buffer_layouts.hpp:20
@ TRIANGLE_STRIP
Each point, except the first two, forms a filled triangle with the previous two points.
Definition shaders.hpp:296
@ LINE
Polygon edges are drawn as single-pixel-wide line segments.
Definition shaders.hpp:306
@ NONE
Ignore facing, don't cull primitives based on their winding order.
Definition shaders.hpp:319
Array(T, Us...) -> Array< T, 1+sizeof...(Us)>
StridedSpan(R &&range) -> StridedSpan< std::remove_reference_t< decltype(*std::data(range))>, DYNAMIC_EXTENT, sizeof(std::remove_reference_t< decltype(*std::data(range))>)>
vec< 4, float > vec4
Definition math.hpp:440
vec< 2, float > vec2
Definition math.hpp:438
constexpr void sortByAscending(random_access_range auto &&range)
Definition algorithms.hpp:514
vec< 3, float > vec3
Definition math.hpp:439
Extent< 2 > Extent2D
Size of a 2D data region.
Definition extents.hpp:31
Span(R &&range) -> Span< std::remove_reference_t< decltype(*std::data(range))> >
Pair(T1, T2) -> Pair< T1, T2 >
vec< 4, uint32_t > u32vec4
Definition math.hpp:420
mat< 4, 4, float > mat4
Definition math.hpp:806
vec< 2, uint32_t > u32vec2
Definition math.hpp:418
Generic axis-aligned box shape with minimum and maximum extents in N-dimensional space.
Definition geometry.hpp:149
Definition RangeAllocator.hpp:35
static const BlendState ALPHA_BLENDING_PREMULTIPLIED
Blend state to use for pre-multiplied alpha blending using the standard "over" operator.
Definition shaders.hpp:391
Opaque handle to a specific light in a Lights3D set.
Definition Lights3D.hpp:32
Struct of default fragment shader constants.
Definition Model2D.hpp:78
Struct of fields output by the default fragment shader.
Definition Model2D.hpp:83
Struct of fields output by the default vertex shader.
Definition Model2D.hpp:69
Struct of default fragment shader constants.
Definition Model3D.hpp:272
bool32_t FRAGMENT_HDR
Definition Model3D.hpp:273
Struct of fields output by the default fragment shader.
Definition Model3D.hpp:292
Configuration options for shading a mesh instance of a 3D model.
Definition Model3D.hpp:81
Configuration options for a Renderer3D.
Definition Renderer3D.hpp:63
constexpr bool operator==(const Renderer3DOptions &other) const noexcept=default
Compare these options to another set of options for equality.
uint32_t tileSize
Width or height of each screen tile, in pixels.
Definition Renderer3D.hpp:69
float shadowMapDepthBiasConstantFactor
Constant depth bias factor to use in the shadow map shader.
Definition Renderer3D.hpp:105
float shadowMapDepthBiasSlopeFactor
Slope-scaled depth bias factor to use in the shadow map shader.
Definition Renderer3D.hpp:100
uint32_t specularSplitSumBRDFIntegrationMapSampleCount
Number of samples to use when generating the bidirectional reflectance distribution function (BRDF) i...
Definition Renderer3D.hpp:95
uint32_t specularSplitSumBRDFIntegrationMapResolution
The width, in texels, of the generated bidirectional reflectance distribution function (BRDF) integra...
Definition Renderer3D.hpp:86
uint32_t depthBinCount
Number of depth bins to use for culling items on the screen along the Z axis.
Definition Renderer3D.hpp:77
Struct of shader parameters for PBR rendering.
Definition Renderer3D.hpp:131
sampler2D pbrSpecularSplitSumBRDFIntegrationMap
Sampler for the bidirectional reflectance distribution function (BRDF) integration map for split-sum ...
Definition Renderer3D.hpp:133
Struct of shader fields representing an on-screen decal.
Definition Renderer3D.hpp:140
mat4 decalMatrix
Combined view-projection matrix of the decal.
Definition Renderer3D.hpp:142
vec4 decalOcclusionRoughnessMetallicFactorAndNormalScale
Occlusion strength (X), roughness factor (Y), metallic factor (Z) and normal scale (W).
Definition Renderer3D.hpp:163
vec4 decalNormalTextureOffsetAndScale
Texture offset (XY) and scale (ZW) of the normal map in the decal atlas texture.
Definition Renderer3D.hpp:151
vec4 decalEmissiveTextureOffsetAndScale
Texture offset (XY) and scale (ZW) of the emissive map in the decal atlas texture.
Definition Renderer3D.hpp:157
vec4 decalBaseColorTextureOffsetAndScale
Texture offset (XY) and scale (ZW) of the base color map in the decal atlas texture.
Definition Renderer3D.hpp:148
vec4 decalDirectionAndRange
Direction vector (XYZ) and range (W) of the decal.
Definition Renderer3D.hpp:145
vec4 decalBaseColorFactor
Base color factor.
Definition Renderer3D.hpp:160
uint32_t decalModelInstanceIdentifier
Model identifier that the decal applies to, or the maximum value to apply to all models.
Definition Renderer3D.hpp:169
vec4 decalOcclusionRoughnessMetallicTextureOffsetAndScale
Texture offset (XY) and scale (ZW) of the occlusion-roughness-metallic map in the decal atlas texture...
Definition Renderer3D.hpp:154
vec3 decalEmissiveFactor
Emissive factor.
Definition Renderer3D.hpp:166
Struct of shader parameters representing the depth bins of the screen.
Definition Renderer3D.hpp:222
static constexpr size_t MAX_DEPTH_BIN_COUNT
Maximum number of depth bins.
Definition Renderer3D.hpp:226
Array< u32vec4, MAX_DEPTH_BIN_COUNT > depthBins
Depth bins, each containing the following data:
Definition Renderer3D.hpp:235
Struct of shader fields representing an item belonging to a screen tile.
Definition Renderer3D.hpp:243
uint32_t itemIndex
Index of the item in its corresponding buffer.
Definition Renderer3D.hpp:245
Struct of shader fields representing an on-screen light source.
Definition Renderer3D.hpp:176
vec4 lightColorAndIntensity
Color (XYZ) and intensity factor (W) of the light.
Definition Renderer3D.hpp:181
vec4 lightConeCosinesAndShadowMapIndexAndShadowMatrixIndex
Cosine of the inner (X) and outer (Y) cone angles, as well as the shadow map index (Z) and shadow mat...
Definition Renderer3D.hpp:187
vec4 lightPositionAndType
Position (XYZ) and type index (W) of the light.
Definition Renderer3D.hpp:184
vec4 lightDirectionAndRange
Direction (XYZ) vector and maximum range (W) of the light.
Definition Renderer3D.hpp:178
vec4 lightShadowNearAndFarPlaneDistancesAndShadowMapNormalOffsetBiasConstantAndSlopeFactors
Distances to the near (X) and far (Y) planes of the light shadow, as well as the constant (Z) and slo...
Definition Renderer3D.hpp:190
Struct of shader parameters representing the current screen.
Definition Renderer3D.hpp:252
uint32_t screenGlobalLightCount
Number of global lights at the beginning of the light buffer.
Definition Renderer3D.hpp:278
float screenInverseTileSize
Inverse of tile size.
Definition Renderer3D.hpp:260
samplerCubeArrayShadow screenPointLightShadowMaps
Sampler for the depth texture array representing the cube shadow maps of point lights.
Definition Renderer3D.hpp:272
u32vec2 screenTileCounts
Tile counts along the X/Y axes.
Definition Renderer3D.hpp:263
sampler2DArrayShadow screenCascadedShadowMaps
Sampler for the depth texture array representing the cascaded 2D shadow maps of sun/directional light...
Definition Renderer3D.hpp:269
vec2 screenViewportOffset
Viewport offset in pixels.
Definition Renderer3D.hpp:254
sampler2DArrayShadow screenSpotLightShadowMaps
Sampler for the depth texture array representing the 2D shadow maps of spot lights.
Definition Renderer3D.hpp:275
uint32_t screenDepthBinCount
Depth bin count along the Z axis.
Definition Renderer3D.hpp:266
float screenFramebufferHeight
Framebuffer height in pixels.
Definition Renderer3D.hpp:257
Struct of shader parameters representing the tiles of the screen.
Definition Renderer3D.hpp:197
Array< u32vec4,(MAX_TILE_COUNT *2)/4 > tileItemOffsetsAndCountsBy4s
Offsets and number of each item belonging to each tile in the item buffer, grouped into 4D vectors to...
Definition Renderer3D.hpp:214
static constexpr size_t MAX_TILE_COUNT
Maximum number of on-screen tiles.
Definition Renderer3D.hpp:201
Struct of fields output by the shadow map fragment shader.
Definition Renderer3D.hpp:320
Configuration of a graphics pipeline.
Definition shaders.hpp:428
PolygonMode polygonMode
How to render polygons.
Definition shaders.hpp:629
FaceCullingMode faceCullingMode
How to treat the facing of primitives while rendering.
Definition shaders.hpp:640
bool skipSkyRendering
If set, the sky will not be directly rendered, but will still contribute to the lighting of other ren...
Definition Sky3D.hpp:277
View over a sky to be drawn in a Renderer3D frame.
Definition Sky3D.hpp:283
const Sky3D * sky
Non-owning read-only pointer to the sky.
Definition Sky3D.hpp:285
Sky3DFilter filter
Filter parameters that determine which parts of the sky to draw.
Definition Sky3D.hpp:291
SharedPointer< ShaderPipelineImplementation > shaderPipelineOverrideHandle
Shader pipeline override to use, or nullptr to not use a shader override.
Definition Sky3D.hpp:288
Struct of default fragment shader constants.
Definition Sky3D.hpp:93
Reference to a sampler2DArrayShadow Texture that may be used as a parameter value type in a shader-re...
Definition ParameterDescription.hpp:155
Reference to a sampler2D Texture that may be used as a parameter value type in a shader-read buffer.
Definition ParameterDescription.hpp:131
Reference to a samplerCubeArrayShadow Texture that may be used as a parameter value type in a shader-...
Definition ParameterDescription.hpp:187