Index: source/blender/render/intern/source/rayshade.c =================================================================== --- source/blender/render/intern/source/rayshade.c (revision 12834) +++ source/blender/render/intern/source/rayshade.c (working copy) @@ -778,15 +778,56 @@ } /* disc of radius 'radius', centred on 0,0 */ -static void QMC_sampleDisc(float *vec, QMCSampler *qsa, int thread, int num, float radius) +static void QMC_sampleDiscConcentric(float *vec, QMCSampler *qsa, int thread, int num, float radius) { double s[2]; + double phi, r; + double a, b; + + QMC_getSample(s, qsa, thread, num); + + a = 2*s[0] - 1; /* (a,b) is now on [-1,1]^2 */ + b = 2*s[1] - 1; + + if (a > -b) { /* region 1 or 2 */ + if (a > b) { /* region 1, also |a| > |b| */ + r = a; + phi = (M_PI/4 ) * (b/a); + } + else { /* region 2, also |b| > |a| */ + r = b; + phi = (M_PI/4) * (2 - (a/b)); + } + } + else { /* region 3 or 4 */ + if (a < b) { /* region 3, also |a| >= |b|, a != 0 */ + r = -a; + phi = (M_PI/4) * (4 + (b/a)); + } + else { /* region 4, |b| >= |a|, but a==0 and b==0 could occur. */ + r = -b; + if (b != 0) + phi = (M_PI/4) * (6 - (a/b)); + else + phi = 0; + } + } + + vec[0] = r * cos(phi)* radius/2.0; + vec[1] = r * sin(phi)* radius/2.0; + vec[2] = 0.0f; +} + +/* disc of radius 'radius', centred on 0,0 */ +static void QMC_sampleDisc(float *vec, QMCSampler *qsa, int thread, int num, float blur, float radius) +{ + double s[2]; float phi, sqr; QMC_getSample(s, qsa, thread, num); phi = s[0]*2*M_PI; - sqr = sqrt(s[1]); + sqr = pow(s[1], blur*5 - 0.5); vec[0] = cos(phi)*sqr* radius/2.0; vec[1] = sin(phi)*sqr* radius/2.0; @@ -1529,12 +1570,29 @@ shadfac[1]+= (1.0f-skyfac)*R.wrld.horg + skyfac*R.wrld.zeng; shadfac[2]+= (1.0f-skyfac)*R.wrld.horb + skyfac*R.wrld.zenb; } - else { /* WO_AOSKYTEX */ + else if (aocolor==WO_AOSKYTEX) { shadeSkyView(skycol, isec.start, view, dxyview); shadfac[0]+= skycol[0]; shadfac[1]+= skycol[1]; shadfac[2]+= skycol[2]; } + else if (aocolor==WO_AODIFFUSESH) { + float dot; + + dot = Inpf(dir, shi->vn); + Mat4Mul3Vecfl(R.viewinv, view); + + dsh_irradcoeffs(skycol, R.wrld.dsh_coeffs[0], R.wrld.dsh_coeffs[1], R.wrld.dsh_coeffs[2], R.wrld.dsh_coeffs[3], + R.wrld.dsh_coeffs[4], R.wrld.dsh_coeffs[5], R.wrld.dsh_coeffs[6], R.wrld.dsh_coeffs[7], R.wrld.dsh_coeffs[8], view); + + if (G.rt == 0) dot = 1.f; + + shadfac[0]+= skycol[0]*dot*dot; + shadfac[1]+= skycol[1]*dot*dot; + shadfac[2]+= skycol[2]*dot*dot; + + /* blah */ + } skyadded++; } @@ -1763,7 +1821,8 @@ VecOrthoBasisf(v, ru, rv); /* sampling, returns quasi-random vector in area_size disc */ - QMC_sampleDisc(samp3d, qsa, shi->thread, samples,lar->area_size); + if (G.rt==0) QMC_sampleDisc(samp3d, qsa, shi->thread, samples, 0.0, lar->area_size); + else QMC_sampleDiscConcentric(samp3d, qsa, shi->thread, samples,lar->area_size); /* distribute disc samples across the tangent plane */ s[0] = samp3d[0]*ru[0] + samp3d[1]*rv[0]; @@ -1772,7 +1831,14 @@ VECCOPY(samp3d, s); } - else { + else if ((lar->type == LA_SPOT) && !(lar->mode & LA_SQUARE)) { + + /* sampling, returns quasi-random vector in area_size disc */ + if (G.rt==0) QMC_sampleDisc(samp3d, qsa, shi->thread, samples, lar->spotbl, lar->area_size); + else QMC_sampleDiscConcentric(samp3d, qsa, shi->thread, samples,lar->area_size); + + Mat3MulVecfl(lar->mat, samp3d); + } else { /* sampling, returns quasi-random vector in [sizex,sizey]^2 plane */ QMC_sampleRect(samp3d, qsa, shi->thread, samples, lar->area_size, lar->area_sizey); Index: source/blender/render/intern/source/shadeinput.c =================================================================== --- source/blender/render/intern/source/shadeinput.c (revision 12834) +++ source/blender/render/intern/source/shadeinput.c (working copy) @@ -754,6 +754,11 @@ VECCOPY(shi->vn, shi->facenor); } + /* normal in worldspace, used in Diffuse SH IBL, and nodes */ + VECCOPY(shi->worldnor, shi->vn); + Mat4Mul3Vecfl(R.viewinv, shi->worldnor); + VecMulf(shi->worldnor, -1.0f); + /* used in nodes */ VECCOPY(shi->vno, shi->vn); Index: source/blender/render/intern/source/shadeoutput.c =================================================================== --- source/blender/render/intern/source/shadeoutput.c (revision 12834) +++ source/blender/render/intern/source/shadeoutput.c (working copy) @@ -1573,6 +1573,10 @@ } } + /* ibl, adds results in diff and shad pass */ + if(R.wrld.mode & WO_IMAGE_BASED_LIGHTING) + image_based_lighting(shi, shr); + /* lighting pass */ if(passflag & (SCE_PASS_COMBINED|SCE_PASS_DIFFUSE|SCE_PASS_SPEC|SCE_PASS_SHADOW)) { GroupObject *go; Index: source/blender/render/intern/source/convertblender.c =================================================================== --- source/blender/render/intern/source/convertblender.c (revision 12834) +++ source/blender/render/intern/source/convertblender.c (working copy) @@ -4241,8 +4241,17 @@ init_render_hammersley(re); else if (re->wrld.ao_samp_method == WO_AOSAMP_CONSTANT) init_ao_sphere(&re->wrld); + + if (re->wrld.aocolor == WO_AODIFFUSESH) + ibl_diffusesh_prefilter(re); } + if(re->wrld.mode & WO_IMAGE_BASED_LIGHTING) { + if (re->wrld.ibl_method == WO_IBL_DIFFUSESH) { + ibl_diffusesh_prefilter(re); + } + } + /* still bad... doing all */ init_render_textures(re); init_render_materials(re->r.mode, &re->wrld.ambr); Index: source/blender/render/intern/include/render_types.h =================================================================== --- source/blender/render/intern/include/render_types.h (revision 12834) +++ source/blender/render/intern/include/render_types.h (working copy) @@ -33,6 +33,7 @@ /* ------------------------------------------------------------------------- */ #include "DNA_color_types.h" +#include "DNA_image_types.h" #include "DNA_scene_types.h" #include "DNA_world_types.h" #include "DNA_object_types.h" Index: source/blender/render/intern/include/rendercore.h =================================================================== --- source/blender/render/intern/include/rendercore.h (revision 12834) +++ source/blender/render/intern/include/rendercore.h (working copy) @@ -104,5 +104,8 @@ extern void init_render_hammersley(Render *re); extern void free_render_qmcsampler(Render *re); +extern void ibl_diffusesh_prefilter(Render *re); +extern void prefilter_bant(Render *re); + #endif /* RENDER_EXT_H */ Index: source/blender/render/extern/include/RE_shader_ext.h =================================================================== --- source/blender/render/extern/include/RE_shader_ext.h (revision 12834) +++ source/blender/render/extern/include/RE_shader_ext.h (working copy) @@ -127,6 +127,7 @@ float lo[3], gl[3], ref[3], orn[3], winco[3], sticky[3], vcol[4], rad[3]; float refcol[4], displace[3]; float strand, tang[3], stress, winspeed[4]; + float worldnor[3]; ShadeInputUV uv[8]; /* 8 = MAX_MTFACE */ ShadeInputCol col[8]; /* 8 = MAX_MCOL */ Index: source/blender/python/api2_2x/World.h =================================================================== --- source/blender/python/api2_2x/World.h (revision 12834) +++ source/blender/python/api2_2x/World.h (working copy) @@ -34,6 +34,7 @@ #define EXPP_WORLD_H #include +#include "DNA_image_types.h" #include "DNA_world_types.h" #define BPy_World_Check(v) ((v)->ob_type==&World_Type) Index: source/blender/python/api2_2x/meshPrimitive.c =================================================================== --- source/blender/python/api2_2x/meshPrimitive.c (revision 12834) +++ source/blender/python/api2_2x/meshPrimitive.c (working copy) @@ -49,7 +49,7 @@ */ static PyObject *make_mesh( int type, char *name, short tot, short seg, - short subdiv, float dia, float height, short ext, short fill ) + short subdiv, float dia, float height, short ext, short fill, short smooth ) { float cent[3] = {0,0,0}; float imat[3][3]={{1,0,0},{0,1,0},{0,0,1}}; @@ -74,6 +74,7 @@ subdiv, /* subdivisions (for Icosphere only) */ dia, -height, /* diameter-ish, height */ ext, fill, /* extrude, fill end faces */ + smooth, /* whether to set faces smooth shaded */ cent ); /* location of center */ /* copy primitive back to the real mesh */ @@ -109,7 +110,7 @@ "expected optional float arg" ); size *= (float)(sqrt(2.0)/2.0); - return make_mesh( 0, "Plane", 4, 0, 0, size, -size, 0, 1 ); + return make_mesh( 0, "Plane", 4, 0, 0, size, -size, 0, 1, 0 ); } static PyObject *M_MeshPrim_Cube( PyObject *self_unused, PyObject *args ) @@ -123,7 +124,7 @@ height /= 2.0; dia = height * (float)sqrt(2.0); - return make_mesh( 1, "Cube", 4, 32, 2, dia, -height, 1, 1 ); + return make_mesh( 1, "Cube", 4, 32, 2, dia, -height, 1, 1, 0 ); } static PyObject *M_MeshPrim_Circle( PyObject *self_unused, PyObject *args ) @@ -139,7 +140,7 @@ "number of vertices must be in the range [3:100]" ); size /= 2.0; - return make_mesh( 4, "Circle", tot, 0, 0, size, -size, 0, 0 ); + return make_mesh( 4, "Circle", tot, 0, 0, size, -size, 0, 0, 0); } static PyObject *M_MeshPrim_Cylinder( PyObject *self_unused, PyObject *args ) @@ -155,7 +156,7 @@ return EXPP_ReturnPyObjError( PyExc_ValueError, "number of vertices must be in the range [3:100]" ); - return make_mesh( 5, "Cylinder", tot, 0, 0, size/2.0, -len/2.0, 1, 1 ); + return make_mesh( 5, "Cylinder", tot, 0, 0, size/2.0, -len/2.0, 1, 1, 0 ); } static PyObject *M_MeshPrim_Tube( PyObject *self_unused, PyObject *args ) @@ -171,7 +172,7 @@ return EXPP_ReturnPyObjError( PyExc_ValueError, "number of vertices must be in the range [3:100]" ); - return make_mesh( 6, "Tube", tot, 0, 0, size/2.0, -len/2.0, 1, 0 ); + return make_mesh( 6, "Tube", tot, 0, 0, size/2.0, -len/2.0, 1, 0, 0 ); } static PyObject *M_MeshPrim_Cone( PyObject *self_unused, PyObject *args ) @@ -187,7 +188,7 @@ return EXPP_ReturnPyObjError( PyExc_ValueError, "number of vertices must be in the range [3:100]" ); - return make_mesh( 7, "Cone", tot, 0, 0, size/2.0, -len/2.0, 0, 1 ); + return make_mesh( 7, "Cone", tot, 0, 0, size/2.0, -len/2.0, 0, 1, 0 ); } static PyObject *M_MeshPrim_Grid( PyObject *self_unused, PyObject *args ) @@ -204,7 +205,7 @@ "resolution must be in the range [2:100]" ); size /= 2.0; - return make_mesh( 10, "Grid", xres, yres, 0, size, -size, 0, 0 ); + return make_mesh( 10, "Grid", xres, yres, 0, size, -size, 0, 0, 0 ); } static PyObject *M_MeshPrim_UVsphere( PyObject *self_unused, PyObject *args ) @@ -221,7 +222,7 @@ "segments and rings must be in the range [3:100]" ); size /= 2.0; - return make_mesh( 11, "UVsphere", segs, rings, 0, size, -size, 0, 0 ); + return make_mesh( 11, "UVsphere", segs, rings, 0, size, -size, 0, 0, 1 ); } static PyObject *M_MeshPrim_Icosphere( PyObject *self_unused, PyObject *args ) @@ -237,12 +238,12 @@ "subdivisions must be in the range [1:5]" ); size /= 2.0; - return make_mesh( 12, "Icosphere", 0, 0, subdiv, size, -size, 0, 0 ); + return make_mesh( 12, "Icosphere", 0, 0, subdiv, size, -size, 0, 0, 1 ); } static PyObject *M_MeshPrim_Suzanne( PyObject *self_unused, PyObject *args ) { - return make_mesh( 13, "Monkey", 0, 0, 0, 0, 0, 0, 0 ); + return make_mesh( 13, "Monkey", 0, 0, 0, 0, 0, 0, 0, 1 ); } static struct PyMethodDef M_MeshPrim_methods[] = { Index: source/blender/blenkernel/intern/world.c =================================================================== --- source/blender/blenkernel/intern/world.c (revision 12834) +++ source/blender/blenkernel/intern/world.c (working copy) @@ -37,6 +37,7 @@ #include #include "MEM_guardedalloc.h" +#include "DNA_image_types.h" #include "DNA_world_types.h" #include "DNA_texture_types.h" #include "DNA_scriptlink_types.h" @@ -86,6 +87,7 @@ World *add_world(char *name) { World *wrld; + ImageUser *iuser; wrld= alloc_libblock(&G.main->world, ID_WO, name); @@ -107,6 +109,14 @@ wrld->physicsEngine= WOPHY_BULLET;//WOPHY_SUMO; Bullet by default wrld->preview = NULL; + + iuser = &(wrld->ibl_iuser); + + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; + + wrld->ibl_multiplier = 1.0; return wrld; } Index: source/blender/makesdna/DNA_world_types.h =================================================================== --- source/blender/makesdna/DNA_world_types.h (revision 12834) +++ source/blender/makesdna/DNA_world_types.h (working copy) @@ -39,12 +39,18 @@ struct Ipo; struct MTex; +struct Image; +struct ImageUser; #ifndef MAX_MTEX #define MAX_MTEX 10 #endif +typedef struct Ibl { + float dsh_coeffs[9][3]; +} Ibl; + /** * World defines general modeling data such as a background fill, * gravity, color model, stars, etc. It mixes game-data, rendering @@ -110,13 +116,20 @@ float *aosphere, *aotables; + short ibl_method; + short pad3; + float ibl_multiplier; + struct Image *ibl_image; + struct ImageUser ibl_iuser; struct Ipo *ipo; struct MTex *mtex[10]; /* previews */ struct PreviewImage *preview; - + + float dsh_coeffs[9][3]; + int padblah; ScriptLink scriptlink; } World; @@ -137,6 +150,7 @@ #define WO_DOF 4 #define WO_ACTIVITY_CULLING 8 #define WO_AMB_OCC 16 +#define WO_IMAGE_BASED_LIGHTING 32 /* aomix */ #define WO_AOADD 0 @@ -156,7 +170,11 @@ #define WO_AOPLAIN 0 #define WO_AOSKYCOL 1 #define WO_AOSKYTEX 2 +#define WO_AODIFFUSESH 3 +/* ibl_method */ +#define WO_IBL_DIFFUSESH 0 + /* texco (also in DNA_material_types.h) */ #define TEXCO_ANGMAP 64 #define TEXCO_H_SPHEREMAP 256 Index: source/blender/include/BIF_editmesh.h =================================================================== --- source/blender/include/BIF_editmesh.h (revision 12834) +++ source/blender/include/BIF_editmesh.h (working copy) @@ -70,7 +70,7 @@ /* ******************* editmesh_add.c */ extern void make_prim(int type, float imat[3][3], int tot, int seg, - int subdiv, float dia, float d, int ext, int fill, + int subdiv, float dia, float d, int ext, int fill, int smooth, float cent[3] ); extern void add_primitiveMesh(int type); extern void adduplicate_mesh(void); Index: source/blender/src/editmesh_add.c =================================================================== --- source/blender/src/editmesh_add.c (revision 12834) +++ source/blender/src/editmesh_add.c (working copy) @@ -874,7 +874,7 @@ void make_prim(int type, float imat[3][3], int tot, int seg, int subdiv, float dia, float d, int ext, int fill, - float cent[3]) + int smooth, float cent[3]) { /* * type - for the type of shape @@ -882,11 +882,13 @@ * d - depth for the cone * ext - ? * fill - end capping, and option to fill in circle + * smooth - whether to set smooth spheres, cylinder walls * cent[3] - center of the data. * */ EditMesh *em = G.editMesh; EditVert *eve, *v1=NULL, *v2, *v3, *v4=NULL, *vtop, *vdown; + EditFace *efa; float phi, phid, vec[3]; float q[4], cmat[3][3], nor[3]= {0.0, 0.0, 0.0}; short a, b; @@ -1158,6 +1160,15 @@ addfacelist(vtop, v1, v3, 0, NULL, NULL); } } + + if (smooth) { + efa= em->faces.first; + while(efa) { + efa->flag |= ME_SMOOTH; + efa= efa->next; + } + } + /* simple selection flush OK, based on fact it's a single model */ EM_select_flush(); /* flushes vertex -> edge -> face selection */ @@ -1171,10 +1182,12 @@ float *curs, d, dia, phi, phid, cent[3], imat[3][3], mat[3][3]; float cmat[3][3]; static int tot=32, seg=32, subdiv=2, - /* so each type remembers its fill setting */ - fill_circle=0, fill_cone=1, fill_cylinder=1; + /* so each type remembers its setting */ + fill_circle=0, fill_cone=1, fill_cylinder=1, + smooth_uvsphere=1, smooth_icosphere=1, smooth_monkey=1; + - int ext=0, fill=0, totoud, newob=0; + int ext=0, fill=0, smooth=0, totoud, newob=0; char *undostr="Add Primitive"; char *name=NULL; @@ -1271,9 +1284,11 @@ add_numbut(0, NUM|INT, "Segments:", 3, 500, &seg, NULL); add_numbut(1, NUM|INT, "Rings:", 3, 500, &tot, NULL); add_numbut(2, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); + add_numbut(3, TOG|INT, "Smooth", 0, 0, &(smooth_uvsphere), NULL); - if (!(do_clever_numbuts("Add UV Sphere", 3, REDRAW))) return; + if (!(do_clever_numbuts("Add UV Sphere", 4, REDRAW))) return; + smooth = smooth_uvsphere; newob = confirm_objectExists( &me, mat ); if(newob) name = "Sphere"; undostr="Add UV Sphere"; @@ -1281,14 +1296,19 @@ case 12: /* Icosphere */ add_numbut(0, NUM|INT, "Subdivision:", 1, 8, &subdiv, NULL); add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - if (!(do_clever_numbuts("Add Ico Sphere", 2, REDRAW))) return; + add_numbut(2, TOG|INT, "Smooth", 0, 0, &(smooth_icosphere), NULL); + if (!(do_clever_numbuts("Add Ico Sphere", 3, REDRAW))) return; + + smooth = smooth_icosphere; newob = confirm_objectExists( &me, mat ); if(newob) name = "Sphere"; undostr="Add Ico Sphere"; break; case 13: /* Monkey */ newob = confirm_objectExists( &me, mat ); + + smooth = smooth_monkey; if(newob) name = "Suzanne"; undostr="Add Monkey"; break; @@ -1322,7 +1342,7 @@ phid= 2*M_PI/tot; phi= .25*M_PI; - make_prim(type, imat, tot, seg, subdiv, dia, d, ext, fill, cent); + make_prim(type, imat, tot, seg, subdiv, dia, d, ext, fill, smooth, cent); if(type<2) tot = totoud; Index: source/blender/src/buttons_shading.c =================================================================== --- source/blender/src/buttons_shading.c (revision 12834) +++ source/blender/src/buttons_shading.c (working copy) @@ -2131,13 +2131,70 @@ } +static void world_panel_ibl(World *wrld) +{ + uiBlock *block; + short yco=PANEL_YMAX; + char *strp; + struct ImageUser *iuser= &(wrld->ibl_iuser); + uiBut *but; + + block= uiNewBlock(&curarea->uiblocks, "world_panel_ibl", UI_EMBOSS, UI_HELV, curarea->win); + uiNewPanelTabbed("Amb Occ", "World"); + if(uiNewPanel(curarea, block, "Image Based Lighting", "World", PANELX, PANELY, PANELW, PANELH)==0) return; + + uiDefButBitS(block, TOG, WO_IMAGE_BASED_LIGHTING, B_REDR, "Image Based Lighting", + X2CLM1, yco-=BUTH, BUTW1, BUTH, &wrld->mode, 0, 0, 0, 0, "Enables lighting from an environment image (light probe)"); + + yco -= YSPACE; + + uiDefButF(block, NUM, B_REDR, "Multiplier:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->ibl_multiplier, 0.0, 100.0, 1.0, 0, "Multiply the final result to brighten or darken the lighting"); + + uiDefButS(block, MENU, B_REDR, "Calculation Method %t|Diffuse Irradiance (Spherical Harmonics) %x0", + X2CLM2, yco, BUTW2, BUTH, &wrld->ibl_method, 0, 0, 0, 0, ""); + + yco -= YSPACE; + + /* Browse */ + IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), NULL, &iuser->menunr); + + uiBlockBeginAlign(block); + but= uiDefButS(block, MENU, B_REDR, strp, + X2CLM1, yco-=BUTH, ICONBUTW, BUTH, &iuser->menunr, 0, 0, 0, 0, "Selects an existing Image or Movie"); + uiButSetFunc(but, image_browse_cb, &(wrld->ibl_image), iuser); + + MEM_freeN(strp); + + if (wrld->ibl_image != NULL) { + if (wrld->ibl_image->source != IMA_SRC_FILE) { + uiDefBut(block, LABEL, 0, "Still images only", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); /* for align in panel */ + return; + } + uiSetButLock(wrld->ibl_image->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); + + but= uiDefBut(block, TEX, B_IDNAME, "IM:", + X2CLM1+ICONBUTW, yco, BUTW2-ICONBUTW, BUTH, wrld->ibl_image->id.name+2, 0.0, 21.0, 0, 0, "Current Image Datablock name."); + uiButSetFunc(but, test_idbutton_cb, wrld->ibl_image->id.name, NULL); + + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, + X2CLM2, yco, ICONBUTW, BUTH, 0, 0, 0, 0, 0, "Unlink Image block"); + uiButSetFunc(but, image_unlink_cb, &(wrld->ibl_image), NULL); + + } else { + but= uiDefBut(block, BUT, B_REDR, "Load", + X2CLM1+ICONBUTW, yco, BUTW2-ICONBUTW, BUTH, NULL, 0, 0, 0, 0, "Load new Image"); + uiButSetFunc(but, image_load_fs_cb, &(wrld->ibl_image), iuser); + } +} + static void world_panel_amb_occ(World *wrld) { uiBlock *block; short yco=PANEL_YMAX; block= uiNewBlock(&curarea->uiblocks, "world_panel_amb_oc", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Mist / Stars / Physics", "World"); if(uiNewPanel(curarea, block, "Amb Occ", "World", PANELX, PANELY, PANELW, PANELH)==0) return; uiBlockSetCol(block, TH_BUT_SETTING1); @@ -2203,12 +2260,8 @@ /* color treatment */ uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_REDR, "Plain", - X3CLM1, yco-=BUTH, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOPLAIN, 0, 0, "Plain diffuse energy (white)"); - uiDefButS(block, ROW, B_REDR, "Sky Color", - X3CLM2, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYCOL, 0, 0, "Use horizon and zenith color for diffuse energy"); - uiDefButS(block, ROW, B_REDR, "Sky Texture", - X3CLM3, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYTEX, 0, 0, "Does full Sky texture render for diffuse energy"); + uiDefButS(block, MENU, B_REDR, "Plain %x0|Sky Color %x1|Sky Texture %x2|Diffuse SH %x3", + X3CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aocolor, 0.0, (float)WO_AOPLAIN, 0, 0, ""); uiBlockEndAlign(block); yco -= YSPACE; @@ -4229,6 +4282,7 @@ if(wrld) { world_panel_mistaph(wrld); world_panel_amb_occ(wrld); + world_panel_ibl(wrld); world_panel_texture(wrld); world_panel_mapto(wrld); } Index: source/blender/blenloader/intern/readfile.c =================================================================== --- source/blender/blenloader/intern/readfile.c (revision 12834) +++ source/blender/blenloader/intern/readfile.c (working copy) @@ -7196,6 +7196,8 @@ if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 11)) { Object *ob; bActionStrip *strip; + World *wrld; + ImageUser *iuser; /* nla-strips - scale */ for (ob= main->object.first; ob; ob= ob->id.next) { @@ -7215,6 +7217,16 @@ if (strip->scale == 0.0f) strip->scale= 1.0f; } } + + for(wrld=main->world.first; wrld; wrld= wrld->id.next) { + iuser = &(wrld->ibl_iuser); + + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; + wrld->ibl_multiplier = 1.0; + } + } Index: source/blender/nodes/intern/SHD_util.h =================================================================== --- source/blender/nodes/intern/SHD_util.h (revision 12834) +++ source/blender/nodes/intern/SHD_util.h (working copy) @@ -109,6 +109,7 @@ #define GEOM_OUT_NORMAL 5 #define GEOM_OUT_VCOL 6 #define GEOM_OUT_FRONTBACK 7 +#define GEOM_OUT_WORLDNORMAL 8 /* input socket defines */ Index: source/blender/nodes/intern/SHD_nodes/SHD_geom.c =================================================================== --- source/blender/nodes/intern/SHD_nodes/SHD_geom.c (revision 12834) +++ source/blender/nodes/intern/SHD_nodes/SHD_geom.c (working copy) @@ -39,9 +39,10 @@ { SOCK_VECTOR, 0, "View", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { SOCK_VECTOR, 0, "Orco", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { SOCK_VECTOR, 0, "UV", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, - { SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, + { SOCK_VECTOR, 0, "View Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { SOCK_RGBA, 0, "Vertex Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VALUE, 0, "Front/Back", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { SOCK_VECTOR, 0, "World Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { -1, 0, "" } }; @@ -73,6 +74,7 @@ VECCOPY(out[GEOM_OUT_ORCO]->vec, shi->lo); VECCOPY(out[GEOM_OUT_UV]->vec, suv->uv); VECCOPY(out[GEOM_OUT_NORMAL]->vec, shi->vno); + VECCOPY(out[GEOM_OUT_WORLDNORMAL]->vec, shi->worldnor); if (shi->totcol) { /* find vertex color layer by name */ Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 12834) +++ CMakeLists.txt (working copy) @@ -57,16 +57,16 @@ #----------------------------------------------------------------------------- # Set default config options OPTION(WITH_PLAYER "Build Player" OFF) -OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) -OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) +OPTION(WITH_GAMEENGINE "Enable Game Engine" OFF) +OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" OFF) OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) OPTION(WITH_VERSE "Enable Verse (http://verse.blender.org)" OFF) OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) -OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) -OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" OFF) +OPTION(WITH_QUICKTIME "Enable Quicktime Support" ON) +OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) -OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) -OPTION(YESIAMSTUPID "Enable execution on 64-bit platforms" OFF) +OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) +OPTION(YESIAMSTUPID "Enable execution on 64-bit platforms" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") @@ -299,22 +299,28 @@ SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc) ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386) - INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake) - IF(OPENAL_FOUND) - SET(WITH_OPENAL ON) - SET(OPENAL_LIB ${OPENAL_LIBRARY}) - SET(OPENAL_INC ${OPENAL_INCLUDE_DIR}) - ELSE(OPENAL_FOUND) - SET(WITH_OPENAL OFF) - ENDIF(OPENAL_FOUND) + #INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake) + #IF(OPENAL_FOUND) + # SET(WITH_OPENAL ON) + # SET(OPENAL_LIB ${OPENAL_LIBRARY}) + # SET(OPENAL_INC ${OPENAL_INCLUDE_DIR}) + #ELSE(OPENAL_FOUND) + # SET(WITH_OPENAL OFF) + #ENDIF(OPENAL_FOUND) + + SET(WITH_OPENAL ON) + SET(OPENAL ${LIBDIR}/openal) + SET(OPENAL_INC ${OPENAL}/include) + SET(OPENAL_LIBPATH ${OPENAL}/lib) + SET(OPENAL_LIB openal) SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) - SET(PYTHON_VERSION 2.3) + SET(PYTHON_VERSION 2.5) SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") SET(PYTHON_LIB "") SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") - SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python") + SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") SET(GETTEXT ${LIBDIR}/gettext) SET(GETTEXT_INC "${GETTEXT}/include")