OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProjectedLights.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2017, ARM Limited and Contributors
2  *
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge,
6  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef PROJECTED_LIGHTS_H
22 #define PROJECTED_LIGHTS_H
23 
24 #include "VectorTypes.h"
25 #include <EGL/egl.h>
26 #include <GLES3/gl3.h>
27 
28 namespace MaliSDK
29 {
31  #define CAMERA_PERSPECTIVE_FOV_IN_DEGREES (60.0f)
32 
33  #define COLOR_TEXTURE_NAME ("/data/data/com.arm.malideveloper.openglessdk.projectedLights/files/mali.bmp")
34 
35  #define COLOR_TEXTURE_TRANSLATION (15.0f)
36 
37  #define CUBE_SCALING_FACTOR (2.0f)
38 
39  #define LIGHT_PERSPECTIVE_FOV_IN_DEGREES (90.0f)
40 
41  #define FAR_PLANE (50.0f)
42 
43  #define FRAGMENT_SHADER_FILE_NAME ("/data/data/com.arm.malideveloper.openglessdk.projectedLights/files/render_scene_shader.frag")
44 
45  #define LIGHT_SOURCE_SCALING_FACTOR (0.3f)
46 
47  #define MODEL_Y_POSITION (-3.0f)
48 
49  #define MODEL_Y_ROTATION_ANGLE_IN_DEGREES (60.0f)
50 
51  #define NEAR_PLANE (1.0f)
52 
53  #define PLANE_SCALING_FACTOR (10.0f)
54 
55  #define SPOT_LIGHT_ANGLE_IN_DEGREES (20.0f)
56  /* Radius that will be used to calculate new direction of a spot light. */
57  #define SPOT_LIGHT_TRANSLATION_RADIUS (3.0f)
58 
59  #define TEXTURE_UNIT_FOR_COLOR_TEXTURE (0)
60 
61  #define TEXTURE_UNIT_FOR_SHADOW_MAP_TEXTURE (1)
62 
63  #define VERTEX_SHADER_FILE_NAME ("/data/data/com.arm.malideveloper.openglessdk.projectedLights/files/render_scene_shader.vert")
64 
67  {
68  Vec4f color; /* Colour of the geometry (assumption: geometry will have a solid colour). */
69  float* coordinates; /* Array holding the geometry's coordinates. */
70  float* normals; /* Array holding the geometry's normal vectors. */
71  int numberOfElementsInCoordinatesArray; /* Number of elements written to coordinates array. */
72  int numberOfElementsInNormalsArray; /* Number of elements written to an array holding geometry's normal vectors. */
73  Vec3f position; /* Array holding position of the geometry in 3D space. */
74 
76  {
77  coordinates = NULL;
78  normals = NULL;
81  }
82  };
83 
87  {
91 
93  {
95  programObjectId = 0;
97  }
98  };
99 
102  {
106 
108  {
112  }
113  };
114 
117  {
123 
125  {
129  }
130  };
131 
135  {
153 
155  {
158  uniformColorTexture = -1;
165  uniformNormalMatrix = -1;
166  uniformShadowMap = -1;
173  }
174  };
175 
178  {
182  };
183 
186  {
189  };
190 
192  {
197  };
198 
202  {
214  };
215 
219  {
227  };
228 }
229 #endif /* PROJECTED_LIGHTS_H */
Functions for manipulating matrices.
Definition: Matrix.h:31
A 3D floating point vector.
Definition: VectorTypes.h:83
RenderGeometryObjects renderPlane
ModelViewProperties planeViewProperties
ModelViewProperties planeViewProperties
typedef GLfloat(GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path
ModelViewProperties cubeViewProperties
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
ModelViewProperties cubeViewProperties
A 4D floating point vector.
Definition: VectorTypes.h:127
RenderGeometryObjects renderCube