LearnOpenGL

  1. 311-Instancing(sphere),在使用实例的时候,第二个model占用4个location,所以第三个insColor要指定location=5

    layout (location = 0) in vec3 position;
    layout (location = 1) in mat4 model;
    layout (location = 5) in vec4 insColor;
    

  2. Indicies 指的是单个实例的模型从哪个offset开始画,而不是这个实例的第offset个开始画
    void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void *indicies, GLsizei primcount);
    

Leave a Reply

Your email address will not be published. Required fields are marked *