diff options
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/rasterizer_gles3.cpp | 8 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 4 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 13 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 2 |
4 files changed, 20 insertions, 7 deletions
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index bf3b902c5c..ccc5c70c97 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -42,7 +42,13 @@ RasterizerScene *RasterizerGLES3::get_scene() { #define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148 #define _EXT_DEBUG_OUTPUT 0x92E0 -static void _gl_debug_print(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam) +#ifdef WINDOWS_ENABLED +#define GLAPIENTRY APIENTRY +#else +#define GLAPIENTRY +#endif + +static void GLAPIENTRY _gl_debug_print(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam) { if (type==_EXT_DEBUG_TYPE_OTHER_ARB) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index d380d8d149..7fdd08a834 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1337,6 +1337,7 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { if (s->index_array_len>0) { + glDrawElements(gl_primitive[s->primitive],s->index_array_len, (s->array_len>=(1<<16))?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT,0); storage->info.render_vertices_count+=s->index_array_len; @@ -1349,6 +1350,9 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { } + + + } break; case VS::INSTANCE_MULTIMESH: { diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index ec71f64049..ffcd462808 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2481,6 +2481,8 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P for(int i=0;i<VS::ARRAY_MAX;i++) { + attribs[i].index=i; + if (! (p_format&(1<<i) ) ) { attribs[i].enabled=false; attribs[i].integer=false; @@ -2489,7 +2491,6 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P attribs[i].enabled=true; attribs[i].offset=stride; - attribs[i].index=i; attribs[i].integer=false; switch(i) { @@ -2499,7 +2500,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P if (p_format&VS::ARRAY_FLAG_USE_2D_VERTICES) { attribs[i].size=2; } else { - attribs[i].size=3; + attribs[i].size=(p_format&VS::ARRAY_COMPRESS_VERTEX)?4:3; } if (p_format&VS::ARRAY_COMPRESS_VERTEX) { @@ -2719,18 +2720,20 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,surface->index_id); glBufferData(GL_ELEMENT_ARRAY_BUFFER,index_array_size,ir.ptr(),GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); //unbind + + } //generate arrays for faster state switching - for(int i=0;i<2;i++) { + for(int ai=0;ai<2;ai++) { - if (i==0) { + if (ai==0) { //for normal draw glGenVertexArrays(1,&surface->array_id); glBindVertexArray(surface->array_id); glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); - } else if (i==1) { + } else if (ai==1) { //for instancing draw (can be changed and no one cares) glGenVertexArrays(1,&surface->instancing_array_id); glBindVertexArray(surface->instancing_array_id); diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 2dfbbd340d..b0b2782307 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -872,7 +872,7 @@ vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, b dist += diameter * 0.5; } - color.rgb = mix(color.rgb,mix(ambient,color.rgb,alpha),blend_ambient); + //color.rgb = mix(color.rgb,mix(ambient,color.rgb,alpha),blend_ambient); return color.rgb; } |