Cogs.Core
RenderListTask.h
1#pragma once
2
3#include "../RenderList.h"
4#include "../Tasks/RenderTask.h"
5#include "../../Components/Core/LightComponent.h"
6
7namespace Cogs
8{
9 namespace Core
10 {
11 struct COGSCORE_DLL_API RenderListTask : public RenderTask
12 {
15
16 void initialize(RenderTaskContext * context) override;
17 void apply(RenderTaskContext * context) override;
18 bool validate(RenderTaskContext * context, size_t expectedInputs, size_t expectedOutputs);
19
20 virtual void applyMaterial(const DrawContext &, const RenderItem &);
21
22 void renderItems(RenderTaskContext * taskContext,
23 RenderTarget * renderTarget,
24 const RenderList * renderList,
25 BucketMask bucketMask,
26 StateChangeFlags stateChangeMask);
27
28 void renderBatched(RenderTaskContext * taskContext,
29 DrawContext & drawContext,
30 const RenderList* renderList,
31 const RenderItems & items,
32 BucketMask bucketMask,
33 StateChangeFlags stateChangeMask,
34 bool batched);
35
36 bool colorClear = false;
37 bool depthClear = false;
38 bool depthWrite = true;
39
40 bool discardColor = false;
41 bool discardDepth = false;
42
43 glm::ivec2 defaultViewportSize;
44
45 size_t permutationIndex = 0;
46 BucketMask bucketMask = BucketMask::All;
47 StateChangeFlags stateChangeMask = StateChangeFlags::ChangeAll;
48 LightingLayers lightingMask = LightingLayers::All;
49 bool viewportFromTarget = false;
50 bool temporalOffsets = false;
51
52 BlendMode blendMode = BlendMode::None;
53 DepthMode depthMode = DepthMode::Default;
54 DepthFunc depthFunc = DepthFunc::Less;
55
56 // Effective object buffer mode for this draw
57 enum ObjectBufferMode {
58 Single,
59 Batched,
60 List
61 } objectBufferMode = ObjectBufferMode::Single;
62
63 private:
64 void setupRenderTarget(RenderTaskContext * context, RenderTarget * renderTarget, const CameraData * viewportData);
65
66 std::string scopeName;
67 size_t lastHash = 0;
68
69 BlendStateHandle blendState = BlendStateHandle::NoHandle;
70 DepthStencilStateHandle depthState = DepthStencilStateHandle::NoHandle;
71 };
72 }
73}
BlendMode
Defines blending modes for rendering.
DepthMode
Defines common depth stencil modes.
DepthFunc
Defines common depth functions.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Contains data describing a Camera instance and its derived data structured such as matrix data and vi...
Definition: CameraSystem.h:67