Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/shadeoutput.c
| Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
| extern struct Render R; | extern struct Render R; | ||||
| /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ | /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ | ||||
| ListBase *get_lights(ShadeInput *shi) | ListBase *get_lights(ShadeInput *shi) | ||||
| { | { | ||||
| if (R.r.scemode & R_BUTS_PREVIEW) | if (R.r.scemode & R_BUTS_PREVIEW) | ||||
| return &R.lights; | return &R.lights; | ||||
| if (shi->light_override) | |||||
| return &shi->light_override->gobject; | |||||
| if (shi->mat && shi->mat->group) | if (shi->mat && shi->mat->group) | ||||
| return &shi->mat->group->gobject; | return &shi->mat->group->gobject; | ||||
| return &R.lights; | return &R.lights; | ||||
| } | } | ||||
| #if 0 | #if 0 | ||||
| static void fogcolor(const float colf[3], float *rco, float *view) | static void fogcolor(const float colf[3], float *rco, float *view) | ||||
| ▲ Show 20 Lines • Show All 1,999 Lines • ▼ Show 20 Lines | if (R.r.scemode & R_BUTS_PREVIEW) { | ||||
| for (go = R.lights.first; go; go = go->next) { | for (go = R.lights.first; go; go = go->next) { | ||||
| /* "Lamp.002" is main key light of material preview */ | /* "Lamp.002" is main key light of material preview */ | ||||
| if (STREQ(go->ob->id.name + 2, "Lamp.002")) | if (STREQ(go->ob->id.name + 2, "Lamp.002")) | ||||
| return lamp_get_data_internal(shi, go, col, lv, dist, shadow); | return lamp_get_data_internal(shi, go, col, lv, dist, shadow); | ||||
| } | } | ||||
| return 0.0f; | return 0.0f; | ||||
| } | } | ||||
| if (shi->light_override) { | |||||
| for (go = shi->light_override->gobject.first; go; go = go->next) { | |||||
| if (go->ob == lamp_obj) | |||||
| return lamp_get_data_internal(shi, go, col, lv, dist, shadow); | |||||
| } | |||||
| } | |||||
| if (shi->mat && shi->mat->group) { | if (shi->mat && shi->mat->group) { | ||||
| for (go = shi->mat->group->gobject.first; go; go = go->next) { | for (go = shi->mat->group->gobject.first; go; go = go->next) { | ||||
| if (go->ob == lamp_obj) | if (go->ob == lamp_obj) | ||||
| return lamp_get_data_internal(shi, go, col, lv, dist, shadow); | return lamp_get_data_internal(shi, go, col, lv, dist, shadow); | ||||
| } | } | ||||
| } | } | ||||
| for (go = R.lights.first; go; go = go->next) { | for (go = R.lights.first; go; go = go->next) { | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||