forked from bartvdbraak/blender
minor edits, no functional change.
This commit is contained in:
parent
6582d30c26
commit
bad785cce4
@ -172,6 +172,7 @@ static void displaceModifier_do(
|
|||||||
MDeformVert *dvert = NULL;
|
MDeformVert *dvert = NULL;
|
||||||
int defgrp_index;
|
int defgrp_index;
|
||||||
float (*tex_co)[3];
|
float (*tex_co)[3];
|
||||||
|
float weight= 1.0f; /* init value unused but some compilers may complain */
|
||||||
|
|
||||||
if(!dmd->texture) return;
|
if(!dmd->texture) return;
|
||||||
if(dmd->strength == 0.0f) return;
|
if(dmd->strength == 0.0f) return;
|
||||||
@ -189,17 +190,10 @@ static void displaceModifier_do(
|
|||||||
for(i = 0; i < numVerts; ++i) {
|
for(i = 0; i < numVerts; ++i) {
|
||||||
TexResult texres;
|
TexResult texres;
|
||||||
float delta = 0, strength = dmd->strength;
|
float delta = 0, strength = dmd->strength;
|
||||||
MDeformWeight *def_weight = NULL;
|
|
||||||
|
|
||||||
if(dvert) {
|
if(dvert) {
|
||||||
int j;
|
weight= defvert_find_weight(dvert + i, defgrp_index);
|
||||||
for(j = 0; j < dvert[i].totweight; ++j) {
|
if(weight == 0.0f) continue;
|
||||||
if(dvert[i].dw[j].def_nr == defgrp_index) {
|
|
||||||
def_weight = &dvert[i].dw[j];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!def_weight || def_weight->weight==0.0f) continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
texres.nor = NULL;
|
texres.nor = NULL;
|
||||||
@ -207,7 +201,7 @@ static void displaceModifier_do(
|
|||||||
|
|
||||||
delta = texres.tin - dmd->midlevel;
|
delta = texres.tin - dmd->midlevel;
|
||||||
|
|
||||||
if(def_weight) strength *= def_weight->weight;
|
if(dvert) strength *= weight;
|
||||||
|
|
||||||
delta *= strength;
|
delta *= strength;
|
||||||
CLAMP(delta, -10000, 10000);
|
CLAMP(delta, -10000, 10000);
|
||||||
|
@ -266,7 +266,7 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize,
|
|||||||
#define RE_BAKE_ALPHA 11
|
#define RE_BAKE_ALPHA 11
|
||||||
#define RE_BAKE_EMIT 12
|
#define RE_BAKE_EMIT 12
|
||||||
|
|
||||||
void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, int type, struct Object *actob);
|
void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, const int type, struct Object *actob);
|
||||||
|
|
||||||
void RE_DataBase_GetView(struct Render *re, float mat[][4]);
|
void RE_DataBase_GetView(struct Render *re, float mat[][4]);
|
||||||
void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]);
|
void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]);
|
||||||
|
@ -5680,12 +5680,13 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
|
|||||||
RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects
|
RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects
|
||||||
RE_BAKE_SHADOW: for baking, only shadows, but all objects
|
RE_BAKE_SHADOW: for baking, only shadows, but all objects
|
||||||
*/
|
*/
|
||||||
void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, int type, Object *actob)
|
void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, const int type, Object *actob)
|
||||||
{
|
{
|
||||||
Object *camera;
|
Object *camera;
|
||||||
float mat[4][4];
|
float mat[4][4];
|
||||||
float amb[3];
|
float amb[3];
|
||||||
int onlyselected, nolamps;
|
const short onlyselected= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW);
|
||||||
|
const short nolamps= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT);
|
||||||
|
|
||||||
re->main= bmain;
|
re->main= bmain;
|
||||||
re->scene= scene;
|
re->scene= scene;
|
||||||
@ -5755,9 +5756,6 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
|
|||||||
set_node_shader_lamp_loop(shade_material_loop);
|
set_node_shader_lamp_loop(shade_material_loop);
|
||||||
|
|
||||||
/* MAKE RENDER DATA */
|
/* MAKE RENDER DATA */
|
||||||
nolamps= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW);
|
|
||||||
onlyselected= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT);
|
|
||||||
|
|
||||||
database_init_objects(re, lay, nolamps, onlyselected, actob, 0);
|
database_init_objects(re, lay, nolamps, onlyselected, actob, 0);
|
||||||
|
|
||||||
set_material_lightgroups(re);
|
set_material_lightgroups(re);
|
||||||
|
Loading…
Reference in New Issue
Block a user