Cogs.Core
EffectDefinition.h
1#pragma once
2
3#include "Rendering/IEffects.h"
4
5#include "MaterialTypes.h"
6#include "MeshStreamsLayout.h"
7#include "Utilities/Strings.h"
8
9namespace Cogs::Core
10{
12 {
13 enum InterpolationModifiers
14 {
15 NoModifier = 0,
16 LinearModifier = (1 << 0),
17 CentroidModifier = (1 << 1),
18 NointerpolationModifier = (1 << 2),
19 NoperspectiveModifier = (1 << 3),
20 SampleModifier = (1 << 4)
21 } modifiers = NoModifier;
22
23 enum struct SemanticName : uint8_t {
24 None,
25 Position,
26 Normal,
27 Color,
28 Texcoord,
29 Tangent,
30 InstanceVector,
31 InstanceMatrix,
32 FirstSystemValueSemantic,
33 SV_Position = FirstSystemValueSemantic,
34 SV_VertexID,
35 SV_InstanceID,
36 SV_ClipDistance,
37 SV_VFace,
38 SV_IsFrontFace,
39 Count
40 };
41
42 struct {
43 SemanticName name = SemanticName::None;
44 uint8_t slot = 0; // No explicit slot implies slot 0.
45 } semantic;
46
47 // Used
48
49 uint8_t inheritanceLevel = 0;
50
51 static StringView semanticNameString(const SemanticName name);
52 };
53
55 {
56 std::vector<ShaderInterfaceMemberDefinition> members;
57 };
58
60 {
61 std::string key;
62 std::string value;
63 };
64
66 {
67 std::string customSourcePath;
68 std::string loadPath;
69
70 std::string entryPoint;
71
72 std::vector<AttributeDefinition> attributes;
73
74 ShaderInterfaceDefinition shaderInterface;
75 };
76
77 enum EffectDefinitionFlags
78 {
79 None = 0,
80 Custom = 0x0001,
81 };
82
84 {
85 std::string name;
86 MaterialDataType dataType;
87 uint8_t target;
88 };
89
91 {
92 std::vector<EffectOutputMemberDefinition> members;
93 };
94
95
100 {
102 std::string name;
103
106
107 ShaderDefinition vertexShader;
108
109 ShaderDefinition hullShader;
110
111 ShaderDefinition domainShader;
112
113 ShaderDefinition geometryShader;
114
115 ShaderDefinition pixelShader;
116
117 ShaderDefinition computeShader;
118
122 std::vector<std::string> dependencies;
123
126
127 EffectDefinitionFlags flags = EffectDefinitionFlags::None;
128
129 };
130}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
@ Normal
Regular shaded rendering.
MaterialDataType
Defines available data types for material properties.
Definition: MaterialTypes.h:20
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Definition: IEffects.h:13
Defines a loadable effect.
std::string name
Name of the effect.
std::vector< std::string > dependencies
MeshStreamsLayout streamsLayout
The vertex layout this effect expects.
PreprocessorDefinitions definitions
Preprocessor definitions.