- Xmas special: shiny mirroring bells & whistles!

This is a revision of the old NeoGeo raytracer, dusted off, improved quite
a lot, and nicely integrated in the rest of rendering pipeline.
Enable it with F10-"Ray", and set either a 'ray-shadow' lamp or give the
Material a "RayMirror" value.
It has been added for 2 reasons:
- get feedback on validity... I need artists to play around with it if it's
  actually useful. It still *is* raytracing, meaning complex scenes will
  easily become slow.
- for educational purposes. All raytracing happens in ray.c, which can be
  quite easily adjusted for other effects.

When too many disasters pop up with this, I'll make it a compile #ifdef.
But so far, it seems to do a decent job.

Demo files: http://www.blender.org/docs/ray_test.tgz
An article (tech) about how it works, and about the new octree invention
will be posted soon. :)

Note: it doesn't work with unified render yet.
This commit is contained in:
2003-12-10 20:41:53 +00:00
parent cad30134cb
commit a18cc02374
15 changed files with 1814 additions and 87 deletions

View File

@@ -577,6 +577,15 @@ void init_render_material(Material *ma)
}
if(needuv) ma->texco |= NEED_UV;
if(R.r.mode & R_RAYTRACE) {
if(ma->ray_mirror!=0.0) {
ma->texco |= NEED_UV|TEXCO_REFL;
if(R.osa) ma->texco |= TEXCO_OSA;
}
}
ma->ambr= ma->amb*R.wrld.ambr;
ma->ambg= ma->amb*R.wrld.ambg;
ma->ambb= ma->amb*R.wrld.ambb;

View File

@@ -56,6 +56,9 @@ typedef struct Lamp {
float clipsta, clipend, shadspotsize;
float bias, soft;
short ray_samp, pad;
float ray_soft;
/* texact is for buttons */
short texact, shadhalostep;
@@ -88,6 +91,7 @@ typedef struct Lamp {
#define LA_DEEP_SHADOW 1024
#define LA_NO_DIFF 2048
#define LA_NO_SPEC 4096
#define LA_SHAD_RAY 8192
/* mapto */
#define LAMAP_COL 1

View File

@@ -54,9 +54,10 @@ typedef struct Material {
float mirr, mirg, mirb;
float ambr, ambb, ambg;
float amb, emit, ang, spectra;
float amb, emit, ang, spectra, ray_mirror;
float alpha, ref, spec, zoffs, add;
float kfac; /* for transparent solids */
short ray_depth, pad1;
short har;
char seed1, seed2;
@@ -82,7 +83,7 @@ typedef struct Material {
/* dynamic properties */
float friction, fh, reflect;
float fhdist, xyfrict;
short dynamode, pad;
short dynamode, pad2;
ScriptLink scriptlink;
} Material;

View File

@@ -174,12 +174,13 @@ typedef struct RenderData {
* 9: borders
* 10: panorama
* 11: crop
* 12: save SGI movies with Cosmo hardware (????)
* 13: odd field first rendering
* 14: motion blur
* 15: use unified renderer for this pic!
* 12: save SGI movies with Cosmo hardware
* 13: odd field first rendering
* 14: motion blur
* 15: use unified renderer for this pic
* 16. enable raytracing
*/
short mode;
int mode;
/**
* What to do with the sky/background. Picks sky/premul/key
@@ -199,7 +200,7 @@ typedef struct RenderData {
/** For unified renderer: reduce intensity on boundaries with
* identical materials with this number.*/
short same_mat_redux, pad_3[3];
short same_mat_redux, pad_3[2];
/**
* The gamma for the normal rendering. Used when doing
@@ -263,7 +264,7 @@ typedef struct Scene {
#define R_FRONTBUF 4
#define R_FRONTBUFANIM 8
/* mode */
/* mode (int now) */
#define R_OSA 0x0001
#define R_SHADOW 0x0002
#define R_GAMMA 0x0004
@@ -277,10 +278,10 @@ typedef struct Scene {
#define R_PANORAMA 0x0400
#define R_MOVIECROP 0x0800
#define R_COSMO 0x1000
/* these difines were different between IrisGL and OpenGL!!! */
#define R_ODDFIELD 0x2000
#define R_MBLUR 0x4000
#define R_UNIFIED 0x8000
#define R_RAYTRACE 0x10000
/* scemode */
#define R_DOSEQ 0x0001

View File

@@ -189,6 +189,7 @@ typedef struct VlakRen
char snproj, puno;
char flag, ec;
unsigned int lay;
unsigned int raycount;
RadFace *radface;
Object *ob;
} VlakRen;
@@ -247,6 +248,9 @@ typedef struct LampRen
/** A small depth offset to prevent self-shadowing. */
float bias;
float ray_soft;
short ray_samp;
/** If the lamp casts shadows, one of these is filled. For the old
* renderer, shb is used, for the new pipeline the shadowBufOb,
* which should be a shadowbuffer handle. */

View File

@@ -45,7 +45,6 @@ unsigned int calchalo_z(struct HaloRen *har, unsigned int zz);
float spec(float inp, int hard);
void shade_lamp_loop(void);
void add_halo_flare(void);
/**
@@ -85,7 +84,7 @@ void zbufshadeDA(void); /* Delta Accum Pixel Struct */
/**
* Also called in: zbuf.c
*/
void shadepixel(float x, float y, int vlaknr);
void shadepixel(float x, float y, int vlaknr, int mask);
/**
* Shade the pixel at xn, yn for halo har, and write the result to col.

View File

@@ -186,7 +186,7 @@ void zbuffer_abuf(void);
/**
* Shade this face at this location in SCS.
*/
void shadetrapixel(float x, float y, int vlak);
void shadetrapixel(float x, float y, int vlak, int mask);
/**
* Determine the distance to the camera of this halo, in ZCS.

View File

@@ -41,7 +41,7 @@ ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris windo
CCFLAGS += -funsigned-char
endif
# CFLAGS += $(LEVEL_2_C_WARNINGS)
CFLAGS += $(LEVEL_1_C_WARNINGS)
# first /include is my own includes, second is the external interface.
# The external modules follow after. There should be a nicer way to say this.

File diff suppressed because it is too large Load Diff

View File

@@ -55,7 +55,7 @@
void prepareScene()
{
int a;
extern void makeoctree(void);
if(R.rectot) MEM_freeN(R.rectot);
R.rectot= 0;
@@ -85,12 +85,18 @@ void prepareScene()
/* ENVIRONMENT MAPS */
make_envmaps();
/* octree */
if(R.r.mode & R_RAYTRACE) makeoctree();
}
void finalizeScene(void)
{
extern void freeoctree(void);
/* Among other things, it releases the shadow buffers. */
RE_local_free_renderdata();
if(R.r.mode & R_RAYTRACE) freeoctree();
}

View File

@@ -1552,7 +1552,8 @@ void RE_calc_R_ref()
}
void shade_lamp_loop()
/* mask is used to define the amount of rays/samples */
void shade_lamp_loop(int mask)
{
LampRen *lar;
Material *ma;
@@ -1615,7 +1616,7 @@ void shade_lamp_loop()
ma->b= R.vcol[2];
}
/* mirror reflection colour */
/* mirror reflection colour textures (envmap) */
R.refcol[0]= R.refcol[1]= R.refcol[2]= R.refcol[3]= 0.0;
if(ma->texco) {
@@ -1807,16 +1808,29 @@ void shade_lamp_loop()
/* shadow and spec */
if(inp> -0.41) { /* heuristic value */
shadfac= 1.0;
if(lar->shb) {
if(i>0.0 && (R.r.mode & R_SHADOW)) {
if(ma->mode & MA_SHADOW) {
shadfac = testshadowbuf(lar->shb, inp);
if(shadfac==0.0) continue;
i*= shadfac;
if(lar->shb) {
shadfac = testshadowbuf(lar->shb, inp);
if(shadfac==0.0) continue;
i*= shadfac;
}
else if(lar->mode & LA_SHAD_RAY) {
if(R.r.mode & R_RAYTRACE) {
extern float ray_shadow(LampRen *, int);
/* hurms, single sided? */
if( R.vlr->n[0]*lv[0] + R.vlr->n[1]*lv[1] + R.vlr->n[2]*lv[2] > -0.01) {
shadfac= (1.0-ray_shadow(lar, mask));
i*= shadfac;
}
}
}
}
}
/* specularity */
if(ma->spec!=0.0 && !(lar->mode & LA_NO_SPEC)) {
if(shadfac>0.0 && ma->spec!=0.0 && !(lar->mode & LA_NO_SPEC)) {
if(lar->type==LA_HEMI) {
/* hemi uses no spec shaders (yet) */
@@ -1859,6 +1873,7 @@ void shade_lamp_loop()
}
}
}
/* in case 'no diffuse' we still do most calculus, spec can be in shadow */
if(i>0.0 && !(lar->mode & LA_NO_DIFF)) {
ir+= i*lar->r;
@@ -1916,7 +1931,7 @@ void shade_lamp_loop()
}
void shadepixel(float x, float y, int vlaknr)
void shadepixel(float x, float y, int vlaknr, int mask)
/* x,y: window coordinate from 0 to rectx,y */
{
static VlakRen *vlr;
@@ -2035,12 +2050,7 @@ void shadepixel(float x, float y, int vlaknr)
}
/* COXYZ */
if( (G.special1 & G_HOLO) && ((Camera *)G.scene->camera->data)->flag & CAM_HOLO2) {
R.view[0]= (x+(R.xstart)+1.0+holoofs);
}
else {
R.view[0]= (x+(R.xstart)+1.0);
}
R.view[0]= (x+(R.xstart)+1.0);
if(R.flag & R_SEC_FIELD) {
if(R.r.mode & R_ODDFIELD) R.view[1]= (y+R.ystart+0.5)*R.ycor;
@@ -2133,7 +2143,7 @@ void shadepixel(float x, float y, int vlaknr)
Normalise(R.vn);
if(R.osatex && (R.matren->texco & (TEXCO_NORM+TEXCO_REFL)) ) {
dl= O.dxuv[0]+O.dxuv[1];
dl= O.dxuv[0]+O.dxuv[1];
O.dxno[0]= dl*n3[0]-O.dxuv[0]*n1[0]-O.dxuv[1]*n2[0];
O.dxno[1]= dl*n3[1]-O.dxuv[0]*n1[1]-O.dxuv[1]*n2[1];
O.dxno[2]= dl*n3[2]-O.dxuv[0]*n1[2]-O.dxuv[1]*n2[2];
@@ -2315,8 +2325,7 @@ void shadepixel(float x, float y, int vlaknr)
R.winco[1]= (y+(R.ystart))/(float)R.afmy;
}
shade_lamp_loop();
shade_lamp_loop(mask);
/* MIST */
if( (R.wrld.mode & WO_MIST) && (R.matren->mode & MA_NOMIST)==0 ){
@@ -2324,8 +2333,12 @@ void shadepixel(float x, float y, int vlaknr)
}
else alpha= 1.0;
/* RAYTRACE WAS HERE! */
/* RAYTRACE IS BACK HERE! */
if(R.r.mode & R_RAYTRACE) {
extern void ray_mirror(int);
if(R.matren->ray_mirror!=0.0) ray_mirror(mask);
}
if(R.matren->alpha!=1.0 || alpha!=1.0) {
fac= alpha*(R.matren->alpha);
@@ -2714,7 +2727,7 @@ void zbufshadeDA(void) /* Delta Accum Pixel Struct */
xs= (float)x+centLut[b & 15];
ys= (float)y+centLut[b>>4];
shadepixel(xs, ys, ps->vlak);
shadepixel(xs, ys, ps->vlak, ps->mask);
if(shortcol[3]) {
add_filt_mask(ps->mask, shortcol, rb1, rb2, rb3);
@@ -2730,14 +2743,14 @@ void zbufshadeDA(void) /* Delta Accum Pixel Struct */
xs= (float)x+centLut[b & 15];
ys= (float)y+centLut[b>>4];
shadepixel(xs, ys, ps->vlak0);
shadepixel(xs, ys, ps->vlak0, mask);
if(shortcol[3]) {
add_filt_mask(mask, shortcol, rb1, rb2, rb3);
}
}
else {
shadepixel((float)x, (float)y, (int)*rd);
shadepixel((float)x, (float)y, (int)*rd, fullmask);
if(shortcol[3]) {
add_filt_mask(fullmask, shortcol, rb1, rb2, rb3);
}
@@ -2863,7 +2876,7 @@ void zbufshade(void)
for(x=0; x<R.rectx; x++, rp++, acol+= 4) {
/* spothalo's added here... *rp is the target colour? */
shadepixel((float)x, fy, *rp);
shadepixel((float)x, fy, *rp, 0);
if(acol[3]) addAlphaOverShort(shortcol, acol);
@@ -2879,7 +2892,7 @@ void zbufshade(void)
}
else {
for(x=0; x<R.rectx; x++, rp++) {
shadepixel((float)x, fy, *rp);
shadepixel((float)x, fy, *rp, 0);
if(shortcol[3]) {
rt= (char *)rp;
rt[0]= charcol[0];

View File

@@ -2170,14 +2170,14 @@ int vergzvlak(const void *a1, const void *a2)
return 0;
}
void shadetrapixel(float x, float y, int vlak)
void shadetrapixel(float x, float y, int vlak, int mask)
{
if( (vlak & 0x7FFFFF) > R.totvlak) {
printf("error in shadetrapixel nr: %d\n", (vlak & 0x7FFFFF));
return;
}
shadepixel(x, y, vlak);
shadepixel(x, y, vlak, mask);
}
extern unsigned short usegamtab;
@@ -2253,7 +2253,7 @@ void abufsetrow(int y)
else {
xs= x; ys= y;
}
shadetrapixel(xs, ys, ap->p[0]);
shadetrapixel(xs, ys, ap->p[0], ap->mask[0]);
nr= count_mask(ap->mask[0]);
if( (R.r.mode & R_OSA) && nr<R.osa) {
@@ -2297,7 +2297,7 @@ void abufsetrow(int y)
else {
xs= x; ys= y;
}
shadetrapixel(xs, ys, zrow[totvlak][1]);
shadetrapixel(xs, ys, zrow[totvlak][1], 0xFFFF);
a= count_mask(zrow[totvlak][2]);
if( (R.r.mode & R_OSA ) && a<R.osa) {
@@ -2316,7 +2316,7 @@ void abufsetrow(int y)
xs= (float)x+centLut[b & 15];
ys= (float)y+centLut[b>>4];
shadetrapixel(xs, ys, zrow[totvlak][1]);
shadetrapixel(xs, ys, zrow[totvlak][1], zrow[totvlak][2]);
sval= addtosampcol(sampcol, shortcol, zrow[totvlak][2]);
}
scol= sampcol;

View File

@@ -1445,7 +1445,7 @@ static void init_render_mball(Object *ob)
vlr->v4= 0;
/* render normal are inverted */
vlr->len= CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n);
vlr->len= CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->n);
vlr->mface= 0;
vlr->mat= ma;
@@ -1460,7 +1460,7 @@ static void init_render_mball(Object *ob)
*vlr1= *vlr;
vlr1->v2= vlr1->v3;
vlr1->v3= RE_findOrAddVert(startvert+index[3]);
vlr->len= CalcNormFloat(vlr1->v3->co, vlr1->v2->co, vlr1->v1->co, vlr1->n);
vlr->len= CalcNormFloat(vlr1->v1->co, vlr1->v2->co, vlr1->v3->co, vlr1->n);
}
}
@@ -1794,6 +1794,9 @@ void RE_add_render_lamp(Object *ob, int doshadbuf)
lar->clipend = la->clipend;
lar->bias = la->bias;
lar->ray_soft= la->ray_soft;
lar->ray_samp= la->ray_samp;
lar->type= la->type;
lar->mode= la->mode;
@@ -1881,12 +1884,8 @@ void RE_add_render_lamp(Object *ob, int doshadbuf)
}
}
if( (R.r.mode & R_SHADOW)
&& (lar->mode & LA_SHAD)
&& (la->type==LA_SPOT)
&& doshadbuf
)
{
if( (R.r.mode & R_SHADOW) && (lar->mode & LA_SHAD)
&& (la->type==LA_SPOT) && doshadbuf ) {
/* Per lamp, one shadow buffer is made. */
if (R.r.mode & R_UNIFIED) {
int mode;

View File

@@ -997,7 +997,7 @@ static void render_panel_output()
/* Toon shading buttons */
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|5, 0,"Edge", 154, 70, 47, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon shading");
uiDefButI(block, TOG|BIT|5, 0,"Edge", 154, 70, 47, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon shading");
uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings |>> ", 204, 70, 93, 19, "Display edge settings");
uiBlockEndAlign(block);
@@ -1023,14 +1023,14 @@ static void render_panel_render()
uiDefBut(block, BUT,B_DORENDER,"RENDER", 369,142,192,47, 0, 0, 0, 0, 0, "Start the rendering");
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|0, 0, "OSA", 369,114,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
uiDefButI(block, TOG|BIT|0, 0, "OSA", 369,114,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
uiDefButS(block, ROW,B_DIFF,"5", 369,90,28,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
uiDefButS(block, ROW,B_DIFF,"8", 397,90,28,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)");
uiDefButS(block, ROW,B_DIFF,"11", 425,90,33,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
uiDefButS(block, ROW,B_DIFF,"16", 458,90,33,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|14, 0, "MBLUR", 495,114,66,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
uiDefButI(block, TOG|BIT|14, 0, "MBLUR", 495,114,66,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
uiDefButF(block, NUM,B_DIFF,"Bf:", 495,90,65,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 0, "Sets motion blur factor");
uiBlockBeginAlign(block);
@@ -1043,10 +1043,11 @@ static void render_panel_render()
uiDefButS(block, ROW,800,"Key", 467,11,44,24,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged");
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|1,0,"Shadow", 565,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
uiDefButS(block, TOG|BIT|4,0,"EnvMap", 626,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map renering");
uiDefButS(block, TOG|BIT|10,0,"Pano", 565,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
uiDefButS(block, TOG|BIT|8,0,"Radio", 626,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
uiDefButI(block, TOG|BIT|1,0,"Shadow", 565,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
uiDefButI(block, TOG|BIT|4,0,"EnvMap", 626,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map renering");
uiDefButI(block, TOG|BIT|10,0,"Pano", 565,142,41,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
uiDefButI(block, TOG|BIT|16,0,"Ray", 606,142,35,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable ray tracing");
uiDefButI(block, TOG|BIT|8,0,"Radio", 641,142,46,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
uiBlockBeginAlign(block);
uiDefButS(block, ROW,B_DIFF,"100%", 565,114,121,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size");
@@ -1055,14 +1056,14 @@ static void render_panel_render()
uiDefButS(block, ROW,B_DIFF,"25%", 647,90,39,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size");
uiBlockEndAlign(block);
uiDefButS(block, TOG|BIT|6,0,"Fields", 564,42,90,31,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
uiDefButI(block, TOG|BIT|6,0,"Fields", 564,42,90,31,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|13,0,"Odd", 655,57,30,16,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
uiDefButS(block, TOG|BIT|7,0,"x", 655,42,30,15,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
uiDefButI(block, TOG|BIT|13,0,"Odd", 655,57,30,16,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
uiDefButI(block, TOG|BIT|7,0,"x", 655,42,30,15,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
uiBlockEndAlign(block);
uiDefButS(block, TOG|BIT|9,REDRAWVIEWCAM, "Border", 565,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
uiDefButS(block, TOG|BIT|2,0, "Gamma", 626,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
uiDefButI(block, TOG|BIT|9,REDRAWVIEWCAM, "Border", 565,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
uiDefButI(block, TOG|BIT|2,0, "Gamma", 626,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
}
@@ -1117,11 +1118,11 @@ static void render_panel_format()
#ifdef __sgi
yofs = 76;
uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
uiDefButS(block, TOG|BIT|12,0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
uiDefButI(block, TOG|BIT|12,0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
#endif
uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format");
uiDefButS(block, TOG|BIT|11,0, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
uiDefButI(block, TOG|BIT|11,0, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
yofs -= 22;
@@ -1189,7 +1190,7 @@ static void render_panel_format()
uiDefBut(block, BUT,B_PR_PAL169, "PAL 16:9",1146,70,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 64x45");
uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings");
uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1");
uiDefButS(block, TOG|BIT|15, B_REDR, "Unified Renderer", 1146,10,100,18, &G.scene->r.mode, 0, 0, 0, 0, "Use the unified renderer.");
uiDefButI(block, TOG|BIT|15, B_REDR, "Unified Renderer", 1146,10,100,18, &G.scene->r.mode, 0, 0, 0, 0, "Use the unified renderer.");
uiBlockEndAlign(block);
}

View File

@@ -1807,7 +1807,7 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
float grid=0.0;
block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSS, UI_HELV, curarea->win);
if(uiNewPanel(curarea, block, "Spot", "Lamp", 640, 0, 318, 204)==0) return;
if(uiNewPanel(curarea, block, "Shadow and Spot", "Lamp", 640, 0, 318, 204)==0) return;
if(G.vd) grid= G.vd->grid;
if(grid<1.0) grid= 1.0;
@@ -1815,8 +1815,12 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
uiSetButLock(la->id.lib!=0, "Can't edit library data");
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Shadows",10,150,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows");
uiDefButS(block, TOG|BIT|5, 0,"OnlyShadow", 10,130,80,19,&la->mode, 0, 0, 0, 0, "Causes spotlight to cast shadows only without illuminating objects");
uiBlockBeginAlign(block);
uiDefButS(block, TOG|BIT|13, B_REDR,"Ray Shadow", 10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows using shadow buffer");
uiBlockEndAlign(block);
uiDefButS(block, TOG|BIT|5, 0,"OnlyShadow", 10,120,80,19,&la->mode, 0, 0, 0, 0, "Causes spotlight to cast shadows only without illuminating objects");
uiDefButS(block, TOG|BIT|7, B_LAMPREDRAW,"Square", 10,90,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles");
uiDefButS(block, TOG|BIT|1, 0,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
@@ -1827,19 +1831,26 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
uiBlockEndAlign(block);
uiDefButF(block, NUMSLI,0,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Sets the intensity of the spotlight halo");
uiDefButS(block, NUM,B_SBUFF,"ShadowBufferSize:", 100,110,200,19, &la->bufsize,512,5120, 0, 0, "Sets the size of the shadow buffer to nearest multiple of 16");
uiBlockBeginAlign(block);
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipSta:", 100,70,100,19, &la->clipsta, 0.1*grid,1000.0*grid, 10, 0, "Sets the shadow map clip start: objects closer will not generate shadows");
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipEnd:", 200,70,100,19,&la->clipend, 1.0, 5000.0*grid, 100, 0, "Sets the shadow map clip end beyond which objects will not generate shadows");
uiBlockEndAlign(block);
uiDefButS(block, NUM,0,"Samples:", 100,30,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples");
uiDefButS(block, NUM,0,"Halo step:", 200,30,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency");
uiDefButF(block, NUM,0,"Bias:", 100,10,100,19, &la->bias, 0.01, 5.0, 1, 0, "Sets the shadow map sampling bias");
uiDefButF(block, NUM,0,"Soft:", 200,10,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area");
if(la->mode & LA_SHAD) {
uiDefButS(block, NUM,B_SBUFF,"ShadowBufferSize:", 100,110,200,19, &la->bufsize,512,5120, 0, 0, "Sets the size of the shadow buffer to nearest multiple of 16");
uiBlockBeginAlign(block);
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipSta:", 100,70,100,19, &la->clipsta, 0.1*grid,1000.0*grid, 10, 0, "Sets the shadow map clip start: objects closer will not generate shadows");
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipEnd:", 200,70,100,19,&la->clipend, 1.0, 5000.0*grid, 100, 0, "Sets the shadow map clip end beyond which objects will not generate shadows");
uiBlockEndAlign(block);
uiDefButS(block, NUM,0,"Samples:", 100,30,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples");
uiDefButS(block, NUM,0,"Halo step:", 200,30,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency");
uiDefButF(block, NUM,0,"Bias:", 100,10,100,19, &la->bias, 0.01, 5.0, 1, 0, "Sets the shadow map sampling bias");
uiDefButF(block, NUM,0,"Soft:", 200,10,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area");
}
else if(la->mode & LA_SHAD_RAY) {
uiBlockBeginAlign(block);
uiDefButS(block, NUM,0,"Samples:", 100,70,100,19, &la->ray_samp, 1,8, 100, 0, "Sets the amount of samples taken extra (samp x samp)");
uiDefButF(block, NUM,0,"Soft:", 200,70,100,19, &la->ray_soft, 0.01, 10.0, 100, 0, "Sets the size of the sampling area");
uiBlockEndAlign(block);
}
}
@@ -1866,7 +1877,7 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
xco= std_libbuttons(block, 8, 180, 0, NULL, B_LAMPBROWSE, id, (ID *)ob, &(G.buts->menunr), B_LAMPALONE, B_LAMPLOCAL, 0, 0, 0);
uiBlockSetCol(block, TH_AUTO);
uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:", xco+10,180,100,20,&la->dist, 0.01, 5000.0, 100, 0, "Sets the distance value at which light intensity is halved");
uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:", xco,180,300-xco,20,&la->dist, 0.01, 5000.0, 100, 0, "Sets the distance value at which light intensity is halved");
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButS(block, TOG|BIT|3, B_MATPRV,"Quad", 10,150,100,19,&la->mode, 0, 0, 0, 0, "Uses inverse quadratic proportion for light attenuation");
@@ -1876,7 +1887,6 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
uiDefButS(block, TOG|BIT|11, 0,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp");
uiDefButS(block, TOG|BIT|12, 0,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp");
uiBlockSetCol(block, TH_AUTO);
uiDefButF(block, NUMSLI,B_MATPRV,"Energy ", 120,150,180,20, &(la->energy), 0.0, 10.0, 0, 0, "Sets the intensity of the light");
@@ -2277,11 +2287,15 @@ 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,35,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,35,110,19, &(ma->emit), 0.0, 1.0, 0, 0, "Sets the amount of light the material emits");
uiBlockBeginAlign(block);
uiDefButF(block, NUMSLI, 0, "RayMir ", 9,55,154,19, &(ma->ray_mirror), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives");
uiDefButS(block, NUM, 0, "Depth:", 163,55,80,19, &(ma->ray_depth), 0.0, 6.0, 0, 0, "Sets the amount of light the material emits");
uiBlockEndAlign(block);
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");