OpenGL ES SDK for Android
ARM Developer Center
|
#include "Utils.h"
#include <jni.h>
#include <android/log.h>
#include <GLES3/gl3.h>
#include <EGL/egl.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <fstream>
#include "model3d.h"
#include "Matrix.h"
Go to the source code of this file.
Macros | |
#define | FOVEATED |
#define | RATIO 0.3 |
#define | MASK |
#define | RED |
#define | VIEWS 4 |
#define | LOG_TAG "Foveated_Sample" |
#define | LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) |
#define | LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) |
#define | GL_CHECK(x) |
#define | GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 |
Typedefs | |
typedef void(* | PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR )(GLenum, GLenum, GLuint, GLint, GLint, GLsizei) |
typedef void(* | PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVR )(GLenum, GLenum, GLuint, GLint, GLsizei, GLint, GLsizei) |
typedef void(* | PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT )(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei) |
typedef void(* | PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXT )(GLenum, GLsizei, GLenum, GLsizei, GLsizei) |
Functions | |
void | generateDepthCircleVBO (const uint8_t circleStep, const float radius) |
GLuint | loadShader (GLenum shaderType, const char *shaderSource, const int *length=NULL) |
char * | loadShaderFromFile (const std::string &filename, int *shaderLength) |
GLuint | createProgram (const char *vertexSource, const char *fragmentSource, const int *vertexLength=NULL, const int *fragmentLength=NULL) |
bool | createTexture (std::string filename, GLuint *textureLocation) |
bool | setupFBO (int width, int height) |
bool | setupGraphics (int width, int height) |
void | renderToFBO (const int width, const int height, const GLuint frameBufferID) |
void | renderFrame () |
JNIEXPORT void JNICALL | Java_com_arm_malideveloper_openglessdk_foveatedrendering_NativeLibrary_init (JNIEnv *env, jobject obj, jint width, jint height, jstring localPath) |
JNIEXPORT void JNICALL | Java_com_arm_malideveloper_openglessdk_foveatedrendering_NativeLibrary_step (JNIEnv *env, jobject obj) |
#define FOVEATED |
Definition at line 21 of file Native.cpp.
#define GL_CHECK | ( | x | ) |
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 |
Definition at line 156 of file Native.cpp.
#define LOG_TAG "Foveated_Sample" |
Definition at line 60 of file Native.cpp.
#define LOGE | ( | ... | ) | __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) |
Definition at line 62 of file Native.cpp.
#define LOGI | ( | ... | ) | __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) |
Definition at line 61 of file Native.cpp.
#define MASK |
Definition at line 23 of file Native.cpp.
#define RATIO 0.3 |
Definition at line 22 of file Native.cpp.
#define RED |
Definition at line 24 of file Native.cpp.
#define VIEWS 4 |
Definition at line 31 of file Native.cpp.
typedef void( * PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei) |
Definition at line 166 of file Native.cpp.
typedef void( * PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVR)(GLenum, GLenum, GLuint, GLint, GLsizei, GLint, GLsizei) |
Definition at line 162 of file Native.cpp.
Definition at line 158 of file Native.cpp.
Definition at line 169 of file Native.cpp.
GLuint createProgram | ( | const char * | vertexSource, |
const char * | fragmentSource, | ||
const int * | vertexLength = NULL , |
||
const int * | fragmentLength = NULL |
||
) |
Definition at line 399 of file Native.cpp.
bool createTexture | ( | std::string | filename, |
GLuint * | textureLocation | ||
) |
Definition at line 445 of file Native.cpp.
Definition at line 258 of file Native.cpp.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_foveatedrendering_NativeLibrary_init | ( | JNIEnv * | env, |
jobject | obj, | ||
jint | width, | ||
jint | height, | ||
jstring | localPath | ||
) |
Definition at line 909 of file Native.cpp.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_foveatedrendering_NativeLibrary_step | ( | JNIEnv * | env, |
jobject | obj | ||
) |
Definition at line 917 of file Native.cpp.
Definition at line 353 of file Native.cpp.
char* loadShaderFromFile | ( | const std::string & | filename, |
int * | shaderLength | ||
) |
Definition at line 388 of file Native.cpp.
Definition at line 822 of file Native.cpp.
Definition at line 729 of file Native.cpp.
Definition at line 468 of file Native.cpp.
Definition at line 535 of file Native.cpp.
float angle = 0 |
Definition at line 143 of file Native.cpp.
std::string assetFolder |
Definition at line 150 of file Native.cpp.
const uint8_t circleStepConst = 16 |
Definition at line 145 of file Native.cpp.
GLuint fboHeight |
Definition at line 76 of file Native.cpp.
GLuint fboWidth |
Definition at line 75 of file Native.cpp.
GLuint frameBufferDepthTextureId |
Definition at line 95 of file Native.cpp.
GLuint frameBufferObjectId |
Definition at line 86 of file Native.cpp.
GLuint frameBufferTextureId |
Definition at line 94 of file Native.cpp.
PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT glFramebufferTexture2DMultisampleEXT |
Definition at line 167 of file Native.cpp.
PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVR glFramebufferTextureMultisampleMultiviewOVR |
Definition at line 163 of file Native.cpp.
PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR glFramebufferTextureMultiviewOVR |
Definition at line 159 of file Native.cpp.
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXT glRenderbufferStorageMultisampleEXT |
Definition at line 170 of file Native.cpp.
std::vector<GLushort> I_OutsetCircle |
Definition at line 153 of file Native.cpp.
GLuint masklInsetVertexArray |
Definition at line 134 of file Native.cpp.
GLuint maskOutsetVertexArray |
Definition at line 135 of file Native.cpp.
GLuint maskProgram |
Definition at line 131 of file Native.cpp.
GLuint maskTypeLocation |
Definition at line 133 of file Native.cpp.
GLuint maskVertexLocation |
Definition at line 132 of file Native.cpp.
Matrix modelMatrix |
Definition at line 142 of file Native.cpp.
Definition at line 140 of file Native.cpp.
Definition at line 141 of file Native.cpp.
GLuint multiviewModelLocation |
Definition at line 107 of file Native.cpp.
GLuint multiviewModelViewLocation |
Definition at line 104 of file Native.cpp.
GLuint multiviewModelViewProjectionLocation |
Definition at line 105 of file Native.cpp.
GLuint multiviewProgram |
Definition at line 98 of file Native.cpp.
GLuint multiviewProjectionLocation |
Definition at line 106 of file Native.cpp.
GLuint multiviewTextureBump |
Definition at line 120 of file Native.cpp.
GLuint multiviewTextureDiffuse |
Definition at line 111 of file Native.cpp.
GLuint multiviewTextureMetallicRoughness |
Definition at line 117 of file Native.cpp.
GLuint multiviewTextureNormal |
Definition at line 114 of file Native.cpp.
GLuint multiviewTimeLocation |
Definition at line 108 of file Native.cpp.
GLuint multiviewVertexLocation |
Definition at line 99 of file Native.cpp.
GLuint multiviewVertexNormalLocation |
Definition at line 100 of file Native.cpp.
GLuint multiviewVertexTangentLocation |
Definition at line 101 of file Native.cpp.
GLuint multiviewVertexUVLocation |
Definition at line 102 of file Native.cpp.
GLuint multiviewViewLocation |
Definition at line 103 of file Native.cpp.
Definition at line 137 of file Native.cpp.
Model3D::Model3D room |
Definition at line 151 of file Native.cpp.
GLuint screenHeight |
Definition at line 78 of file Native.cpp.
GLuint screenWidth |
Definition at line 77 of file Native.cpp.
float texturedQuadCoordinates[] |
Definition at line 223 of file Native.cpp.
|
static |
Definition at line 173 of file Native.cpp.
float texturedQuadHighResTexCoordinates[] |
Definition at line 247 of file Native.cpp.
GLuint texturedQuadHighResTexCoordLocation |
Definition at line 125 of file Native.cpp.
GLuint texturedQuadLayerIndexLocation |
Definition at line 127 of file Native.cpp.
float texturedQuadLowResTexCoordinates[] |
Definition at line 235 of file Native.cpp.
GLuint texturedQuadLowResTexCoordLocation |
Definition at line 124 of file Native.cpp.
GLuint texturedQuadProgram |
Definition at line 122 of file Native.cpp.
GLuint texturedQuadSamplerLocation |
Definition at line 126 of file Native.cpp.
GLuint texturedQuadVertexLocation |
Definition at line 123 of file Native.cpp.
GLuint textureIdBump |
Definition at line 119 of file Native.cpp.
GLuint textureIdDiffuse |
Definition at line 110 of file Native.cpp.
GLuint textureIdMetallicRoughness |
Definition at line 116 of file Native.cpp.
GLuint textureIdNormal |
Definition at line 113 of file Native.cpp.
GLuint textureQuadFoveatedRatio |
Definition at line 128 of file Native.cpp.
GLuint textureQuadWidthHeight |
Definition at line 129 of file Native.cpp.
const uint16_t TextureSize = 2048 |
Definition at line 148 of file Native.cpp.
Definition at line 138 of file Native.cpp.
Definition at line 139 of file Native.cpp.