glMapBuffer(GL_ARRAYBUFFER, GL_WRITE_ONLY); // return a void* to buffer adress memory. (Usefull to load from file to GPU without stocking in temp memory)
memcpy(ptr, data, sizeof(data)); // -- copy the data and then
GlUnmapBuffer(); // unmap the pointer.
// -- Prototype
void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeptr size);
// -- You can bind to two specials buffers : copy and read buffer
glBindBuffer(GL_COPY_READ_BUFFER, vbo1);
glBindBuffer(GL_COPY_WRITE_BUFFER, vbo2);
// -- Then this read from vbo1 with 0 offset and copy to vbo2 with 0, 8 * sizeof(float) datas !
glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 8 * sizeof(float));
// Vertex
gl_Position // output vector of vertex shader
gl_PointSize //influence point size when glEnable(GL_PROGRAM_POINT_SIZE); Fun and usefull for particles
gl_VertexID // Current vertex ID (Was usefull in Veritasium grass video)
// Fragment
gl_FragColor // output color
gl_FragCoord // fragment coord : Z value = depth // x/y = Screen Space Coordinates !
gl_FrontFacing // true or false if facing use - Create Curses