[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22746] branches/blender2.5/blender/source /blender: Smoke:
Daniel Genrich
daniel.genrich at gmx.net
Mon Aug 24 23:06:56 CEST 2009
Revision: 22746
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22746
Author: genscher
Date: 2009-08-24 23:06:55 +0200 (Mon, 24 Aug 2009)
Log Message:
-----------
Smoke:
* Bugfix for scaling on non-2^n-textures
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/space_view3d/drawvolume.c
branches/blender2.5/blender/source/blender/gpu/intern/gpu_extensions.c
Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/drawvolume.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/drawvolume.c 2009-08-24 14:26:58 UTC (rev 22745)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/drawvolume.c 2009-08-24 21:06:55 UTC (rev 22746)
@@ -197,7 +197,6 @@
RegionView3D *rv3d= ar->regiondata;
float viewnormal[3];
- // int res[3];
int i, j, n;
float d, d0, dd;
float *points = NULL;
@@ -237,9 +236,12 @@
GPU_texture_bind(tex, 0);
- cor[0] = (float)res[0]/(float)larger_pow2(res[0]);
- cor[1] = (float)res[1]/(float)larger_pow2(res[1]);
- cor[2] = (float)res[2]/(float)larger_pow2(res[2]);
+ // if (!GLEW_ARB_texture_non_power_of_two)
+ {
+ cor[0] = (float)res[0]/(float)larger_pow2(res[0]);
+ cor[1] = (float)res[1]/(float)larger_pow2(res[1]);
+ cor[2] = (float)res[2]/(float)larger_pow2(res[2]);
+ }
// our slices are defined by the plane equation a*x + b*y +c*z + d = 0
// (a,b,c), the plane normal, are given by viewdir
Modified: branches/blender2.5/blender/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/blender2.5/blender/source/blender/gpu/intern/gpu_extensions.c 2009-08-24 14:26:58 UTC (rev 22745)
+++ branches/blender2.5/blender/source/blender/gpu/intern/gpu_extensions.c 2009-08-24 21:06:55 UTC (rev 22746)
@@ -326,6 +326,7 @@
tex->number = -1;
tex->refcount = 1;
tex->target = GL_TEXTURE_3D;
+ float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f};
glGenTextures(1, &tex->bindcode);
@@ -336,7 +337,7 @@
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,22 +358,14 @@
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);
+ 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)
More information about the Bf-blender-cvs
mailing list