Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/envmap.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| #include "DNA_image_types.h" | #include "DNA_image_types.h" | ||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_texture_types.h" | #include "DNA_texture_types.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_image.h" /* BKE_imbuf_write */ | #include "BKE_image.h" /* BKE_imbuf_write */ | ||||
| #include "BKE_localview.h" | |||||
| #include "BKE_texture.h" | #include "BKE_texture.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| /* this module */ | /* this module */ | ||||
| #include "render_types.h" | #include "render_types.h" | ||||
| #include "envmap.h" | #include "envmap.h" | ||||
| #include "renderdatabase.h" | #include "renderdatabase.h" | ||||
| #include "renderpipeline.h" | #include "renderpipeline.h" | ||||
| ▲ Show 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | void make_envmaps(Render *re) | ||||
| /* 5 = hardcoded max recursion level */ | /* 5 = hardcoded max recursion level */ | ||||
| while (depth < 5) { | while (depth < 5) { | ||||
| tex = re->main->tex.first; | tex = re->main->tex.first; | ||||
| while (tex) { | while (tex) { | ||||
| if (tex->id.us && tex->type == TEX_ENVMAP) { | if (tex->id.us && tex->type == TEX_ENVMAP) { | ||||
| if (tex->env && tex->env->object) { | if (tex->env && tex->env->object) { | ||||
| EnvMap *env = tex->env; | EnvMap *env = tex->env; | ||||
| if (env->object->lay & re->lay) { | if (env->object->lay & re->lay && BKE_localview_info_cmp(env->object->localview, *re->localview)) { | ||||
| if (env->stype == ENV_LOAD) { | if (env->stype == ENV_LOAD) { | ||||
| float orthmat[4][4], mat[4][4], tmat[4][4]; | float orthmat[4][4], mat[4][4], tmat[4][4]; | ||||
| /* precalc orthmat for object */ | /* precalc orthmat for object */ | ||||
| copy_m4_m4(orthmat, env->object->obmat); | copy_m4_m4(orthmat, env->object->obmat); | ||||
| normalize_m4(orthmat); | normalize_m4(orthmat); | ||||
| /* need imat later for texture imat */ | /* need imat later for texture imat */ | ||||
| ▲ Show 20 Lines • Show All 250 Lines • Show Last 20 Lines | |||||