ShaderSource.h
Go to the documentation of this file.
1 #ifndef B_SHADER_SOURCE_H
2 #define B_SHADER_SOURCE_H
3 
4 #include "Configuration.h"
5 
6 namespace bRenderer
7 {
8  std::string SHADER_SOURCE_LINE_BREAK();
9  std::string SHADER_SOURCE_LINE_ENDING();
10  std::string SHADER_SOURCE_WHITE_SPACE();
11 
12  // Head
13  std::string SHADER_SOURCE_HEAD_ES();
14  std::string SHADER_SOURCE_HEAD_DESKTOP();
15 
16  // Lights
17  std::string SHADER_SOURCE_NUM_LIGHTS();
18 
19  std::string shader_source_light_properties(GLuint maxLights, bool normalMap, bool diffuseLighting, bool specularLighting);
20 
21  // Matrices
22  std::string SHADER_SOURCE_MATRICES();
23 
24  // Attributes
25  std::string SHADER_SOURCE_ATTRIBUTES();
26 
27  // Varyings
29 
30  std::string SHADER_SOURCE_VARYINGS_NORMAL();
31 
33 
35 
36  // Colors
37  std::string SHADER_SOURCE_COLORS();
38 
39  // Transparency value
41 
42  // Textures
43  std::string SHADER_SOURCE_TEXTURES();
44 
45  // Text Textures
46  std::string SHADER_SOURCE_TEXT_TEXTURES();
47 
48  /* Vertex Shader */
49 
50  // Vertex Shader Main Function
51  //Begin
52  std::string shader_source_function_vertex_main_begin(bool hasLighting, bool hasTextures, bool normalMap);
53 
54  // TBN for normal map
56  // Camera tangent space
58  // Camera view space
60  // Lighting
61  std::string shader_source_function_lightVector(GLuint maxLights, bool normalMap, bool variableNumberOfLights);
62 
63  // End
65 
66  /* Fragment Shader */
67 
68  // Fragment Shader Main Function
69  // Begin
71 
72  // Ambient
75 
76  // Normals
79 
80  // Initialize diffuse lighting
83  // Initialize diffuse lighting with transparency value
86 
88 
89  // Initialize specular lighting
91 
93 
95 
96  // Lighting
97  std::string shader_source_function_lighting(GLuint maxLights, bool normalMap, bool diffuseLighting, bool specularLighting, bool variableNumberOfLights);
98 
99  // Finalize diffuse lighting
100  std::string shader_source_function_fragment_finalize_diffuse(bool diffuseColor, bool diffuseMap);
101 
102  // Finalize specular lighting
103  std::string shader_source_function_fragment_finalize_specular(bool specularColor, bool specularMap);
104 
105  // End
111 
112  // End Text
114 
115 
116 } // namespace bRenderer
117 
118 #endif /* defined(B_SHADER_SOURCE_H) */
std::string SHADER_SOURCE_TEXTURES()
Definition: ShaderSource.cpp:72
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_SPECULAR_VIEW_SPACE()
Definition: ShaderSource.cpp:161
std::string shader_source_function_fragment_finalize_specular(bool specularColor, bool specularMap)
Definition: ShaderSource.cpp:220
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_PART2()
Definition: ShaderSource.cpp:235
std::string SHADER_SOURCE_HEAD_DESKTOP()
Definition: ShaderSource.cpp:11
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_DIFFUSE_NO_LIGHTS_TRANSPARENCY()
Definition: ShaderSource.cpp:156
std::string SHADER_SOURCE_TRANSPARENCY_VALUE()
Definition: ShaderSource.cpp:69
std::string SHADER_SOURCE_VARYINGS_NORMAL()
Definition: ShaderSource.cpp:54
Definition: Configuration.h:8
std::string shader_source_function_lightVector(GLuint maxLights, bool normalMap, bool variableNumberOfLights)
Definition: ShaderSource.cpp:108
std::string shader_source_light_properties(GLuint maxLights, bool normalMap, bool diffuseLighting, bool specularLighting)
Definition: ShaderSource.cpp:16
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_PART1()
Definition: ShaderSource.cpp:231
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_BEGIN()
Definition: ShaderSource.cpp:141
std::string SHADER_SOURCE_COLORS()
Definition: ShaderSource.cpp:61
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_AMBIENT()
Definition: ShaderSource.cpp:232
std::string SHADER_SOURCE_VARYINGS_TEX_COORD()
Definition: ShaderSource.cpp:52
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_DIFFUSE_TRANSPARENCY()
Definition: ShaderSource.cpp:155
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_SPECULAR()
Definition: ShaderSource.cpp:234
std::string SHADER_SOURCE_VARYINGS_CAMERA_TANGENT()
Definition: ShaderSource.cpp:56
std::string SHADER_SOURCE_NUM_LIGHTS()
Definition: ShaderSource.cpp:14
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_LIGHTING()
Definition: ShaderSource.cpp:158
std::string SHADER_SOURCE_HEAD_ES()
Definition: ShaderSource.cpp:10
std::string shader_source_function_fragment_finalize_diffuse(bool diffuseColor, bool diffuseMap)
Definition: ShaderSource.cpp:209
std::string SHADER_SOURCE_LINE_ENDING()
Definition: ShaderSource.cpp:6
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_DIFFUSE()
Definition: ShaderSource.cpp:233
std::string shader_source_function_vertex_main_begin(bool hasLighting, bool hasTextures, bool normalMap)
Definition: ShaderSource.cpp:82
std::string SHADER_SOURCE_MATRICES()
Definition: ShaderSource.cpp:39
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_AMBIENT_COLOR()
Definition: ShaderSource.cpp:145
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_SURFACE_NORMAL_VIEW_SPACE()
Definition: ShaderSource.cpp:149
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_SURFACE_NORMAL_TANGENT_SPACE()
Definition: ShaderSource.cpp:148
std::string SHADER_SOURCE_LINE_BREAK()
Definition: ShaderSource.cpp:5
std::string shader_source_function_lighting(GLuint maxLights, bool normalMap, bool diffuseLighting, bool specularLighting, bool variableNumberOfLights)
Definition: ShaderSource.cpp:174
std::string SHADER_SOURCE_FUNCTION_VERTEX_MAIN_CAMERA_TANGENT_SPACE()
Definition: ShaderSource.cpp:104
std::string SHADER_SOURCE_WHITE_SPACE()
Definition: ShaderSource.cpp:7
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_AMBIENT()
Definition: ShaderSource.cpp:144
std::string SHADER_SOURCE_VARYINGS_CAMERA_VIEW()
Definition: ShaderSource.cpp:58
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_SPECULAR_TANGENT_SPACE()
Definition: ShaderSource.cpp:166
std::string SHADER_SOURCE_FUNCTION_VERTEX_MAIN_TBN()
Definition: ShaderSource.cpp:95
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_DIFFUSE()
Definition: ShaderSource.cpp:152
std::string SHADER_SOURCE_FUNCTION_VERTEX_MAIN_CAMERA_VIEW_SPACE()
Definition: ShaderSource.cpp:106
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_MAIN_END_TEXT()
Definition: ShaderSource.cpp:237
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_DIFFUSE_NO_LIGHTS()
Definition: ShaderSource.cpp:153
std::string SHADER_SOURCE_TEXT_TEXTURES()
Definition: ShaderSource.cpp:77
std::string SHADER_SOURCE_ATTRIBUTES()
Definition: ShaderSource.cpp:44
std::string SHADER_SOURCE_FUNCTION_FRAGMENT_INIT_SPECULAR_NO_LIGHTS()
Definition: ShaderSource.cpp:171
std::string SHADER_SOURCE_FUNCTION_VERTEX_MAIN_END()
Definition: ShaderSource.cpp:133