summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_gles2.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-06-19 02:23:03 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-06-19 02:23:03 -0300
commite086bccd63e64b8d3bd2b6b5ce000ef8abd71584 (patch)
treed2923624c8d79c1ff27dce9da26d6e9c6f0bc906 /drivers/gles2/rasterizer_gles2.cpp
parentddc0e7fd3bc00afa33432ed594038dbb80c7fea3 (diff)
Import 3D Scene Improvements
-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -If re-importing from the "dependency changed" dialog, edited scene will keep the local changes. -Imported scene will keep track of changes in the source asset -Geometry changes in source geometry or nodes with a different transform will be updated. -Materials will be kept if changed locally. -New nodes added will be kept -If nodes were reparented or renamed, they will still keep track -Deleted notes will be restored, use the -noimp option to avoid this. -In general, you can trust that if you do local modifications to the imported scene, they will not be erased after re-import. -Erasing your changes is done by re-importing from the "Re-Import" menu, re-opening the "Import 3D Scene" dialog. This wil re-import fresh. Overall, This should allow you to work on a scene and see changes made to 3D assets in real-time. So Please test!!
Diffstat (limited to 'drivers/gles2/rasterizer_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index c9952c6fb8..d660d02f6c 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -49,6 +49,12 @@
#define _GL_R16F_EXT 0x822D
#define _GL_R32F_EXT 0x822E
+
+#define _GL_RED_EXT 0x1903
+#define _GL_RG_EXT 0x8227
+#define _GL_R8_EXT 0x8229
+#define _GL_RG8_EXT 0x822B
+
#define _DEPTH_COMPONENT24_OES 0x81A6
#ifdef GLEW_ENABLED
@@ -7874,6 +7880,7 @@ void RasterizerGLES2::_update_framebuffer() {
glDeleteFramebuffers(1,&framebuffer.luminance[i].fbo);
}
+
for(int i=0;i<3;i++) {
glDeleteTextures(1,&framebuffer.blur[i].color);
@@ -7925,12 +7932,15 @@ void RasterizerGLES2::_update_framebuffer() {
#endif
//color
- GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA;
+// GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA;
+ GLuint format_rgba = GL_RGBA;
GLuint format_rgb = use_fp16_fb?_GL_RGB16F_EXT:GL_RGB;
GLuint format_type = use_fp16_fb?_GL_HALF_FLOAT_OES:GL_UNSIGNED_BYTE;
- GLuint format_luminance = use_fp16_fb?_GL_R32F_EXT:GL_RGBA;
- GLuint format_luminance_type = use_fp16_fb?GL_FLOAT:GL_UNSIGNED_BYTE;
- GLuint format_luminance_components = use_fp16_fb?GL_RED:GL_RGBA;
+ GLuint format_luminance = use_fp16_fb?_GL_RED_EXT:GL_RGBA;
+ GLuint format_luminance_type = use_fp16_fb?(full_float_fb_supported?GL_FLOAT:_GL_HALF_FLOAT_OES):GL_UNSIGNED_BYTE;
+ GLuint format_luminance_components = use_fp16_fb?_GL_RED_EXT:GL_RGBA;
+
+
glGenTextures(1, &framebuffer.color);
glBindTexture(GL_TEXTURE_2D, framebuffer.color);
@@ -8085,10 +8095,12 @@ void RasterizerGLES2::_update_framebuffer() {
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ base_size/=3;
+
DEBUG_TEST_ERROR("Shadow Buffer Init");
ERR_CONTINUE( status != GL_FRAMEBUFFER_COMPLETE );
- base_size/=3;
framebuffer.luminance.push_back(lb);
}
@@ -8239,6 +8251,7 @@ void RasterizerGLES2::init() {
// use_attribute_instancing=true;
use_texture_instancing=false;
use_attribute_instancing=true;
+ full_float_fb_supported=true;
#ifdef OSX_ENABLED
use_rgba_shadowmaps=true;
use_fp16_fb=false;
@@ -8291,9 +8304,11 @@ void RasterizerGLES2::init() {
}
if (use_fp16_fb) {
- use_fp16_fb=extensions.has("GL_OES_texture_half_float") && extensions.has("GL_EXT_color_buffer_half_float");
+ use_fp16_fb=extensions.has("GL_OES_texture_half_float") && extensions.has("GL_EXT_color_buffer_half_float") && extensions.has("GL_EXT_texture_rg");
}
+ full_float_fb_supported=extensions.has("GL_EXT_color_buffer_float");
+
//etc_supported=false;
use_hw_skeleton_xform=false;