danginsburg / opengles3-book Goto Github PK
View Code? Open in Web Editor NEWOpenGL ES 3.0 Programming Guide Sample Code
License: MIT License
OpenGL ES 3.0 Programming Guide Sample Code
License: MIT License
On page 40 there is some discussion regarding clearing the color in the Init function.
Looking back to page 32, the color is set to 0.0, 0.0, 0.0, 0.0.
The discussion on page 40 mentions it being set to 1.0, 1.0, 1.0, 1.0.
The current version of the MaliEmulator requires linking against libMaliEmulator.lib in addition to libGLESv2 and libEGL. The projects spat out by CMake therefore fail to build out of the box. It's trivial to add but some newcomers may trip over this. Worth adding something to the CMake config to deal with this?
As I can't reopen #31 , so i open a new issue.
I think there are still something wrong in transform functions.
When compare mesa code and es3 book code,
in "rotate" function, M(row, col) == m[row][col].
but in "frustum" funtions, _M(row, col) == m[col][row]_.
as mesa use 1-D array "M[ ]" stored in column-major, and "#define M(row,col) m[col * 4+row]"; es3 book source code use 2-D array "m[ ][ ]".
Does "rotate" function and "frustum" functions both should be either M(row, col) ==m[row][col] or M(row, col) == m[col][row]???
Or say another way, if we compare the data sequence of 2-D array "m[ ][ ]" which store row by row in the client memory, with the data sequence of 1-D array "M[ ]" in mesa in the client memory, they should be same?? And the data sequences are same when i compare "frustum" & "tranlation" & "scale" functions between mesa code and es3 book code, but "rotate" function doesn't, that's weird.
Mesa v10.6.5 rotate works:
xx = x * x;
yy = y * y;
zz = z * z;
xy = x * y;
yz = y * z;
zx = z * x;
xs = x * s;
ys = y * s;
zs = z * s;
one_c = 1.0F - c;
/* We already hold the identity-matrix so we can skip some statements */
M(0,0) = (one_c * xx) + c;
M(0,1) = (one_c * xy) - zs;
M(0,2) = (one_c * zx) + ys;
/* M(0,3) = 0.0F; */
M(1,0) = (one_c * xy) + zs;
M(1,1) = (one_c * yy) + c;
M(1,2) = (one_c * yz) - xs;
/* M(1,3) = 0.0F; */
M(2,0) = (one_c * zx) - ys;
M(2,1) = (one_c * yz) + xs;
M(2,2) = (one_c * zz) + c;
/* M(2,3) = 0.0F; */
es3 book code rotate works:
xx = x * x;
yy = y * y;
zz = z * z;
xy = x * y;
yz = y * z;
zx = z * x;
xs = x * sinAngle;
ys = y * sinAngle;
zs = z * sinAngle;
oneMinusCos = 1.0f - cosAngle;
rotMat.m[0][0] = ( oneMinusCos * xx ) + cosAngle;
rotMat.m[0][1] = ( oneMinusCos * xy ) - zs;
rotMat.m[0][2] = ( oneMinusCos * zx ) + ys;
rotMat.m[0][3] = 0.0F;
rotMat.m[1][0] = ( oneMinusCos * xy ) + zs;
rotMat.m[1][1] = ( oneMinusCos * yy ) + cosAngle;
rotMat.m[1][2] = ( oneMinusCos * yz ) - xs;
rotMat.m[1][3] = 0.0F;
rotMat.m[2][0] = ( oneMinusCos * zx ) - ys;
rotMat.m[2][1] = ( oneMinusCos * yz ) + xs;
rotMat.m[2][2] = ( oneMinusCos * zz ) + cosAngle;
rotMat.m[2][3] = 0.0F;
rotMat.m[3][0] = 0.0F;
rotMat.m[3][1] = 0.0F;
rotMat.m[3][2] = 0.0F;
rotMat.m[3][3] = 1.0F;
Then in above codes, M(row, col) == m[row][col], The single data sequence in two matrixes are not in the same sequence in the client memory.
however, in frustum function,
Mesa v10.6.5 frustum works:
x = (2.0F*nearval) / (right-left);
y = (2.0F*nearval) / (top-bottom);
a = (right+left) / (right-left);
b = (top+bottom) / (top-bottom);
c = -(farval+nearval) / ( farval-nearval);
d = -(2.0F*farval*nearval) / (farval-nearval); /* error? */
#define M(row,col) m[col*4+row]
M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
#undef M
es3 book code frustum works:
frust.m[0][0] = 2.0f * nearZ / deltaX;
frust.m[0][1] = frust.m[0][2] = frust.m[0][3] = 0.0f;
frust.m[1][1] = 2.0f * nearZ / deltaY;
frust.m[1][0] = frust.m[1][2] = frust.m[1][3] = 0.0f;
frust.m[2][0] = ( right + left ) / deltaX;
frust.m[2][1] = ( top + bottom ) / deltaY;
frust.m[2][2] = - ( nearZ + farZ ) / deltaZ;
frust.m[2][3] = -1.0f;
frust.m[3][2] = -2.0f * nearZ * farZ / deltaZ;
frust.m[3][0] = frust.m[3][1] = frust.m[3][3] = 0.0f;
in above codes, _M(row, col) == m[col][row] , as M(0,2) == m[2][0], M(1,2) == m[2][1], M(2,3) == m[3][2], ._ The single data sequence in two matrixes are in the same sequence in the client memory as 2-D array m[ ][ ] stores row by row.
Should be TEXCOORD1, but TEXC00RD1
P.129:
#define VERTEX_TEXC00RD1_0FFSET 8
#define VERTEX_ATTRIB_SIZE (VERTEX_POS_SIZE + \
VERTEX_NORMAL_SIZE + \
VERTEX_TEXCOORD0_SIZE + \
VERTEX_TEXC00RD1_SIZE)
P.130:
(p + VERTEX_TEXC00RD1_0FFSET));
float *texcoordl = (float*) malloc(numVertices *
VERTEX_TEXC00RD1_SIZE * sizeof(float));
// texture coordinate 1 is vertex attribute 3
glVertexAttribPointer(VERTEX_TEXCOORDl_INDX,
VERTEX_TEXC00RD1_SIZE,
GL_FLOAT, GL_FALSE,
VERTEX_TEXC00RD1_SIZE * sizeof(float),
texcoordl);
book, page 233, 261, 264, 266, 267, 268 and 269.
for the functions glTexImage_, glTexSubImage_, glCompressedTexImage_, glCompressedTexSubImage_,
These descriptions of "pixels" are incomplete with regard to unpack buffer object. As described later in the book this argument can be an offset. I think that these descriptions should mention their use with unpack buffer object.
Hello, I have a need as follows:
Chapter 7. Primitive Assembly and Rasterization > 2. Drawing Primitives
"The first method is to instruct OpenGL ES to read vertex attributes once or multiple times per instance using the following command"
It seems to me this should be: once per instance or per multiple-instances.
I compiled it with NDK toolchains on Ubuntu , errors happened like X11/Xlib.h' file not found? Anyone knows how to solve it?
Book, page 171, top of the page, 1st paragraph
"If divisor equals 1, then the vertex attributes will be read once per primitive instance."
This doesn't explain the situation when divisor is larger than 1.
Spec 3.1, page 241:
"Otherwise, attributes advance once per divisor instances of the set(s) of vertices being rendered."
The last eg in section "16-Bit Floating-Point Number" of appendix A :
0 10100 1010101010 = 54.375
does it should be 53.3125 not 54.375 ?
Once you have a program object created, the next step is to attach shaders to it. In OpenGL ES 3.0, each program object needs to have one vertex shader and one fragment shader object attached to it. To attach shaders to a program, you use glAttachShader.
WRONG IMAGE INSERTED HERE
Image is for glDetachShader instead for glAttachShader
This function attaches the shader to the given program. Note that a shader can be attached at any point— it does not necessarily need to be compiled or even have source code before being attached to a program. The only requirement is that every program object must have one and only one vertex shader and fragment shader object attached to it. In addition to attaching shaders, you can detach shaders using glDetachShader. Once the shaders have been attached (and the shaders have been successfully compiled), we are finally ready to link the shaders together. Linking a program object is accomplished using glLinkProgram.
Ginsburg, Dan; Purnomo, Budirijanto; Shreiner, Dave; Munshi, Aaftab (2014-02-28). OpenGL ES 3.0 Programming Guide (2nd Edition) (Kindle Locations 1973-1982). Pearson Education. Kindle Edition.
Page 265 says, "Once a texture has been loaded as a compressed texture, it can be used for texturing in exactly the same way as an uncompressed texture."
In my opinion, this statement about "exactly the same way" is not entirely true. Calling glGenerateMipmap() on a compressed texture returns an error in most drivers. This is not noted on page 265 or on page 242 where "Automatic Mipmap Generation" is covered. It would be helpful if the restriction on compressed texture mipmap generation is noted somewhere.
The ES 3.0 man page says that glGenerateMipmap() is unsupported on compressed base level:
GL_INVALID_OPERATION is generated if the levelbase array is stored in a compressed internal format.
For example, esRotate(45, 0.f, 0.f, 1.f)
should rotate counter clockwised but clockwised actually.
From the other codes, such as the implementation of the function esTranslate
and the transpose parameter of the glUniformMatrix4fv
always being setted to GL_FALSE
, the model matrix is seemed to be column majored, but the implementation of the esRotate
and esMatrixMultiply
are row majored.
How confusing the codes are!
After compared with mesa lib, i got confused with these matrixes. As the "frust" in esFrustum(), "result" in esTranslate() and esScale() are using the transpose of standard transform matrix, does "rotMat" in esRotate() should be the tranposed(as below)?
rotMat.m[0][0] = ( oneMinusCos * xx ) + cosAngle;
rotMat.m[1][0] = ( oneMinusCos * xy ) - zs;
rotMat.m[2][0] = ( oneMinusCos * zx ) + ys;
rotMat.m[3][0] = 0.0F;
rotMat.m[0][1] = ( oneMinusCos * xy ) + zs;
rotMat.m[1][1] = ( oneMinusCos * yy ) + cosAngle;
rotMat.m[2][1] = ( oneMinusCos * yz ) - xs;
rotMat.m[3][1] = 0.0F;
rotMat.m[0][2] = ( oneMinusCos * zx ) - ys;
rotMat.m[1][2] = ( oneMinusCos * yz ) + xs;
rotMat.m[2][2] = ( oneMinusCos * zz ) + cosAngle;
rotMat.m[3][2] = 0.0F;
rotMat.m[0][3] = 0.0F;
rotMat.m[1][3] = 0.0F;
rotMat.m[2][3] = 0.0F;
rotMat.m[3][3] = 1.0F;
but the orignal "rotMat" in esRotate() works:
rotMat.m[0][0] = ( oneMinusCos * xx ) + cosAngle;
rotMat.m[0][1] = ( oneMinusCos * xy ) - zs;
rotMat.m[0][2] = ( oneMinusCos * zx ) + ys;
rotMat.m[0][3] = 0.0F;
rotMat.m[1][0] = ( oneMinusCos * xy ) + zs;
rotMat.m[1][1] = ( oneMinusCos * yy ) + cosAngle;
rotMat.m[1][2] = ( oneMinusCos * yz ) - xs;
rotMat.m[1][3] = 0.0F;
rotMat.m[2][0] = ( oneMinusCos * zx ) - ys;
rotMat.m[2][1] = ( oneMinusCos * yz ) + xs;
rotMat.m[2][2] = ( oneMinusCos * zz ) + cosAngle;
rotMat.m[2][3] = 0.0F;
rotMat.m[3][0] = 0.0F;
rotMat.m[3][1] = 0.0F;
rotMat.m[3][2] = 0.0F;
rotMat.m[3][3] = 1.0F;
According to the GLES 3.0 spec, it appears that the following GL call is valid for cube maps (see section 3.8.4 on pg. 137):
glTexStorage2D( GL_TEXTURE_CUBE_MAP, ... )
This usage is also described in GL-land (ARB_texture_storage ext spec, OpenGL Programming Guide, etc.).
However, it appears that the OpenGL ES 3.0 Programming Guide is not consistent with the GLES 3.0 spec here. It does not list GL_TEXTURE_CUBE_MAP as a valid option for target, and it lists the face enums (GL_TEXTURE_CUBE_MAP_{POSITIVE,NEGATIVE}_{X,Y,Z}) as valid options for target.
Book, page 248
In table 9-5, the type of GL_RGB5_A1 should be "UNSIGNED_SHORT_5_5_5_1" instead of "UNSIGNED_SHORT_2_10_10_10_REV"
book, page 436
The argument of glIsSync should be "sync" instead of "GLuint"
The brief comments for esMatrixLoadIdentity mention an indentity matrix.
In the example 6-6, signature of DrawPrimitiveWithVBOs()
changes from that in example 6-5. The argument GLfloat *vertices
is suddenly GLfloat **vtxBuf
in example 6-6 .
In example 6-5 the caller of DrawPrimitiveWithVBOs()
is clearly shown, passing vertices
for the argument GLfloat *vtxBuf
. But there is no indication in the book on what is passed in for GLfloat **vtxBuf
that's later accessed with vtxBuf[0]
and vtxBuf[1]
. Passing in the same GLfloat vertices[]
will not work in example 6-6.
Having two functions of exact same name with a sudden change of signature and no clear indication could be confusing, especially when reading the text without close inspection of the source code here on github.
Win10 64bit still use 32bit LONG, so GetWindowLongPtr will return a garbage when use LONG in SetWindowLongPtr.
Please refer to https://blogs.msdn.microsoft.com/oldnewthing/20131226-00/?p=2263/
Should be fixed by this CL: #35
Hi,
I installed PowerVR SDK in my Linux computer for learnning OpenGLES and I download this tutorials.
Codes has been compiled and no errors pop. But there is no window appear when I run executable file under Linux OS.
I has been added libraryies ie,libGLESv2.so libEGL.so into system environments.
Can you help me? thanks!
Hey guys, I am very new to OpenGL development. I am learning to develop Open GL ES 3 apps following your book. Here is current environment spec:
Emulator: Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-64bit
IDE: Visual Studio 2015 Win64
Cmake version: 3.11.2
OS: Windows 10
I am referring the Chapter 16 for building it on Windows and for Visual Studio
After a lot of beating my head around and digging, I managed to bring down the number of Linker issues that I was getting. Currently I am stuck on 2 linker issues that I unable to resolved or get any help.
Error LNK1120 2 unresolved externals Hello_Triangle C:\Users\nikhil.bagul\Documents\OpenGLES\Projects\opengles3-book\Chapter_2\Hello_Triangle\VisualStudioSolution64\Release\Hello_Triangle.exe 1
Error LNK2019 unresolved external symbol main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@yahxz) Hello_Triangle C:\Users\nikhil.bagul\Documents\OpenGLES\Projects\opengles3-book\Chapter_2\Hello_Triangle\VisualStudioSolution64\MSVCRT.lib(exe_main.obj) 1
Error LNK2019 unresolved external symbol WinCreate referenced in function esCreateWindow Hello_Triangle C:\Users\nikhil.bagul\Documents\OpenGLES\Projects\opengles3-book\Chapter_2\Hello_Triangle\VisualStudioSolution64\esUtil.obj 1
Any help is much appreciated.
Thanks!
Should say "ALPHA", not "ALHPA".
Where can I get both of libEGL.lib and libGLESv2.lib?
I buy the book. The example 2 of the triangle, I do steps of chapter 16 for build with Android NDK.
I have android 4.4.2.
NDK: android-ndk-r10e
ENVIRONMENT VARIABLES WITH CYGWIN:
export JAVA_HOME="/cygdrive/c/Program Files/Java/jdk1.7.0_45"
export ANDROID_SDK=/cygdrive/c/Users/steven.mendez/sdk
export ANDROID_NDK=/cygdrive/c/Users/steven.mendez/Documents/Development/Android/android-ndk-r10e
export ANT=/cygdrive/c/Users/steven.mendez/Documents/Development/apache-ant-1.9.2\bin
export PATH=$PATH:${ANDROID_NDK}
export PATH=$PATH:${ANT}
export PATH=$PATH:${ANDROID_SDK}/tools
export PATH=$PATH:${ANDROID_SDK}/platform-tools.
After install(adb install -r bin/NativeActivity-debug.apk), I do test on my mobile, but the error on adb is:
E/cutils ( 177): Failed to mkdirat(/storage/sdcard1/Android): Read-only file system
W/ContextImpl(11766): Failed to ensure directory: /storage/sdcard1/Android/obb/com.openglesbook.HelloTriangle
E/cutils ( 177): Failed to mkdirat(/storage/sdcard1/Android): Read-only file system
W/ContextImpl(11766): Failed to ensure directory: /storage/sdcard1/Android/data/com.openglesbook.HelloTriangle/files
W/linker (11766): library "libmaliinstr.so" not found
W/linker (11766): error:
E/libEGL (11766): call to OpenGL ES API with no current context (logged once per thread)
E/libEGL (11766): call to OpenGL ES API with no current context (logged once per thread)
E/libEGL (11766): call to OpenGL ES API with no current context (logged once per thread)
I/AudioFlinger(11766): LppThread::~LppThread()
I/ActivityManager( 603): Displayed com.openglesbook.HelloTriangle/android.app.NativeActivity: +162ms
I/CpuGovernorPolicy( 868): cpu draw
W/Binder ( 805): Caught a RuntimeException from the binder stub implementation.
W/Binder ( 805): java.lang.NullPointerException
W/Binder ( 805): at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
W/Binder ( 805): at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
W/Binder ( 805): at android.os.Binder.execTransact(Binder.java:404)
W/Binder ( 805): at dalvik.system.NativeStart.run(Native Method)
W/System.err( 805): java.lang.NullPointerException
W/System.err( 805): at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
W/System.err( 805): at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
W/System.err( 805): at android.os.Binder.execTransact(Binder.java:404)
W/System.err( 805): at dalvik.system.NativeStart.run(Native Method)
I/CpuGovernorPolicy( 868): gpu draw
I/DHCPCD ( 2214): wlan0: Router Advertisement from fe80::920d:cbff:fe36:d111
I/DHCPCD ( 2214): wlan0: fe80::920d:cbff:fe36:d111: expired Router Advertisement
The example of Hello_Triangle.
`GLuint LoadShader ( GLenum type, const char *shaderSrc )
{
GLuint shader;
GLint compiled;
// Create the shader object
shader = glCreateShader ( type );
if (shader == 0)
{
return 0;
}
// Load the shader source
glShaderSource ( shader, 1, &shaderSrc, NULL );
// Compile the shader
glCompileShader ( shader );
// Check the compile status
glGetShaderiv ( shader, GL_COMPILE_STATUS, &compiled );
if ( !compiled )
{
GLint infoLen = 0;
glGetShaderiv ( shader, GL_INFO_LOG_LENGTH, &infoLen );
if ( infoLen > 1 )
{
char *infoLog = malloc ( sizeof ( char ) * infoLen );
glGetShaderInfoLog ( shader, infoLen, NULL, infoLog );
esLogMessage ( "Error compiling shader:\n%s\n", infoLog );
free ( infoLog );
}
glDeleteShader ( shader );
return 0;
}
return shader;
}`
why glCreateShader() return 0? I didn't change any code.
I build on VS 2017 with windows 10 64bit
when each demo debug, will prompt an error in esUtils_win32.c
line:80 when ValidateRect() is invoked
shows esContext encounter an nullPtr
Can you tell me why this happen.
Chapter 8, section Model-View Matrix seems to have a typo:
"To simply this process, we have included..."
I'm not a native speaker, but wouldn't this be more like:
"To simplify this process"?
The case of missing if? ;-)
i can't understand the line 169,170.
the "lifetime" variable is always minus, there is no use deciding "lifetime <=0.0"
the code:
float lifetime = a_curtime - u_time;
if( lifetime <= 0.0 && randomValue(seed) < u_emissionRate )
{
}
i think it may be the following code, to decide whether the particle has
expired.
float lifetime = a_lifetime - (u_time - a_curtime);
Should instead be glBindBufferBase( GL_UNIFORM_BUFFER, bindingPoint, bufferId); ?
Chapter 8, section Vertex Skinning:
"Vertex Skinning is a commonly used technique whereby the joins between..."
Shouldn't this be like this?
"Vertex Skinning is a commonly used technique whereby the joints between..."
Again, I'm not a native speaker, but this also seems like a typo.
12.4 使用帧缓冲区对象
=》
12.4 使用渲染缓冲区对象
“需要使该对象成为当前帧缓冲区对象”
=》
“需要使该对象成为当前渲染缓冲区对象”
The List of pnames on page 275 in the Sampler Object section includes some parameter names that cannot be used with glSamplerParameter*:
GL_TEXTURE_BASE_LEVEL
GL_TEXTURE_MAX_LEVEL
GL_TEXTURE_SWIZZLE_{R,G,B,A}
See Table 6.10 in GLES 3.0.4 spec or Table 20.11 in the GLES 3.1 spec
I think reading sample codes is the best way to understand OpenGL ES, but there is some missing key code in the Ch12 sample code. Can you provide the full sample codes in Chapter 12, Section 10? Thx
Page 236 : Table 9-2 Pixel Storage Options
The description for GL_UNPACK_IMAGE_HEIGHT includes -
"If the value is zero, then the number of columns in the image is equal to the height".
This statement is incorrect (unless the image happens to be square).
It should read -
"If the value is zero, then the column height is equal to the image height" or
"If the value is zero, then the number of rows is equal to the image height"
Fedora 20/21 the code cannot compile using cmake because it cannot find its own header files.
Meanwhile the standard instructions from the book to run cmake ../ from a new build directory:
[min@priara Hello_Triangle]$ pwd
/home/min/Documents/code/opengles3-book/Chapter_2/Hello_Triangle
[min@priara Hello_Triangle]$ mkdir build
[min@priara Hello_Triangle]$ cd build
[min@priara build]$ cmake ..
-- The C compiler identification is GNU 4.9.1
-- The CXX compiler identification is GNU 4.9.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/min/Documents/code/opengles3-book/Chapter_2/Hello_Triangle/build
[min@priara build]$ make
Scanning dependencies of target Hello_Triangle
[100%] Building C object CMakeFiles/Hello_Triangle.dir/Hello_Triangle.c.o
/home/min/Documents/code/opengles3-book/Chapter_2/Hello_Triangle/Hello_Triangle.c:38:20: fatal error: esUtil.h: No such file or directory
#include "esUtil.h"
^
compilation terminated.
CMakeFiles/Hello_Triangle.dir/build.make:54: recipe for target 'CMakeFiles/Hello_Triangle.dir/Hello_Triangle.c.o' failed
make[2]: *** [CMakeFiles/Hello_Triangle.dir/Hello_Triangle.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/Hello_Triangle.dir/all' failed
make[1]: *** [CMakeFiles/Hello_Triangle.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
[min@priara build]$
When attempting to compile the code using gcc by itself, I have managed to resolve all the symbols, but when run the program starts and exits without opening a window, displaying anything, or giving text in the form of an error message.
gcc -o Hello_Triangle Hello_Triangle.c -I../../Common/Include -lEGL -lGLESv2 -lX11 ../../Common/Source/esUtil.c ../../Common/Source/LinuxX11/esUtil_X11.c
This does compile, but does not appear to run properly.
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.3.0-rc1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.0
OpenGL ES profile extensions:
GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5,
GL_APPLE_texture_max_level, GL_EXT_blend_minmax,
GL_EXT_color_buffer_float, GL_EXT_discard_framebuffer,
GL_EXT_map_buffer_range, GL_EXT_multi_draw_arrays,
GL_EXT_read_format_bgra, GL_EXT_separate_shader_objects,
GL_EXT_shader_integer_mix, GL_EXT_texture_compression_dxt1,
GL_EXT_texture_filter_anisotropic, GL_EXT_texture_format_BGRA8888,
GL_EXT_texture_rg, GL_EXT_texture_type_2_10_10_10_REV,
GL_EXT_unpack_subimage, GL_NV_draw_buffers, GL_NV_fbo_color_attachments,
GL_NV_read_buffer, GL_OES_EGL_image, GL_OES_EGL_image_external,
GL_OES_compressed_ETC1_RGB8_texture, GL_OES_depth24, GL_OES_depth_texture,
GL_OES_depth_texture_cube_map, GL_OES_element_index_uint,
GL_OES_fbo_render_mipmap, GL_OES_get_program_binary, GL_OES_mapbuffer,
GL_OES_packed_depth_stencil, GL_OES_rgb8_rgba8,
GL_OES_standard_derivatives, GL_OES_stencil8, GL_OES_surfaceless_context,
GL_OES_texture_3D, GL_OES_texture_npot, GL_OES_vertex_array_object
uname -a
Linux priara.sonnet 3.16.1-301.fc21.x86_64 #1 SMP Mon Aug 25 13:06:39 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Hi, I'm new to opengles.
In "Hello Triangle"'s Shutdown
, you only call glDeleteProgram
. Acctording to the document, glDeleteProgram
doesn't delete the attached shaders. So is it nesscssory to call glDeleteShader
in Shutdown
or in LoadShader
.
When the code for glUniform is presented the glUniform2f version uses the character 'O' instead of the numeral '0'.
Table 6-1 Data Conversion
CL_SHORT max( c / (2^16 -1), -1.0)
I think that this should be
CL_SHORT max( c / (2^15 -1), -1.0)
line 120: glDisableVertexAttribArray ( 1 );
I think that this should be:
glDisableVertexAttribArray ( 0 );
In chapter 12 section "Framebuffer and Renderbuffer Object", it says we can bind a texture image or a renderbuffer object to color attachment or depth attachment of fbo, but we only can attach renderbuffer object to stencil attachment of fbo, so is it illegal to bind a texture to stencil buffer of fbo? The parameter "attachment" of glFramebufferTexture2D() can be GL_STECNCIL_ATTACHMENT, and I have searched the ES 3.0 specification, the spec doesn't say we can't bind a texture to stencil buffer of fbo. So i get confused and looking for help here~
// Bind the buffer object to the uniform block binding point
glBindBufferBase ( GL_UNIFORM_BUFFER, bindingPoint, buffer );
SHOULD BE:
glBindBufferBase ( GL_UNIFORM_BUFFER, bindingPoint, bufferId );
Ginsburg, Dan; Purnomo, Budirijanto; Shreiner, Dave; Munshi, Aaftab (2014-02-28). OpenGL ES 3.0 Programming Guide (2nd Edition) (Kindle Locations 2226-2227). Pearson Education. Kindle Edition.
I have tried to build the sample code on Visual Studio 2008 with the guide in Chapter 16. I used PowerVR SDK 3.5 on windows 7. I have set EGL_LIBRARY & OPENGLE3_LIBRARY to right path: D:\Imagination\PowerVR_Graphics\PowerVR_SDK\SDK_3.5\Builds\Windows\x86_64\Lib\libEGL.lib & libGLESv2.lib. But when i built the Hello_Triangle sample code, i got the following errors. I have tried some ways to fix it but failed. Does anyone have the same problem? Please help me.
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glDeleteShader@4 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glGetShaderInfoLog@16 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glGetShaderiv@12 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glCompileShader@4 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glShaderSource@16 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glCreateShader@4 referenced in function _LoadShader
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glDeleteProgram@4 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glGetProgramInfoLog@16 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glGetProgramiv@12 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glLinkProgram@4 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glAttachShader@8 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glCreateProgram@0 referenced in function _Init
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function _Draw
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glEnableVertexAttribArray@4 referenced in function _Draw
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glVertexAttribPointer@24 referenced in function _Draw
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glUseProgram@4 referenced in function _Draw
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _Draw
2>Hello_Triangle.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _Draw
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglQueryString@8 referenced in function _GetContextRenderableType
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglMakeCurrent@16 referenced in function _esCreateWindow
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglCreateContext@16 referenced in function _esCreateWindow
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglCreateWindowSurface@16 referenced in function _esCreateWindow
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglChooseConfig@20 referenced in function _esCreateWindow
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglInitialize@12 referenced in function _esCreateWindow
2>Common.lib(esUtil.obj) : error LNK2019: unresolved external symbol __imp__eglGetDisplay@4 referenced in function _esCreateWindow
2>Common.lib(esUtil_win32.obj) : error LNK2019: unresolved external symbol __imp__eglSwapBuffers@8 referenced in function _ESWindowProc@16
Book, page 156, glMapBufferRange()
There are two mistakes:
The note say“Instructions for building for each platform are provided in Chapter 16, "OpenGL ES Platforms".” But where is the Chapter 16, Ican't find that. And I open the project at AndroidStudio, IDE warning a lot of error.
So the problem is AndroidStuido can't drectly product apk.
How to do that.
I use powerVRSDK3.5 to set up my visual studio environment.
all the header files and libs are include .
I copy "esUtils.h" and "esUtils_win32.h" to the folder of Include .
all libs are set correctly ,"libEGL.lib","libGLESv2.lib","Common.lib" .
I set subSystem as console .
but here comes the problem as mentioned in the title.
and it shows that problem occurs in "esUtil_win32.obj".
please help me to solve this problem,Even google can not solve this problem.
In printed version p. 120:
varying lowp vec4 color;
Could replace it with keyword out or remove it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.