diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 03:56:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 03:56:59 +0400 |
commit | 84bf3e48c098d6971bab0ac55b4f413adc04708e (patch) | |
tree | 658323440a91d04948d0209053df24b6b728b6ca /source/blender/render/intern | |
parent | 3a0593cc3d5de33248b3a7b913a45729c37dc1b4 (diff) |
style cleanup: use c style comments in C code
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/sunsky.c | 30 | ||||
-rw-r--r-- | source/blender/render/intern/source/texture_ocean.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/volume_precache.c | 21 | ||||
-rw-r--r-- | source/blender/render/intern/source/volumetric.c | 10 | ||||
-rw-r--r-- | source/blender/render/intern/source/voxeldata.c | 6 | ||||
-rw-r--r-- | source/blender/render/intern/source/zbuf.c | 34 |
7 files changed, 55 insertions, 54 deletions
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index b3eb8c0fd5c..8c7f9d9c349 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -175,8 +175,8 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr, /* cache for shadow */ shi->samplenr++; - - shi->xs= 0; // TODO + + shi->xs= 0; /* TODO */ shi->ys= 0; shade_input_set_normals(shi); diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c index 9187bea641d..eeefaae856a 100644 --- a/source/blender/render/intern/source/sunsky.c +++ b/source/blender/render/intern/source/sunsky.c @@ -174,7 +174,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b DirectionToThetaPhi(sunsky->toSun, &sunsky->theta, &sunsky->phi); - sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); // = 6.7443e-05 + sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); /* = 6.7443e-05 */ theta2 = sunsky->theta * sunsky->theta; theta3 = theta2 * sunsky->theta; @@ -183,7 +183,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b chi = (4.0f / 9.0f - T / 120.0f) * ((float)M_PI - 2.0f * sunsky->theta); sunsky->zenith_Y = (4.0453f * T - 4.9710f) * tanf(chi) - 0.2155f * T + 2.4192f; - sunsky->zenith_Y *= 1000; // conversion from kcd/m^2 to cd/m^2 + sunsky->zenith_Y *= 1000; /* conversion from kcd/m^2 to cd/m^2 */ if (sunsky->zenith_Y <= 0) sunsky->zenith_Y = 1e-6; @@ -340,13 +340,13 @@ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3]) m = 1.0f / (cosf(theta) + 0.15f * powf(93.885f - theta / (float)M_PI * 180.0f, -1.253f)); for (i = 0; i < 3; i++) { - // Rayleigh Scattering + /* Rayleigh Scattering */ fTauR = expf(-m * 0.008735f * powf(fLambda[i], (float)(-4.08f))); - // Aerosal (water + dust) attenuation + /* Aerosal (water + dust) attenuation */ fTauA = exp(-m * fBeta * powf(fLambda[i], -fAlpha)); - fTau[i] = fTauR * fTauA; + fTau[i] = fTauR * fTauA; } } @@ -457,23 +457,23 @@ void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float sunDirection[0] = sunSky->toSun[0]; sunDirection[1] = sunSky->toSun[1]; sunDirection[2] = sunSky->toSun[2]; - - costheta = dot_v3v3(view, sunDirection); // cos(theta) - Phase_1 = 1 + (costheta * costheta); // Phase_1 - + + costheta = dot_v3v3(view, sunDirection); /* cos(theta) */ + Phase_1 = 1 + (costheta * costheta); /* Phase_1 */ + VEC3OPF(sunSky->atm_BetaRay, sunSky->atm_BetaRay, *, sunSky->atm_BetaRayMultiplier); VEC3OPF(sunSky->atm_BetaMie, sunSky->atm_BetaMie, *, sunSky->atm_BetaMieMultiplier); VEC3OPV(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie); - - //e^(-(beta_1 + beta_2) * s) = E1 + + /* e^(-(beta_1 + beta_2) * s) = E1 */ VEC3OPF(E1, sunSky->atm_BetaRM, *, -s / (float)M_LN2); E1[0] = exp(E1[0]); E1[1] = exp(E1[1]); E1[2] = exp(E1[2]); copy_v3_v3(E, E1); - - //Phase2(theta) = (1-g^2)/(1+g-2g*cos(theta))^(3/2) + + /* Phase2(theta) = (1-g^2)/(1+g-2g*cos(theta))^(3/2) */ fTemp = 1 + sunSky->atm_HGg - 2 * sunSky->atm_HGg * costheta; fTemp = fTemp * sqrtf(fTemp); Phase_2 = (1 - sunSky->atm_HGg * sunSky->atm_HGg) / fTemp; @@ -491,8 +491,8 @@ void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float VEC3OPF(I, I, *, sunSky->atm_InscatteringMultiplier); VEC3OPF(E, E, *, sunSky->atm_ExtinctionMultiplier); - - //scale to color sun + + /* scale to color sun */ ComputeAttenuatedSunlight(sunSky->theta, sunSky->turbidity, sunColor); VEC3OPV(E, E, *, sunColor); diff --git a/source/blender/render/intern/source/texture_ocean.c b/source/blender/render/intern/source/texture_ocean.c index 4ef88e4740a..5071303dff7 100644 --- a/source/blender/render/intern/source/texture_ocean.c +++ b/source/blender/render/intern/source/texture_ocean.c @@ -81,12 +81,12 @@ int ocean_texture(Tex *tex, float *texvec, TexResult *texres) if (omd->oceancache && omd->cached == TRUE) { CLAMP(cfra, omd->bakestart, omd->bakeend); - cfra -= omd->bakestart; // shift to 0 based + cfra -= omd->bakestart; /* shift to 0 based */ BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra, u, v); } - else { // non-cached + else { /* non-cached */ if (G.rendering) BKE_ocean_eval_uv_catrom(omd->ocean, &ocr, u, v); diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index ea6b9b890ac..c342f179bd1 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -261,14 +261,14 @@ static void lightcache_filter2(VolumePrecache *vp) } #endif -BLI_INLINE int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation -{ +BLI_INLINE int ms_I(int x, int y, int z, int *n) /* has a pad of 1 voxel surrounding the core for boundary simulation */ +{ /* different ordering to light cache */ - return x*(n[1]+2)*(n[2]+2) + y*(n[2]+2) + z; + return x*(n[1]+2)*(n[2]+2) + y*(n[2]+2) + z; } -BLI_INLINE int v_I_pad(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation -{ +BLI_INLINE int v_I_pad(int x, int y, int z, int *n) /* has a pad of 1 voxel surrounding the core for boundary simulation */ +{ /* same ordering to light cache, with padding */ return z*(n[1]+2)*(n[0]+2) + y*(n[0]+2) + x; } @@ -526,10 +526,10 @@ static void *vol_precache_part(void *data) /* convert from world->camera space for shading */ mul_v3_m4v3(cco, pa->viewmat, co); - + i = BLI_VOXEL_INDEX(x, y, z, res); - - // don't bother if the point is not inside the volume mesh + + /* don't bother if the point is not inside the volume mesh */ if (!point_inside_obi(tree, obi, cco)) { obi->volume_precache->data_r[i] = -1.0f; obi->volume_precache->data_g[i] = -1.0f; @@ -563,7 +563,7 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi shi->mask= 1; shi->mat = ma; shi->vlr = NULL; - memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h + memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); /* note, keep this synced with render_types.h */ shi->har= shi->mat->har; shi->obi= obi; shi->obr= obi->obr; @@ -757,7 +757,8 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o BLI_freelistN(&re->volume_precache_parts); if (tree) { - //TODO: makeraytree_object creates a tree and saves it on OBI, if we free this tree we should also clear other pointers to it + /* TODO: makeraytree_object creates a tree and saves it on OBI, + * if we free this tree we should also clear other pointers to it */ //RE_rayobject_free(tree); //tree= NULL; } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index c1f85914479..e0d3325106a 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -253,9 +253,9 @@ static float metadensity(Object *ob, const float co[3]) /* element rotation transform */ float tp[3] = {ml->x - tco[0], ml->y - tco[1], ml->z - tco[2]}; quat_to_mat3(bmat, ml->quat); - transpose_m3(bmat); // rot.only, so inverse == transpose + transpose_m3(bmat); /* rot.only, so inverse == transpose */ mul_m3_v3(bmat, tp); - + /* MB_BALL default */ switch (ml->type) { case MB_ELIPSOID: @@ -263,14 +263,14 @@ static float metadensity(Object *ob, const float co[3]) break; case MB_CUBE: tp[2] = (tp[2] > ml->expz) ? (tp[2] - ml->expz) : ((tp[2] < -ml->expz) ? (tp[2] + ml->expz) : 0.f); - // no break, xy as plane + /* no break, xy as plane */ case MB_PLANE: tp[1] = (tp[1] > ml->expy) ? (tp[1] - ml->expy) : ((tp[1] < -ml->expy) ? (tp[1] + ml->expy) : 0.f); - // no break, x as tube + /* no break, x as tube */ case MB_TUBE: tp[0] = (tp[0] > ml->expx) ? (tp[0] - ml->expx) : ((tp[0] < -ml->expx) ? (tp[0] + ml->expx) : 0.f); } - + /* ml->rad2 is not set */ dist2 = 1.0f - (dot_v3v3(tp, tp) / (ml->rad * ml->rad)); if (dist2 > 0.f) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 7d54f77fc90..ee766311a33 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -240,7 +240,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) copy_v3_v3_int(vd->resol, smd->domain->res); totRes = vd_resol_size(vd); - // scaling heat values from -2.0-2.0 to 0.0-1.0 + /* scaling heat values from -2.0-2.0 to 0.0-1.0 */ vd->dataset = MEM_mapallocN(sizeof(float) * (totRes), "smoke data"); @@ -250,7 +250,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) vd->dataset[i] = (heat[i] + 2.0f) / 4.0f; } - //vd->dataset = smoke_get_heat(smd->domain->fluid); + /* vd->dataset = smoke_get_heat(smd->domain->fluid); */ } else if (vd->smoked_type == TEX_VD_SMOKEVEL) { size_t totRes; @@ -260,7 +260,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) copy_v3_v3_int(vd->resol, smd->domain->res); totRes = vd_resol_size(vd); - // scaling heat values from -2.0-2.0 to 0.0-1.0 + /* scaling heat values from -2.0-2.0 to 0.0-1.0 */ vd->dataset = MEM_mapallocN(sizeof(float) * (totRes), "smoke data"); xvel = smoke_get_velocity_x(smd->domain->fluid); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index c88858c44da..fc3dae73d6b 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -1447,21 +1447,21 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2, zxd= -(double)x0/(double)z0; zyd= -(double)y0/(double)z0; zy0= ((double)my2)*zyd + (double)xx1; - - z1= 1.0f; // (u1 - u2) - z2= 0.0f; // (u2 - u3) + + z1= 1.0f; /* (u1 - u2) */ + z2= 0.0f; /* (u2 - u3) */ x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; - - xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f; + + xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f; uxd= -(double)x0/(double)z0; uyd= -(double)y0/(double)z0; uy0= ((double)my2)*uyd + (double)xx1; - z1= -1.0f; // (v1 - v2) - z2= 1.0f; // (v2 - v3) - + z1= -1.0f; /* (v1 - v2) */ + z2= 1.0f; /* (v2 - v3) */ + x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; @@ -1535,23 +1535,23 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float * y1= v1[1]- v2[1]; y2= v2[1]- v3[1]; - z1= 1.0f; // (u1 - u2) - z2= 0.0f; // (u2 - u3) - + z1= 1.0f; /* (u1 - u2) */ + z2= 0.0f; /* (u2 - u3) */ + x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; z0= x1*y2-y1*x2; - + if (z0==0.0f) return; - - xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f; + + xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f; uxd= -(double)x0/(double)z0; uyd= -(double)y0/(double)z0; uy0= ((double)my2)*uyd + (double)xx1; - z1= -1.0f; // (v1 - v2) - z2= 1.0f; // (v2 - v3) - + z1= -1.0f; /* (v1 - v2) */ + z2= 1.0f; /* (v2 - v3) */ + x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; |