// This file has been automatically generated from resource file src/Shaders/Declarations.glsl static const char Shaders_Declarations_glsl[] = "// Created on: 2013-10-10\n" "// Created by: Denis BOGOLEPOV\n" "// Copyright (c) 2013-2014 OPEN CASCADE SAS\n" "//\n" "// This file is part of Open CASCADE Technology software library.\n" "//\n" "// This library is free software; you can redistribute it and/or modify it under\n" "// the terms of the GNU Lesser General Public License version 2.1 as published\n" "// by the Free Software Foundation, with special exception defined in the file\n" "// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT\n" "// distribution for complete text of the license and disclaimer of any warranty.\n" "//\n" "// Alternatively, this file may be used under the terms of Open CASCADE\n" "// commercial license or contractual agreement.\n" "\n" "// This files includes definition of common uniform variables in OCCT GLSL programs\n" "\n" "#define THE_MAX_LIGHTS 8\n" "#define THE_MAX_CLIP_PLANES 8\n" "\n" "// compatibility macros\n" "#if (__VERSION__ >= 130)\n" " #define THE_ATTRIBUTE in\n" " #define THE_SHADER_IN in\n" " #define THE_SHADER_OUT out\n" " #define THE_OUT out\n" " #define occTexture2D texture\n" "#else\n" " #define THE_ATTRIBUTE attribute\n" " #define THE_SHADER_IN varying\n" " #define THE_SHADER_OUT varying\n" " #define THE_OUT\n" " #define occTexture2D texture2D\n" "#endif\n" "\n" "#ifdef GL_ES\n" " #define THE_PREC_ENUM lowp // enumerations should fit into lowp range\n" "#else\n" " #define THE_PREC_ENUM\n" "#endif\n" "\n" "// Vertex attributes\n" "#ifdef VERTEX_SHADER\n" " THE_ATTRIBUTE vec4 occVertex;\n" " THE_ATTRIBUTE vec3 occNormal;\n" " THE_ATTRIBUTE vec4 occTexCoord;\n" " THE_ATTRIBUTE vec4 occVertColor;\n" "#elif (__VERSION__ >= 130)\n" " out vec4 occFragColor;\n" "#else\n" " #define occFragColor gl_FragColor\n" "#endif\n" "\n" "// Matrix state\n" "uniform mat4 occWorldViewMatrix; //!< World-view matrix\n" "uniform mat4 occProjectionMatrix; //!< Projection matrix\n" "uniform mat4 occModelWorldMatrix; //!< Model-world matrix\n" "\n" "uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix\n" "uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix\n" "uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix\n" "\n" "uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix\n" "uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix\n" "uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix\n" "\n" "uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix\n" "uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix\n" "uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix\n" "\n" "// light type enumeration\n" "const int OccLightType_Direct = 1; //!< directional light source\n" "const int OccLightType_Point = 2; //!< isotropic point light source\n" "const int OccLightType_Spot = 3; //!< spot light source\n" "\n" "// Light sources\n" "uniform vec4 occLightAmbient; //!< Cumulative ambient color\n" "uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources\n" "int occLight_Type (in int theId); //!< Type of light source\n" "int occLight_IsHeadlight (in int theId); //!< Is light a headlight?\n" "vec4 occLight_Diffuse (in int theId); //!< Diffuse intensity for specified light source\n" "vec4 occLight_Specular (in int theId); //!< Specular intensity (currently - equals to diffuse intencity)\n" "vec4 occLight_Position (in int theId); //!< Position of specified light source\n" "vec4 occLight_SpotDirection (in int theId); //!< Direction of specified spot light source\n" "float occLight_ConstAttenuation (in int theId); //!< Const attenuation factor of positional light source\n" "float occLight_LinearAttenuation (in int theId); //!< Linear attenuation factor of positional light source\n" "float occLight_SpotCutOff (in int theId); //!< Maximum spread angle of the spot light (in radians)\n" "float occLight_SpotExponent (in int theId); //!< Attenuation of the spot light intensity (from 0 to 1)\n" "\n" "// Front material properties accessors\n" "vec4 occFrontMaterial_Emission(void); //!< Emission color\n" "vec4 occFrontMaterial_Ambient(void); //!< Ambient reflection\n" "vec4 occFrontMaterial_Diffuse(void); //!< Diffuse reflection\n" "vec4 occFrontMaterial_Specular(void); //!< Specular reflection\n" "float occFrontMaterial_Shininess(void); //!< Specular exponent\n" "float occFrontMaterial_Transparency(void); //!< Transparency coefficient\n" "\n" "// Back material properties accessors\n" "vec4 occBackMaterial_Emission(void); //!< Emission color\n" "vec4 occBackMaterial_Ambient(void); //!< Ambient reflection\n" "vec4 occBackMaterial_Diffuse(void); //!< Diffuse reflection\n" "vec4 occBackMaterial_Specular(void); //!< Specular reflection\n" "float occBackMaterial_Shininess(void); //!< Specular exponent\n" "float occBackMaterial_Transparency(void); //!< Transparency coefficient\n" "\n" "uniform vec4 occColor; //!< color value (in case of disabled lighting)\n" "uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?\n" "uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?\n" "uniform sampler2D occActiveSampler; //!< Current active sampler\n" "uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters\n" "uniform float occPointSize; //!< point size\n" "\n" "//! Parameters of clipping planes\n" "uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];\n" "uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes\n";