0027925: Visualization - implement order-independent transparency algorithm within...
[occt.git] / src / Shaders / Shaders_Declarations_glsl.pxx
CommitLineData
ee5befae 1// This file has been automatically generated from resource file src/Shaders/Declarations.glsl
2
3static const char Shaders_Declarations_glsl[] =
4 "// Created on: 2013-10-10\n"
5 "// Created by: Denis BOGOLEPOV\n"
6 "// Copyright (c) 2013-2014 OPEN CASCADE SAS\n"
7 "//\n"
8 "// This file is part of Open CASCADE Technology software library.\n"
9 "//\n"
10 "// This library is free software; you can redistribute it and/or modify it under\n"
11 "// the terms of the GNU Lesser General Public License version 2.1 as published\n"
12 "// by the Free Software Foundation, with special exception defined in the file\n"
13 "// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT\n"
14 "// distribution for complete text of the license and disclaimer of any warranty.\n"
15 "//\n"
16 "// Alternatively, this file may be used under the terms of Open CASCADE\n"
17 "// commercial license or contractual agreement.\n"
18 "\n"
19 "// This files includes definition of common uniform variables in OCCT GLSL programs\n"
20 "\n"
21 "#define THE_MAX_LIGHTS 8\n"
22 "#define THE_MAX_CLIP_PLANES 8\n"
23 "\n"
24 "// compatibility macros\n"
25 "#if (__VERSION__ >= 130)\n"
26 " #define THE_ATTRIBUTE in\n"
27 " #define THE_SHADER_IN in\n"
28 " #define THE_SHADER_OUT out\n"
29 " #define THE_OUT out\n"
30 " #define occTexture2D texture\n"
31 "#else\n"
32 " #define THE_ATTRIBUTE attribute\n"
33 " #define THE_SHADER_IN varying\n"
34 " #define THE_SHADER_OUT varying\n"
35 " #define THE_OUT\n"
36 " #define occTexture2D texture2D\n"
37 "#endif\n"
38 "\n"
39 "#ifdef GL_ES\n"
40 " #define THE_PREC_ENUM lowp // enumerations should fit into lowp range\n"
41 "#else\n"
42 " #define THE_PREC_ENUM\n"
43 "#endif\n"
44 "\n"
45 "// Vertex attributes\n"
46 "#ifdef VERTEX_SHADER\n"
47 " THE_ATTRIBUTE vec4 occVertex;\n"
48 " THE_ATTRIBUTE vec3 occNormal;\n"
49 " THE_ATTRIBUTE vec4 occTexCoord;\n"
50 " THE_ATTRIBUTE vec4 occVertColor;\n"
51 "#elif (__VERSION__ >= 130)\n"
52 " out vec4 occFragColor;\n"
a1073ae2 53 " #ifdef OCC_ENABLE_draw_buffers\n"
54 " out vec4 occFragCoverage;\n"
55 " #endif\n"
ee5befae 56 "#else\n"
a1073ae2 57 " #ifdef OCC_ENABLE_draw_buffers\n"
58 " #define occFragColor gl_FragData[0]\n"
59 " #define occFragCoverage gl_FragData[1]\n"
60 " #else\n"
61 " #define occFragColor gl_FragColor\n"
62 " #endif\n"
ee5befae 63 "#endif\n"
64 "\n"
65 "// Matrix state\n"
66 "uniform mat4 occWorldViewMatrix; //!< World-view matrix\n"
67 "uniform mat4 occProjectionMatrix; //!< Projection matrix\n"
68 "uniform mat4 occModelWorldMatrix; //!< Model-world matrix\n"
69 "\n"
70 "uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix\n"
71 "uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix\n"
72 "uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix\n"
73 "\n"
74 "uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix\n"
75 "uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix\n"
76 "uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix\n"
77 "\n"
78 "uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix\n"
79 "uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix\n"
80 "uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix\n"
81 "\n"
82 "// light type enumeration\n"
83 "const int OccLightType_Direct = 1; //!< directional light source\n"
84 "const int OccLightType_Point = 2; //!< isotropic point light source\n"
85 "const int OccLightType_Spot = 3; //!< spot light source\n"
86 "\n"
87 "// Light sources\n"
88 "uniform vec4 occLightAmbient; //!< Cumulative ambient color\n"
89 "uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources\n"
90 "int occLight_Type (in int theId); //!< Type of light source\n"
91 "int occLight_IsHeadlight (in int theId); //!< Is light a headlight?\n"
92 "vec4 occLight_Diffuse (in int theId); //!< Diffuse intensity for specified light source\n"
93 "vec4 occLight_Specular (in int theId); //!< Specular intensity (currently - equals to diffuse intencity)\n"
94 "vec4 occLight_Position (in int theId); //!< Position of specified light source\n"
95 "vec4 occLight_SpotDirection (in int theId); //!< Direction of specified spot light source\n"
96 "float occLight_ConstAttenuation (in int theId); //!< Const attenuation factor of positional light source\n"
97 "float occLight_LinearAttenuation (in int theId); //!< Linear attenuation factor of positional light source\n"
98 "float occLight_SpotCutOff (in int theId); //!< Maximum spread angle of the spot light (in radians)\n"
99 "float occLight_SpotExponent (in int theId); //!< Attenuation of the spot light intensity (from 0 to 1)\n"
100 "\n"
101 "// Front material properties accessors\n"
102 "vec4 occFrontMaterial_Emission(void); //!< Emission color\n"
103 "vec4 occFrontMaterial_Ambient(void); //!< Ambient reflection\n"
104 "vec4 occFrontMaterial_Diffuse(void); //!< Diffuse reflection\n"
105 "vec4 occFrontMaterial_Specular(void); //!< Specular reflection\n"
106 "float occFrontMaterial_Shininess(void); //!< Specular exponent\n"
107 "float occFrontMaterial_Transparency(void); //!< Transparency coefficient\n"
108 "\n"
109 "// Back material properties accessors\n"
110 "vec4 occBackMaterial_Emission(void); //!< Emission color\n"
111 "vec4 occBackMaterial_Ambient(void); //!< Ambient reflection\n"
112 "vec4 occBackMaterial_Diffuse(void); //!< Diffuse reflection\n"
113 "vec4 occBackMaterial_Specular(void); //!< Specular reflection\n"
114 "float occBackMaterial_Shininess(void); //!< Specular exponent\n"
115 "float occBackMaterial_Transparency(void); //!< Transparency coefficient\n"
116 "\n"
117 "uniform vec4 occColor; //!< color value (in case of disabled lighting)\n"
118 "uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?\n"
119 "uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?\n"
120 "uniform sampler2D occActiveSampler; //!< Current active sampler\n"
121 "uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters\n"
122 "uniform float occPointSize; //!< point size\n"
123 "\n"
a1073ae2 124 "//! Parameters of blended order-independent transparency rendering algorithm\n"
125 "uniform int occOitOutput; //!< Enable bit for writing output color buffers for OIT (occFragColor, occFragCoverage)\n"
126 "uniform float occOitDepthFactor; //!< Influence of the depth component to the coverage of the accumulated fragment\n"
127 "\n"
ee5befae 128 "//! Parameters of clipping planes\n"
129 "uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];\n"
130 "uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes\n";