Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2009-09-16 21:43:09 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-09-16 21:43:09 +0400
commitdeebf4f8f0d79169a0e6c2a391670419b6492bfe (patch)
tree2a0aaf4042aa78e9d1d835f4544e07c6123e67a9 /source/blender/gpu
parent6b0679a3999d8e5abc60730f523879eadbedcd8f (diff)
merge with 2.5/trunk at r23271
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/CMakeLists.txt4
-rw-r--r--source/blender/gpu/GPU_draw.h2
-rw-r--r--source/blender/gpu/SConscript4
-rw-r--r--source/blender/gpu/intern/Makefile1
-rw-r--r--source/blender/gpu/intern/gpu_draw.c16
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c21
6 files changed, 34 insertions, 14 deletions
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 4d376f47d91..279596e5ad7 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -27,8 +27,8 @@
FILE(GLOB SRC intern/*.c)
SET(INC
- . ../blenlib ../blenkernel ../makesdna ../include
- ../../../extern/glew/include ../../../intern/guardedalloc ../imbuf)
+ . ../blenlib ../blenkernel ../makesdna ../include
+ ../../../extern/glew/include ../../../intern/guardedalloc ../../../intern/smoke/extern ../imbuf)
BLENDERLIB(bf_gpu "${SRC}" "${INC}")
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 00d0e3131e5..fabe1420e83 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -115,7 +115,7 @@ void GPU_free_images(void);
/* smoke drawing functions */
void GPU_free_smoke(struct SmokeModifierData *smd);
-void GPU_create_smoke(struct SmokeModifierData *smd);
+void GPU_create_smoke(struct SmokeModifierData *smd, int highres);
#ifdef __cplusplus
}
diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript
index 63f5fe53238..7e700c177e4 100644
--- a/source/blender/gpu/SConscript
+++ b/source/blender/gpu/SConscript
@@ -4,8 +4,8 @@ Import ('env')
sources = env.Glob('intern/*.c')
incs = '../blenlib ../blenkernel ../makesdna ../include'
-incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .'
+incs += ' #/extern/glew/include #intern/guardedalloc #intern/smoke/extern ../imbuf .'
incs += ' ' + env['BF_OPENGL_INC']
-env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[160, 20] )
+env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core','player'], priority=[160,110] )
diff --git a/source/blender/gpu/intern/Makefile b/source/blender/gpu/intern/Makefile
index 3a3ac20ff6c..2637bff44ac 100644
--- a/source/blender/gpu/intern/Makefile
+++ b/source/blender/gpu/intern/Makefile
@@ -47,6 +47,7 @@ CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I$(NAN_SMOKE)/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I../
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index a81c7e03455..75e8073aafd 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -64,6 +64,8 @@
#include "GPU_material.h"
#include "GPU_draw.h"
+#include "smoke_API.h"
+
/* These are some obscure rendering functions shared between the
* game engine and the blender, in this module to avoid duplicaten
* and abstract them away from the rest a bit */
@@ -754,13 +756,21 @@ void GPU_free_smoke(SmokeModifierData *smd)
if(smd->domain->tex)
GPU_texture_free(smd->domain->tex);
smd->domain->tex = NULL;
+
+ if(smd->domain->tex_shadow)
+ GPU_texture_free(smd->domain->tex_shadow);
+ smd->domain->tex_shadow = NULL;
}
}
-void GPU_create_smoke(SmokeModifierData *smd)
+void GPU_create_smoke(SmokeModifierData *smd, int highres)
{
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex)
- smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->view3d);
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && !highres)
+ smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smoke_get_density(smd->domain->fluid));
+ else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && highres)
+ smd->domain->tex = GPU_texture_create_3D(smd->domain->res_wt[0], smd->domain->res_wt[1], smd->domain->res_wt[2], smoke_turbulence_get_density(smd->domain->wt));
+
+ smd->domain->tex_shadow = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->shadow);
}
void GPU_free_image(Image *ima)
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 850b46dc28c..55e4b337a77 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -346,25 +346,34 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
tex->number = 0;
glBindTexture(tex->target, tex->bindcode);
- type = GL_UNSIGNED_BYTE;
- format = GL_RGBA;
- internalformat = GL_RGBA8;
+ GPU_print_error("3D glBindTexture");
- if (fpixels)
- pixels = GPU_texture_convert_pixels(w*h*depth, fpixels);
+ type = GL_FLOAT; // GL_UNSIGNED_BYTE
+ format = GL_RED;
+ internalformat = GL_INTENSITY;
+
+ //if (fpixels)
+ // pixels = GPU_texture_convert_pixels(w*h*depth, fpixels);
glTexImage3D(tex->target, 0, internalformat, tex->w, tex->h, tex->depth, 0, format, type, 0);
+ GPU_print_error("3D glTexImage3D");
+
if (fpixels) {
- glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels);
+ glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, fpixels);
+ GPU_print_error("3D glTexSubImage3D");
}
+
glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor);
+ GPU_print_error("3D GL_TEXTURE_BORDER_COLOR");
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ GPU_print_error("3D 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);
+ GPU_print_error("3D GL_CLAMP_TO_BORDER");
if (pixels)
MEM_freeN(pixels);