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:
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/convertblender.c16
-rw-r--r--source/blender/render/intern/source/rayshade.c2
-rw-r--r--source/blender/render/intern/source/render_texture.c17
-rw-r--r--source/blender/render/intern/source/volume_precache.c4
-rw-r--r--source/blender/render/intern/source/volumetric.c18
-rw-r--r--source/blender/render/intern/source/voxeldata.c6
6 files changed, 35 insertions, 28 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index b385b507707..f749d1ba004 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -192,10 +192,10 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
/* minimal free space (starting at camera) */
starmindist= wrld->starmindist;
- if (stargrid <= 0.10) return;
+ if (stargrid <= 0.10f) return;
if (re) re->flag |= R_HALO;
- else stargrid *= 1.0; /* then it draws fewer */
+ else stargrid *= 1.0f; /* then it draws fewer */
if(re) invert_m4_m4(mat, re->viewmat);
else unit_m4(mat);
@@ -267,17 +267,17 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
if (alpha >= clipend) alpha = 0.0;
else if (alpha <= starmindist) alpha = 0.0;
- else if (alpha <= 2.0 * starmindist) {
+ else if (alpha <= 2.0f * starmindist) {
alpha = (alpha - starmindist) / starmindist;
} else {
- alpha -= 2.0 * starmindist;
- alpha /= (clipend - 2.0 * starmindist);
- alpha = 1.0 - alpha;
+ alpha -= 2.0f * starmindist;
+ alpha /= (clipend - 2.0f * starmindist);
+ alpha = 1.0f - alpha;
}
}
- if (alpha != 0.0) {
+ if (alpha != 0.0f) {
fac = force * BLI_drand();
har = initstar(re, obr, vec, fac);
@@ -822,7 +822,7 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[][4], int d
if(obr->totvert==0) return;
asverts= MEM_callocN(sizeof(ASvert)*obr->totvert, "all smooth verts");
- thresh= cos( M_PI*(0.5f+(float)degr)/180.0 );
+ thresh= cosf((float)M_PI*(0.5f+(float)degr)/180.0f );
/* step zero: give faces normals of original mesh, if this is provided */
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 34d3adcf15b..d62f411a7c5 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -1679,7 +1679,7 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
/* not used, test function for ambient occlusion (yaf: pathlight) */
/* main problem; has to be called within shading loop, giving unwanted recursion */
-static int ray_trace_shadow_rad(ShadeInput *ship, ShadeResult *shr)
+static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *shr)
{
static int counter=0, only_one= 0;
extern float hashvectf[];
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 5aad055a8f6..579afc21c1d 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -2084,14 +2084,21 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
if(tex->ima) {
- // crazy hack solution that gives results similar to normal mapping - part 2
float vec[2];
+ int dimx=512, dimy=512;
+ ImBuf* ibuf = BKE_image_get_ibuf(tex->ima, &tex->iuser);
+ if (ibuf) {
+ dimx = ibuf->x;
+ dimy = ibuf->y;
+ }
+
+ // crazy hack solution that gives results similar to normal mapping - part 2
- vec[0] = tex->ima->gen_x*dxt[0];
- vec[1] = tex->ima->gen_y*dxt[1];
+ vec[0] = dimx*dxt[0];
+ vec[1] = dimy*dxt[1];
dHdx *= 1.0f/len_v2(vec);
- vec[0] = tex->ima->gen_x*dyt[0];
- vec[1] = tex->ima->gen_y*dyt[1];
+ vec[0] = dimx*dyt[0];
+ vec[1] = dimy*dyt[1];
dHdy *= 1.0f/len_v2(vec);
}
}
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index faa915b7f6c..2037acc943f 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -400,7 +400,7 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
sb[j] += vp->data_b[i];
/* Displays progress every second */
- if(time-lasttime>1.0f) {
+ if(time-lasttime>1.0) {
char str[64];
BLI_snprintf(str, sizeof(str), "Simulating multiple scattering: %d%%", (int)(100.0f * (c / total)));
re->i.infostr= str;
@@ -747,7 +747,7 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
caching=0;
time= PIL_check_seconds_timer();
- if(time-lasttime>1.0f) {
+ if(time-lasttime>1.0) {
char str[64];
BLI_snprintf(str, sizeof(str), "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts)));
re->i.infostr= str;
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 359002d05ae..19bbb11e143 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -422,9 +422,9 @@ static void vol_get_transmittance_seg(ShadeInput *shi, float *tr, float stepsize
tau[1] += stepd * sigma_t[1];
tau[2] += stepd * sigma_t[2];
- tr[0] *= exp(-tau[0]);
- tr[1] *= exp(-tau[1]);
- tr[2] *= exp(-tau[2]);
+ tr[0] *= expf(-tau[0]);
+ tr[1] *= expf(-tau[1]);
+ tr[2] *= expf(-tau[2]);
}
/* Compute transmittance = e^(-attenuation) */
@@ -473,7 +473,7 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar,
if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return;
if ((lar->lay & shi->lay)==0) return;
- if (lar->energy == 0.0) return;
+ if (lar->energy == 0.0f) return;
if ((visifac= lamp_get_visibility(lar, co, lv, &lampdist)) == 0.f) return;
@@ -613,7 +613,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float
/* transmittance component (alpha) */
vol_get_transmittance_seg(shi, tr, stepsize, co, density);
- if (t0 > t1 * 0.25) {
+ if (t0 > t1 * 0.25f) {
/* only use depth cutoff after we've traced a little way into the volume */
if (luminance(tr) < shi->mat->vol.depth_cutoff) break;
}
@@ -623,9 +623,9 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float
if (shi->obi->volume_precache) {
float p2[3];
- p2[0] = p[0] + (step_vec[0] * 0.5);
- p2[1] = p[1] + (step_vec[1] * 0.5);
- p2[2] = p[2] + (step_vec[2] * 0.5);
+ p2[0] = p[0] + (step_vec[0] * 0.5f);
+ p2[1] = p[1] + (step_vec[1] * 0.5f);
+ p2[2] = p[2] + (step_vec[2] * 0.5f);
vol_get_precached_scattering(&R, shi, scatter_col, p2);
} else
@@ -817,7 +817,7 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr)
volume_trace(shi, shr, VOL_SHADE_INSIDE);
shr->alpha = shr->alpha + prev_alpha;
- CLAMP(shr->alpha, 0.0, 1.0);
+ CLAMP(shr->alpha, 0.0f, 1.0f);
shi->mat = mat_backup;
shi->obi = obi_backup;
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 232f7fdeede..2ba346ae4c5 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -413,9 +413,9 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres)
}
case TEX_REPEAT:
{
- co[0] = co[0] - floor(co[0]);
- co[1] = co[1] - floor(co[1]);
- co[2] = co[2] - floor(co[2]);
+ co[0] = co[0] - floorf(co[0]);
+ co[1] = co[1] - floorf(co[1]);
+ co[2] = co[2] - floorf(co[2]);
break;
}
case TEX_EXTEND: