Fix _draw_polygon colors and uvs
This commit is contained in:
parent
c1df35037f
commit
2b62872547
|
@ -257,7 +257,7 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
|
||||||
//vertex
|
//vertex
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
|
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
|
||||||
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
|
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
|
||||||
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), ((float *)0) + buffer_ofs);
|
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
|
||||||
buffer_ofs += sizeof(Vector2) * p_vertex_count;
|
buffer_ofs += sizeof(Vector2) * p_vertex_count;
|
||||||
//color
|
//color
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
|
||||||
|
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
|
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
|
||||||
glEnableVertexAttribArray(VS::ARRAY_COLOR);
|
glEnableVertexAttribArray(VS::ARRAY_COLOR);
|
||||||
glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), ((float *)0) + buffer_ofs);
|
glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), ((uint8_t *)0) + buffer_ofs);
|
||||||
buffer_ofs += sizeof(Color) * p_vertex_count;
|
buffer_ofs += sizeof(Color) * p_vertex_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
|
||||||
|
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
|
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
|
||||||
glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
|
glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
|
||||||
glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), ((float *)0) + buffer_ofs);
|
glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
|
||||||
buffer_ofs += sizeof(Vector2) * p_vertex_count;
|
buffer_ofs += sizeof(Vector2) * p_vertex_count;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue