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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-12-19 18:23:12 +0300
committerTon Roosendaal <ton@blender.org>2003-12-19 18:23:12 +0300
commit0060be66035a13939f7d9f8f8e27170c709e82f4 (patch)
tree3e0eb4978dff3f2b3eb1be6c20e474eb2ccd9099 /source
parent2cac5e0dda9390962707cd93d512d72b64711fcf (diff)
More render stuff:
- added 'Mapping to" channel "RayMirror", to control mirror with texture - fixed bug in using mirror-rgb as texture channel... this is cumbersome because it is abused by Envmap in a not nice way. Fixing the abuse will cause compatibility errors, which can be fixed when we up release # to 2.32. - added "Translucency", which is nothing else than allowing another shading pass for the backside of a face (with normal inverted). This is interesting for all kinds of situations where you want light from behind to 'shine through'. Also works to reduce dark areas in unlighted parts of rendering transparent faces. Light from behind on transparent red window should make it glowing some, right?! - added texture channel for this as well - Reorganized Material Panels to reveil some consistancy where buttons can be found. Not perfect yet, but at least all options for Shaders and options for Mirror & Transparency now are together. This gives some space in Shader Panel for nice expansion.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/texture.c50
-rw-r--r--source/blender/makesdna/DNA_material_types.h3
-rw-r--r--source/blender/render/intern/source/ray.c69
-rw-r--r--source/blender/render/intern/source/rendercore.c12
-rw-r--r--source/blender/src/buttons_shading.c128
5 files changed, 171 insertions, 91 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 8afa83b7fa7..32856145727 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1349,7 +1349,7 @@ void do_material_tex()
{
Object *ob;
Material *mat_col, *mat_colspec, *mat_colmir, *mat_ref;
- Material *mat_spec, *mat_har, *mat_emit, *mat_alpha;
+ Material *mat_spec, *mat_har, *mat_emit, *mat_alpha, *mat_ray_mirr, *mat_translu;
MTex *mtex;
Tex *tex;
float *co = NULL, *dx = NULL, *dy = NULL, fact,
@@ -1359,7 +1359,7 @@ void do_material_tex()
/* here: test flag if there's a tex (todo) */
- mat_col=mat_colspec=mat_colmir=mat_ref=mat_spec=mat_har=mat_emit=mat_alpha= R.mat;
+ mat_col=mat_colspec=mat_colmir=mat_ref=mat_spec=mat_har=mat_emit=mat_alpha=mat_ray_mirr=mat_translu= R.mat;
for(tex_nr=0; tex_nr<8; tex_nr++) {
@@ -1612,11 +1612,17 @@ void do_material_tex()
}
if(mtex->mapto & MAP_COLMIR) {
if(mtex->blendtype==MTEX_BLEND) {
- R.refcol[0]= fact + facm*R.refcol[0];
-
- R.refcol[1]= fact*Tr + facm*R.refcol[1];
- R.refcol[2]= fact*Tg + facm*R.refcol[2];
- R.refcol[3]= fact*Tb + facm*R.refcol[3];
+ // exception for envmap only
+ if(tex->type==TEX_ENVMAP) {
+ R.refcol[0]= fact + facm*R.refcol[0];
+ R.refcol[1]= fact*Tr + facm*R.refcol[1];
+ R.refcol[2]= fact*Tg + facm*R.refcol[2];
+ R.refcol[3]= fact*Tb + facm*R.refcol[3];
+ } else {
+ R.matren->mirr= fact*Tr + facm*mat_colmir->mirr;
+ R.matren->mirg= fact*Tg + facm*mat_colmir->mirg;
+ R.matren->mirb= fact*Tb + facm*mat_colmir->mirb;
+ }
}
else if(mtex->blendtype==MTEX_MUL) {
R.matren->mirr= (facm+fact*Tr)*mat_colmir->mirr;
@@ -1735,6 +1741,36 @@ void do_material_tex()
}
mat_har= R.matren;
}
+ if(mtex->mapto & MAP_RAYMIRR) {
+ if(mtex->maptoneg & MAP_RAYMIRR) {factt= facm; facmm= fact;}
+ else {factt= fact; facmm= facm;}
+
+ if(mtex->blendtype==MTEX_BLEND)
+ R.matren->ray_mirror= factt*mtex->def_var+ facmm*mat_ray_mirr->ray_mirror;
+ else if(mtex->blendtype==MTEX_MUL)
+ R.matren->ray_mirror= (facmul+factt)*mat_ray_mirr->ray_mirror;
+ else {
+ R.matren->ray_mirror= factt+mat_ray_mirr->ray_mirror;
+ if(R.matren->ray_mirror<0.0) R.matren->ray_mirror= 0.0;
+ else if(R.matren->ray_mirror>1.0) R.matren->ray_mirror= 1.0;
+ }
+ mat_ray_mirr= R.matren;
+ }
+ if(mtex->mapto & MAP_TRANSLU) {
+ if(mtex->maptoneg & MAP_TRANSLU) {factt= facm; facmm= fact;}
+ else {factt= fact; facmm= facm;}
+
+ if(mtex->blendtype==MTEX_BLEND)
+ R.matren->translucency= factt*mtex->def_var+ facmm*mat_translu->translucency;
+ else if(mtex->blendtype==MTEX_MUL)
+ R.matren->translucency= (facmul+factt)*mat_translu->translucency;
+ else {
+ R.matren->translucency= factt+mat_translu->translucency;
+ if(R.matren->translucency<0.0) R.matren->translucency= 0.0;
+ else if(R.matren->translucency>1.0) R.matren->translucency= 1.0;
+ }
+ mat_translu= R.matren;
+ }
}
}
}
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index cac008afa56..d75cce4e4b8 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -170,7 +170,8 @@ typedef struct Material {
#define MAP_EMIT 64
#define MAP_ALPHA 128
#define MAP_HAR 256
-#define MAP_XTRA 512
+#define MAP_RAYMIRR 512
+#define MAP_TRANSLU 1024
/* pr_type */
#define MA_FLAT 0
diff --git a/source/blender/render/intern/source/ray.c b/source/blender/render/intern/source/ray.c
index 2b2c5b1b50f..d2aecee5b27 100644
--- a/source/blender/render/intern/source/ray.c
+++ b/source/blender/render/intern/source/ray.c
@@ -1172,7 +1172,7 @@ static void shade_ray(Isect *is, int mask, ShadeResult *shr)
/* face normal, check for flip */
R.vno= R.vlr->n;
- if((R.mat->mode & MA_RAYTRANSP)==0) {
+ if((R.matren->mode & MA_RAYTRANSP)==0) {
l= R.vlr->n[0]*R.view[0]+R.vlr->n[1]*R.view[1]+R.vlr->n[2]*R.view[2];
if(l<0.0) {
flip= 1;
@@ -1347,8 +1347,23 @@ static void shade_ray(Isect *is, int mask, ShadeResult *shr)
}
if(is->mode==DDA_SHADOW_TRA) shade_color(shr);
- else shade_lamp_loop(mask, shr);
+ else {
+ shade_lamp_loop(mask, shr);
+
+ if(R.matren->translucency!=0.0) {
+ ShadeResult shr_t;
+ VecMulf(R.vn, -1.0);
+ VecMulf(R.vlr->n, -1.0);
+ shade_lamp_loop(mask, &shr_t);
+ shr->diff[0]+= R.matren->translucency*shr_t.diff[0];
+ shr->diff[1]+= R.matren->translucency*shr_t.diff[1];
+ shr->diff[2]+= R.matren->translucency*shr_t.diff[2];
+ VecMulf(R.vn, -1.0);
+ VecMulf(R.vlr->n, -1.0);
+ }
+ }
+
if(flip) {
R.vlr->n[0]= -R.vlr->n[0];
R.vlr->n[1]= -R.vlr->n[1];
@@ -1488,21 +1503,21 @@ static void traceray(short depth, float *start, float *vec, float *col, int mask
if(depth>0) {
- if(R.mat->mode & MA_RAYMIRROR) {
- f= R.mat->ray_mirror;
- if(f!=0.0) f*= fresnel_fac(R.view, R.vn, R.mat->fresnel_mir);
+ if(R.matren->mode & MA_RAYMIRROR) {
+ f= R.matren->ray_mirror;
+ if(f!=0.0) f*= fresnel_fac(R.view, R.vn, R.matren->fresnel_mir);
}
else f= 0.0;
/* have to do it here, make local vars... */
- fr= R.mat->mirr;
- fg= R.mat->mirg;
- fb= R.mat->mirb;
+ fr= R.matren->mirr;
+ fg= R.matren->mirg;
+ fb= R.matren->mirb;
- if(R.mat->mode & MA_RAYTRANSP && shr.alpha!=1.0) {
+ if(R.matren->mode & MA_RAYTRANSP && shr.alpha!=1.0) {
float f, f1, refract[3], tracol[3];
- refraction(refract, R.vn, R.view, R.mat->ang);
+ refraction(refract, R.vn, R.view, R.matren->ang);
traceray(depth-1, R.co, refract, tracol, mask);
f= shr.alpha; f1= 1.0-f;
@@ -1653,8 +1668,8 @@ void ray_trace(int mask, ShadeResult *shr)
float i, f, f1, fr, fg, fb, vec[3], mircol[3], tracol[3];
int do_tra, do_mir;
- do_tra= ((R.mat->mode & MA_RAYTRANSP) && shr->alpha!=1.0);
- do_mir= ((R.mat->mode & MA_RAYMIRROR) && R.mat->ray_mirror!=0.0);
+ do_tra= ((R.matren->mode & MA_RAYTRANSP) && shr->alpha!=1.0);
+ do_mir= ((R.matren->mode & MA_RAYMIRROR) && R.matren->ray_mirror!=0.0);
vlr= R.vlr;
if(R.r.mode & R_OSA) {
@@ -1662,7 +1677,7 @@ void ray_trace(int mask, ShadeResult *shr)
float accur[3], refract[3], divr=0.0, div= 0.0;
int j;
- if(do_tra) calc_dx_dy_refract(refract, R.vn, R.view, R.mat->ang);
+ if(do_tra) calc_dx_dy_refract(refract, R.vn, R.view, R.matren->ang);
accum[0]= accum[1]= accum[2]= 0.0;
accur[0]= accur[1]= accur[2]= 0.0;
@@ -1685,7 +1700,7 @@ void ray_trace(int mask, ShadeResult *shr)
R.co[1]+= (jit[j][0]-0.5)*O.dxco[1] + (jit[j][1]-0.5)*O.dyco[1] ;
R.co[2]+= (jit[j][0]-0.5)*O.dxco[2] + (jit[j][1]-0.5)*O.dyco[2] ;
- traceray(R.mat->ray_depth_tra, R.co, vec, tracol, mask);
+ traceray(R.matren->ray_depth_tra, R.co, vec, tracol, mask);
VecAddf(accur, accur, tracol);
divr+= 1.0;
@@ -1717,7 +1732,7 @@ void ray_trace(int mask, ShadeResult *shr)
/* we use a new mask here, only shadow uses it */
/* result in accum, this is copied to shade_lamp_loop */
- traceray(R.mat->ray_depth, R.co, vec, mircol, 1<<j);
+ traceray(R.matren->ray_depth, R.co, vec, mircol, 1<<j);
VecAddf(accum, accum, mircol);
div+= 1.0;
@@ -1740,10 +1755,10 @@ void ray_trace(int mask, ShadeResult *shr)
}
if(div!=0.0) {
- i= R.mat->ray_mirror;
- fr= R.mat->mirr;
- fg= R.mat->mirg;
- fb= R.mat->mirb;
+ i= R.matren->ray_mirror;
+ fr= R.matren->mirr;
+ fg= R.matren->mirg;
+ fb= R.matren->mirb;
/* result */
f= i*fr*(1.0-shr->spec[0]); f1= 1.0-i; f/= div;
@@ -1767,8 +1782,8 @@ void ray_trace(int mask, ShadeResult *shr)
VECCOPY(rvn, R.vn);
VECCOPY(ref, R.ref);
- refraction(refract, R.vn, R.view, R.mat->ang);
- traceray(R.mat->ray_depth_tra, R.co, refract, tracol, mask);
+ refraction(refract, R.vn, R.view, R.matren->ang);
+ traceray(R.matren->ray_depth_tra, R.co, refract, tracol, mask);
f= shr->alpha; f1= 1.0-f;
shr->diff[0]= f*shr->diff[0] + f1*tracol[0];
@@ -1788,18 +1803,18 @@ void ray_trace(int mask, ShadeResult *shr)
if(do_mir) {
- i= R.mat->ray_mirror*fresnel_fac(R.view, R.vn, R.mat->fresnel_mir);
+ i= R.matren->ray_mirror*fresnel_fac(R.view, R.vn, R.matren->fresnel_mir);
if(i!=0.0) {
- fr= R.mat->mirr;
- fg= R.mat->mirg;
- fb= R.mat->mirb;
+ fr= R.matren->mirr;
+ fg= R.matren->mirg;
+ fb= R.matren->mirb;
if(R.vlr->flag & R_SMOOTH)
reflection(vec, R.vn, R.view, R.vlr->n);
else
reflection(vec, R.vn, R.view, NULL);
- traceray(R.mat->ray_depth, R.co, vec, mircol, mask);
+ traceray(R.matren->ray_depth, R.co, vec, mircol, mask);
f= i*fr*(1.0-shr->spec[0]); f1= 1.0-i;
shr->diff[0]= f*mircol[0] + f1*shr->diff[0];
@@ -1885,7 +1900,7 @@ void ray_shadow(LampRen *lar, float *shadfac, int mask)
Isect isec;
float fac, div=0.0, lampco[3];
- if(R.mat->mode & MA_SHADOW_TRA) isec.mode= DDA_SHADOW_TRA;
+ if(R.matren->mode & MA_SHADOW_TRA) isec.mode= DDA_SHADOW_TRA;
else isec.mode= DDA_SHADOW;
shadfac[3]= 1.0; // 1=full light
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 7cd58377ad1..093da9b56b7 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1949,6 +1949,7 @@ void shade_lamp_loop(int mask, ShadeResult *shr)
if(shr->diff[2]<0.0) shr->diff[2]= 0.0; else shr->diff[2]*= ma->b;
shr->diff[2]+= ma->ambb +ma->amb*R.rad[2];
+ /* refcol is for envmap only */
if(R.refcol[0]!=0.0) {
shr->diff[0]= ma->mirr*R.refcol[1] + (1.0 - ma->mirr*R.refcol[0])*shr->diff[0];
shr->diff[1]= ma->mirg*R.refcol[2] + (1.0 - ma->mirg*R.refcol[0])*shr->diff[1];
@@ -2362,6 +2363,17 @@ void shadepixel(float x, float y, int vlaknr, int mask)
}
shade_lamp_loop(mask, &shr);
+ if(R.matren->translucency!=0.0) {
+ ShadeResult shr_t;
+ VecMulf(R.vn, -1.0);
+ VecMulf(R.vlr->n, -1.0);
+ shade_lamp_loop(mask, &shr_t);
+ shr.diff[0]+= R.matren->translucency*shr_t.diff[0];
+ shr.diff[1]+= R.matren->translucency*shr_t.diff[1];
+ shr.diff[2]+= R.matren->translucency*shr_t.diff[2];
+ VecMulf(R.vn, -1.0);
+ VecMulf(R.vlr->n, -1.0);
+ }
if(R.r.mode & R_RAYTRACE) {
if(R.matren->ray_mirror!=0.0 || (R.mat->mode & MA_RAYTRANSP && shr.alpha!=1.0)) {
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 21674fa5cc6..e182024910b 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -2084,10 +2084,12 @@ static void material_panel_map_to(Material *ma)
uiDefButS(block, TOG|BIT|3, B_MATPRV, "Cmir", 1119,180,73,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affext the mirror colour");
uiDefButS(block, TOG3|BIT|4, B_MATPRV, "Ref", 1192,180,74,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of the materials reflectivity");
- uiDefButS(block, TOG3|BIT|5, B_MATPRV, "Spec", 900,160,91,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity");
- uiDefButS(block, TOG3|BIT|8, B_MATPRV, "Hard", 991,160,92,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value");
- uiDefButS(block, TOG3|BIT|7, B_MATPRV, "Alpha", 1083,160,91,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value");
- uiDefButS(block, TOG3|BIT|6, B_MATPRV, "Emit", 1174,160,92,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value");
+ uiDefButS(block, TOG3|BIT|5, B_MATPRV, "Spec", 900,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity");
+ uiDefButS(block, TOG3|BIT|8, B_MATPRV, "Hard", 960,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value");
+ uiDefButS(block, TOG3|BIT|9, B_MATPRV, "RayMir",1020,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the ray-mirror value");
+ uiDefButS(block, TOG3|BIT|7, B_MATPRV, "Alpha", 1080,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value");
+ uiDefButS(block, TOG3|BIT|6, B_MATPRV, "Emit", 1140,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value");
+ uiDefButS(block, TOG3|BIT|10, B_MATPRV, "Translu",1200,160,63,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the translucency value");
uiBlockBeginAlign(block);
uiDefButS(block, ROW, B_MATPRV, "Mix", 1087,120,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "Sets texture to blend the values or colour");
@@ -2243,28 +2245,40 @@ static void material_panel_texture(Material *ma)
uiBlockSetCol(block, TH_AUTO);
}
-static void material_panel_raytrace(Material *ma)
+static void material_panel_tramir(Material *ma)
{
uiBlock *block;
- block= uiNewBlock(&curarea->uiblocks, "material_panel_raytrace", UI_EMBOSS, UI_HELV, curarea->win);
+ block= uiNewBlock(&curarea->uiblocks, "material_panel_tramir", UI_EMBOSS, UI_HELV, curarea->win);
uiNewPanelTabbed("Shaders", "Material");
- if(uiNewPanel(curarea, block, "Raytrace", "Material", 640, 0, 318, 204)==0) return;
+ if(uiNewPanel(curarea, block, "Mirror Transp", "Material", 640, 0, 318, 204)==0) return;
uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "RayMir ", 10,160,200,19, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace");
- uiDefButI(block, TOG|BIT|18, B_MATPRV,"Ray Mirror",210,160,100,19, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel ", 10,140,200,19, &(ma->fresnel_mir), 1.0, 1.5, 10, 2, "Amount of Fresnel for mirror reflection");
- uiDefButS(block, NUM, B_MATPRV, "Depth:", 210,140,100,19, &(ma->ray_depth), 0.0, 10.0, 100, 0, "Amount of inter-reflections calculated maximal ");
+ uiDefButF(block, NUMSLI, B_MATPRV, "RayMir ", 10,180,200,19, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace");
+ uiDefButI(block, TOG|BIT|18, B_MATPRV,"Ray Mirror",210,180,100,19, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel ", 10,160,200,19, &(ma->fresnel_mir), 1.0, 1.5, 10, 2, "Amount of Fresnel for mirror reflection");
+ uiDefButS(block, NUM, B_MATPRV, "Depth:", 210,160,100,19, &(ma->ray_depth), 0.0, 10.0, 100, 0, "Amount of inter-reflections calculated maximal ");
uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "IOR ", 10,100,200,19, &(ma->ang), 1.0, 3.0, 100, 2, "Sets the angular index of refraction for raytrace");
- uiDefButI(block, TOG|BIT|17, B_MATRAYTRANSP,"Ray Transp",210,100,100,19, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparency rendering");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel ", 10,80,200,19, &(ma->fresnel_tra), 1.0, 1.5, 10, 2, "Amount of Fresnel for transparency");
- uiDefButS(block, NUM, B_MATPRV, "Depth:", 210,80,100,19, &(ma->ray_depth_tra), 0.0, 10.0, 100, 0, "Amount of refractions calculated maximal ");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Alpha ", 10,130,200,19, &(ma->alpha), 0.0, 1.0, 0, 0, "Sets the material's opacity and transparency mix");
+ uiDefButI(block, TOG|BIT|6, B_MATZTRANSP,"ZTransp", 210,130,100,19, &(ma->mode), 0, 0, 0, 0, "Enables Z-Buffering of transparent faces");
+
+ uiDefButF(block, NUMSLI, B_MATPRV, "IOR ", 10,110,200,19, &(ma->ang), 1.0, 3.0, 100, 2, "Sets the angular index of refraction for raytrace");
+ uiDefButI(block, TOG|BIT|17, B_MATRAYTRANSP,"Ray Transp",210,110,100,19, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparency rendering");
+
+ uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel ", 10,90,200,19, &(ma->fresnel_tra), 1.0, 1.5, 10, 2, "Amount of Fresnel for transparency");
+ uiDefButS(block, NUM, B_MATPRV, "Depth:", 210,90,100,19, &(ma->ray_depth_tra), 0.0, 10.0, 100, 0, "Amount of refractions calculated maximal ");
+
+ uiBlockBeginAlign(block);
+ uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra ", 10,60,150,19, &(ma->spectra), 0.0, 1.0, 0, 0, "Makes specular areas opaque on transparent materials");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Add ", 160,60,150,19, &(ma->add), 0.0, 1.0, 0, 0, "Sets a glow factor for transparant materials");
+
+ uiBlockBeginAlign(block);
+ uiDefButI(block, TOG|BIT|10, 0, "OnlyShadow", 10,10,100,19, &(ma->mode), 0, 0, 0, 0, "Renders shadows falling on material only");
+ uiDefButI(block, TOG|BIT|14, 0, "No Mist", 110,10,100,19, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");
+ uiDefButI(block, TOG|BIT|9, 0, "Env", 210,10,100,19, &(ma->mode), 0, 0, 0, 0, "Causes faces to render with alpha zero: allows sky/backdrop to show through");
uiBlockEndAlign(block);
- uiDefButI(block, TOG|BIT|19, B_MATRAYTRANSP,"Transp Shadow",160,40,150,19, &(ma->mode), 0, 0, 0, 0, "Enables transparent shadows based at material color and alpha");
}
@@ -2298,7 +2312,7 @@ static void material_panel_shading(Material *ma)
uiBlockSetCol(block, TH_BUT_SETTING1);
uiBlockBeginAlign(block);
- uiDefButI(block, TOG|BIT|15, B_MATPRV_DRAW, "Flare", 245,142,65,28, &(ma->mode), 0, 0, 0, 0, "Renders halo as a lensflare");
+ uiDefButI(block, TOG|BIT|15, B_MATPRV_DRAW, "Flare",245,142,65,28, &(ma->mode), 0, 0, 0, 0, "Renders halo as a lensflare");
uiDefButI(block, TOG|BIT|8, B_MATPRV, "Rings", 245,123,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders rings over halo");
uiDefButI(block, TOG|BIT|9, B_MATPRV, "Lines", 245,104,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders star shaped lines over halo");
uiDefButI(block, TOG|BIT|11, B_MATPRV, "Star", 245,85,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders halo as a star");
@@ -2339,26 +2353,24 @@ static void material_panel_shading(Material *ma)
uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 100,150,19, &(ma->param[2]), 0.0, 1.53, 0, 0, "Sets the size of specular toon area");
uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90, 80,150,19, &(ma->param[3]), 0.0, 1.0, 0, 0, "Sets the smoothness of specular toon area");
}
- uiBlockEndAlign(block);
/* default shading variables */
- uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,30,117,19, &(ma->amb), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives");
- uiDefButF(block, NUMSLI, B_MATPRV, "Emit ", 133,30,110,19, &(ma->emit), 0.0, 1.0, 0, 0, "Sets the amount of light the material emits");
- uiDefButF(block, NUMSLI, B_MATPRV, "Add ", 9,10,117,19, &(ma->add), 0.0, 1.0, 0, 0, "Sets a glow factor for transparant materials");
- uiDefButF(block, NUM, 0, "Zoffs:", 133,10,110,19, &(ma->zoffs), 0.0, 10.0, 0, 0, "Gives faces an artificial offset in the Z buffer");
-
+ uiBlockBeginAlign(block);
+ uiDefButF(block, NUMSLI, 0, "Translucency ", 9,30,301,19, &(ma->translucency), 0.0, 1.0, 100, 2, "Amount of diffuse shading of the back side");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,10,150,19, &(ma->amb), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Emit ", 160,10,150,19, &(ma->emit), 0.0, 1.0, 0, 0, "Sets the amount of light the material emits");
+ uiBlockEndAlign(block);
+
uiBlockSetCol(block, TH_BUT_SETTING1);
+ uiDefButI(block, TOG|BIT|0, 0, "Traceable", 245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material cast shadows in spotlights");
+
uiBlockBeginAlign(block);
- uiDefButI(block, TOG|BIT|0, 0, "Traceable", 245,161,65,18, &(ma->mode), 0, 0, 0, 0, "Makes material cast shadows in spotlights");
- uiDefButI(block, TOG|BIT|1, 0, "Shadow", 245,142,65,18, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows from spotlights");
- uiDefButI(block, TOG|BIT|16, 0, "Radio", 245,123,65,18, &(ma->mode), 0, 0, 0, 0, "Enables material for radiosty rendering");
- uiDefButI(block, TOG|BIT|3, 0, "Wire", 245,104,65,18, &(ma->mode), 0, 0, 0, 0, "Renders only the edges of faces as a wireframe");
- uiDefButI(block, TOG|BIT|6, B_MATZTRANSP,"ZTransp", 245,85, 65,18, &(ma->mode), 0, 0, 0, 0, "Enables Z-Buffering of transparent faces");
- uiDefButI(block, TOG|BIT|9, 0, "Env", 245,66, 65,18, &(ma->mode), 0, 0, 0, 0, "Causes faces to disappear: allows world to show through");
- uiDefButI(block, TOG|BIT|10, 0, "OnlyShadow", 245,47, 65,18, &(ma->mode), 0, 0, 0, 0, "Renders shadows falling on material only");
- uiDefButI(block, TOG|BIT|14, 0, "No Mist", 245,28, 65,18, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");
- uiDefButI(block, TOG|BIT|8, 0, "ZInvert", 245,9, 65,18, &(ma->mode), 0, 0, 0, 0, "Renders material's faces with inverted Z Buffer");
+ uiDefButI(block, TOG|BIT|1, 0, "Shadow", 245,110,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows from spotlights");
+ uiDefButI(block, TOG|BIT|19, 0, "TraShadow", 245,90,65,19, &(ma->mode), 0, 0, 0, 0, "Recieves transparent shadows based at material color and alpha");
uiBlockEndAlign(block);
+
+ uiDefButI(block, TOG|BIT|16, 0, "Radio", 245,60,65,19, &(ma->mode), 0, 0, 0, 0, "Enables material for radiosty rendering");
+
}
}
@@ -2439,24 +2451,29 @@ static void material_panel_material(Object *ob, Material *ma)
uiDefButI(block, TOG|BIT|7, B_REDR, "VCol Paint", 85,146,72,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colours with vertex colours");
uiDefButI(block, TOG|BIT|11, B_REDR, "TexFace", 160,146,62,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
uiDefButI(block, TOG|BIT|2, B_MATPRV, "Shadeless", 223,146,80,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
- uiBlockEndAlign(block);
+ uiBlockSetCol(block, TH_AUTO);
+ uiDefButF(block, NUM, 0, "Zoffs:", 8,127,120,19, &(ma->zoffs), 0.0, 10.0, 0, 0, "Gives faces an artificial offset in the Z buffer");
+ uiBlockSetCol(block, TH_BUT_SETTING1);
+ uiDefButI(block, TOG|BIT|3, 0, "Wire", 128,127,96,19, &(ma->mode), 0, 0, 0, 0, "Renders only the edges of faces as a wireframe");
+ uiDefButI(block, TOG|BIT|8, 0, "ZInvert", 224,127,79,19, &(ma->mode), 0, 0, 0, 0, "Renders material's faces with inverted Z Buffer");
+
}
uiBlockSetCol(block, TH_AUTO);
uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_MATCOL, "", 8,115,72,24, &(ma->r), 0, 0, 0, 0, "");
- uiDefButF(block, COL, B_SPECCOL, "", 8,88,72,24, &(ma->specr), 0, 0, 0, 0, "");
- uiDefButF(block, COL, B_MIRCOL, "", 8,61,72,24, &(ma->mirr), 0, 0, 0, 0, "");
+ uiDefButF(block, COL, B_MATCOL, "", 8,97,72,20, &(ma->r), 0, 0, 0, 0, "");
+ uiDefButF(block, COL, B_SPECCOL, "", 8,77,72,20, &(ma->specr), 0, 0, 0, 0, "");
+ uiDefButF(block, COL, B_MIRCOL, "", 8,57,72,20, &(ma->mirr), 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
if(ma->mode & MA_HALO) {
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,115,40,25, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the colour of the halo with the RGB sliders");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,88,40,25, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the colour of the lines with the RGB sliders");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,61,40,25, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the colour of the rings with the RGB sliders");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the colour of the halo with the RGB sliders");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the colour of the lines with the RGB sliders");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the colour of the rings with the RGB sliders");
}
else {
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,115,40,25, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the basic colour of the material");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,88,40,25, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular colour of the material");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,61,40,25, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror colour of the material");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the basic colour of the material");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular colour of the material");
+ uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror colour of the material");
}
if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;}
@@ -2467,27 +2484,26 @@ static void material_panel_material(Object *ob, Material *ma)
else if(ma->colormodel==MA_HSV) {
uiBlockSetCol(block, TH_BUT_SETTING1);
uiBlockBeginAlign(block);
- uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,120,175,19, colpoin, 0.0, 0.9999, rgbsel, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,100,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,80,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
+ uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,97,175,19, colpoin, 0.0, 0.9999, rgbsel, 0, "");
+ uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,77,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
+ uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,57,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
uiBlockSetCol(block, TH_AUTO);
}
else {
uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,120,175,19, colpoin, 0.0, 1.0, rgbsel, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,100,175,19, colpoin+1, 0.0, 1.0, rgbsel, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,80,175,19, colpoin+2, 0.0, 1.0, rgbsel, 0, "");
+ uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,97,175,19, colpoin, 0.0, 1.0, rgbsel, 0, "");
+ uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,77,175,19, colpoin+1, 0.0, 1.0, rgbsel, 0, "");
+ uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,57,175,19, colpoin+2, 0.0, 1.0, rgbsel, 0, "");
}
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Alpha ", 128,52,175,19, &(ma->alpha), 0.0, 1.0, 0, 0, "Sets the material's opacity and transparency mix");
- uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra ", 128,32,175,19, &(ma->spectra), 0.0, 1.0, 0, 0, "Makes specular areas opaque on transparent materials");
+ uiBlockEndAlign(block);
+ uiDefButF(block, NUMSLI, B_MATPRV, "A ", 128,30,175,19, &ma->alpha, 0.0, 1.0, 0, 0, "Alpha");
}
uiBlockBeginAlign(block);
- uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,32,35,20, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates colour using red, green and blue");
- uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 43,32,35,20, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates colour using hue, saturation and value");
- uiDefButS(block, TOG|BIT|0, REDRAWBUTSSHADING, "DYN", 78,32,45,20, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options");
- uiBlockEndAlign(block);
+ uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,30,38,19, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates colour using red, green and blue");
+ uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 46,30,38,19, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates colour using hue, saturation and value");
+ uiDefButS(block, TOG|BIT|0, REDRAWBUTSSHADING, "DYN", 84,30,39,19, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options");
+
}
static void material_panel_preview(Material *ma)
@@ -2530,7 +2546,7 @@ void material_panels()
if(ma) {
material_panel_shading(ma);
- material_panel_raytrace(ma);
+ material_panel_tramir(ma);
material_panel_texture(ma);
mtex= ma->mtex[ ma->texact ];