diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-19 14:07:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-19 14:07:09 +0300 |
commit | e0dfe62d8ccf8cc0c7f7451ce91a30f025375a27 (patch) | |
tree | 087441347774cd7876a5e509c41f5c0189752a0b | |
parent | 0d80e08e8a24e43f3225d3c3a458ed8555cbe8e2 (diff) |
Bug #8234: sky texture for approximate AO doesn't work, as mentioned
in the commit log. Couldn't get this to work well, probably this would
work a lot better with the IBL spherical harmonics feature, so I've just
disabled the option in the interface for now.
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 8 | ||||
-rw-r--r-- | source/blender/src/buttons_shading.c | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 624a92e6394..22ddebe356c 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1284,6 +1284,7 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float } if(occ) *occ= resultocc; + if(bentn) Normalize(bentn); } static void occ_compute_passes(Render *re, OcclusionTree *tree, int totpass) @@ -1342,18 +1343,23 @@ static void sample_occ_tree(Render *re, OcclusionTree *tree, OccFace *exclude, f if(aocolor) { /* sky shading using bent normal */ - if(aocolor==WO_AOSKYCOL) { + if(ELEM(aocolor, WO_AOSKYCOL, WO_AOSKYTEX)) { fac= 0.5*(1.0f+bn[0]*re->grvec[0]+ bn[1]*re->grvec[1]+ bn[2]*re->grvec[2]); skycol[0]= (1.0f-fac)*re->wrld.horr + fac*re->wrld.zenr; skycol[1]= (1.0f-fac)*re->wrld.horg + fac*re->wrld.zeng; skycol[2]= (1.0f-fac)*re->wrld.horb + fac*re->wrld.zenb; } +#if 0 else { /* WO_AOSKYTEX */ + bn[0]= -bn[0]; + bn[1]= -bn[1]; + bn[2]= -bn[2]; dxyview[0]= 1.0f; dxyview[1]= 1.0f; dxyview[2]= 0.0f; shadeSkyView(skycol, co, bn, dxyview); } +#endif VecMulf(skycol, occlusion); } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index d8f50395bba..7945b6bacd3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2240,8 +2240,9 @@ static void world_panel_amb_occ(World *wrld) 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"); + if(wrld->ao_gather_method == WO_AOGATHER_RAYTRACE) + 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"); uiBlockEndAlign(block); yco -= YSPACE; |