diff options
author | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
commit | ea97a373834ea956ad0778b2c535452a6ecb1752 (patch) | |
tree | 9da83b01797e1697bc6f99e999bee927e072b3e0 /source/blender/gpu/intern/gpu_extensions.c | |
parent | 90895fce8ca4f40bd41026b0406d80e8e83e0e8d (diff) | |
parent | 4a78b9e9046567e86ed3ccada83a50c43684facd (diff) |
svn merge -r 22628:22753 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blendervolume25
Diffstat (limited to 'source/blender/gpu/intern/gpu_extensions.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 0b6640b9e27..c61731cef83 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -318,6 +318,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) GPUTexture *tex; GLenum type, format, internalformat; void *pixels = NULL; + float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture"); tex->w = w; @@ -336,7 +337,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) return NULL; } - // if (!GLEW_ARB_texture_non_power_of_two) + if (!GLEW_ARB_texture_non_power_of_two) { tex->w = larger_pow2(tex->w); tex->h = larger_pow2(tex->h); @@ -357,24 +358,15 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) if (fpixels) { glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels); - - /* - if (tex->w > w) - GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h); - if (tex->h > h) - GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h-h); - */ } - // glTexImage3D(tex->target, 0, GL_RGBA, w, h, depth, 0, GL_RGBA, GL_FLOAT, fpixels); - + glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R,GL_CLAMP_TO_BORDER); - if (pixels) MEM_freeN(pixels); |