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