]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/OpenGL/FixedPipelineRenderer.h
cfbb3b662c18c2e6a51597a1f71d2be3d628fd08
[irrlicht.git] / source / Irrlicht / OpenGL / FixedPipelineRenderer.h
1 // Copyright (C) 2023 Vitaliy Lobachevskiy
2 // Copyright (C) 2014 Patryk Nadrowski
3 // This file is part of the "Irrlicht Engine".
4 // For conditions of distribution and use, see copyright notice in Irrlicht.h
5
6 #pragma once
7
8 #include "IShaderConstantSetCallBack.h"
9 #include "IMaterialRendererServices.h"
10
11 namespace irr
12 {
13 namespace video
14 {
15
16 class COpenGL3MaterialBaseCB : public IShaderConstantSetCallBack
17 {
18 public:
19         COpenGL3MaterialBaseCB();
20
21         virtual void OnSetMaterial(const SMaterial& material);
22         virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
23
24 protected:
25         bool FirstUpdateBase;
26
27         s32 WVPMatrixID;
28         s32 WVMatrixID;
29         s32 NMatrixID;
30
31         s32 GlobalAmbientID;
32         s32 MaterialAmbientID;
33         s32 MaterialDiffuseID;
34         s32 MaterialEmissiveID;
35         s32 MaterialSpecularID;
36         s32 MaterialShininessID;
37
38         s32 FogEnableID;
39         s32 FogTypeID;
40         s32 FogColorID;
41         s32 FogStartID;
42         s32 FogEndID;
43         s32 FogDensityID;
44
45         s32 ThicknessID;
46
47         bool LightEnable;
48         SColorf GlobalAmbient;
49         SColorf MaterialAmbient;
50         SColorf MaterialDiffuse;
51         SColorf MaterialEmissive;
52         SColorf MaterialSpecular;
53         f32 MaterialShininess;
54
55         s32 FogEnable;
56         s32 FogType;
57         SColorf FogColor;
58         f32 FogStart;
59         f32 FogEnd;
60         f32 FogDensity;
61
62         f32 Thickness;
63 };
64
65 class COpenGL3MaterialSolidCB : public COpenGL3MaterialBaseCB
66 {
67 public:
68         COpenGL3MaterialSolidCB();
69
70         virtual void OnSetMaterial(const SMaterial& material);
71         virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
72
73 protected:
74         bool FirstUpdate;
75
76         s32 TMatrix0ID;
77         s32 AlphaRefID;
78         s32 TextureUsage0ID;
79         s32 TextureUnit0ID;
80
81         f32 AlphaRef;
82         s32 TextureUsage0;
83         s32 TextureUnit0;
84 };
85
86 class COpenGL3MaterialOneTextureBlendCB : public COpenGL3MaterialBaseCB
87 {
88 public:
89         COpenGL3MaterialOneTextureBlendCB();
90
91         virtual void OnSetMaterial(const SMaterial& material);
92         virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
93
94 protected:
95         bool FirstUpdate;
96
97         s32 TMatrix0ID;
98         s32 BlendTypeID;
99         s32 TextureUsage0ID;
100         s32 TextureUnit0ID;
101
102         s32 BlendType;
103         s32 TextureUsage0;
104         s32 TextureUnit0;
105 };
106
107 }
108 }