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:
authorDaniel Genrich <daniel.genrich@gmx.net>2009-08-02 23:40:25 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2009-08-02 23:40:25 +0400
commitee11ca62bd86480e3bc2ff3ba7d495e51fad20a5 (patch)
treed43917cedd600d6d9d014e46e06ffbc201924cec
parentdc75023f6ff54d1b7c99360260fa3e70a4e42005 (diff)
Smoke: 2 preview fixes
a) take first position lamp into accountn for smoke ligthning (still no realtime shading when you move the lamp - you have to simulate another frame for now) b) fix front/back "looking throurgh" issue by reordering the billboards
-rw-r--r--source/blender/editors/space_view3d/drawobject.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index fc700d8a8ad..24306fa6298 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5344,7 +5344,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
int x, y, z, i;
float viewnormal[3];
int mainaxis[3] = {0,0,0};
- float align = 0;
+ float align = 0, signed_align = 0;
int max_textures = 0, counter_textures = 0;
float *buffer = NULL;
int res[3];
@@ -5386,6 +5386,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
{
mainaxis[0] = i;
align = ABS(viewnormal[i]);
+ signed_align = viewnormal[i];
}
}
mainaxis[1] = (mainaxis[0] + 1) % 3;
@@ -5438,8 +5439,23 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(new > 1)
{
- float light[3] = {0.0,0.0,2.0};
-
+ float light[3] = {0.0,0.0,2.0}; // TODO: take real LAMP coordinates - dg
+ Base *base_tmp = NULL;
+
+ for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next)
+ {
+ if(base_tmp->object->type == OB_LAMP)
+ {
+ Lamp *la = (Lamp *)base_tmp->object->data;
+
+ if(la->type == LA_LOCAL)
+ {
+ VECCOPY(light, base_tmp->object->obmat[3]);
+ break;
+ }
+ }
+ }
+
if(!big && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SMALL))
{
smoke_prepare_View(smd, light);
@@ -5486,7 +5502,17 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
mod_texture = MAX3(1, smd->domain->visibility, (int)(res[mainaxis[0]] / smd->domain->max_textures ));
- for (z = 0; z < res[mainaxis[0]]; z++) // 2
+ // align order of billboards to be front or backview (e.g. +x or -x axis)
+ if(signed_align < 0)
+ {
+ z = res[mainaxis[0]] - 1;
+ }
+ else
+ {
+ z = 0;
+ }
+
+ for (; signed_align > 0 ? (z < res[mainaxis[0]]) : (z >= 0); signed_align > 0 ? z++ : z--) // 2
{
float quad[4][3];