Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_draw.c
| Show First 20 Lines • Show All 1,547 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void GPU_end_dupli_object(void) | void GPU_end_dupli_object(void) | ||||
| { | { | ||||
| GMS.dob = NULL; | GMS.dob = NULL; | ||||
| } | } | ||||
| void GPU_begin_object_materials( | void GPU_begin_object_materials( | ||||
| View3D *v3d, RegionView3D *rv3d, Scene *scene, SceneLayer *scene_layer, Object *ob, | View3D *v3d, RegionView3D *rv3d, Scene *scene, ViewLayer *view_layer, Object *ob, | ||||
| bool glsl, bool *do_alpha_after) | bool glsl, bool *do_alpha_after) | ||||
| { | { | ||||
| Material *ma; | Material *ma; | ||||
| GPUMaterial *gpumat; | GPUMaterial *gpumat; | ||||
| GPUBlendMode alphablend; | GPUBlendMode alphablend; | ||||
| DupliObject *dob; | DupliObject *dob; | ||||
| int a; | int a; | ||||
| const bool gamma = BKE_scene_check_color_management_enabled(scene); | const bool gamma = BKE_scene_check_color_management_enabled(scene); | ||||
| Show All 22 Lines | if (derivedFinal != NULL && derivedFinal->type == DM_TYPE_CCGDM) { | ||||
| CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) derivedFinal; | CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) derivedFinal; | ||||
| use_opensubdiv = ccgdm->useGpuBackend; | use_opensubdiv = ccgdm->useGpuBackend; | ||||
| } | } | ||||
| } | } | ||||
| #endif | #endif | ||||
| #ifdef WITH_GAMEENGINE | #ifdef WITH_GAMEENGINE | ||||
| if (rv3d->rflag & RV3D_IS_GAME_ENGINE) { | if (rv3d->rflag & RV3D_IS_GAME_ENGINE) { | ||||
| ob = BKE_object_lod_matob_get(ob, scene_layer); | ob = BKE_object_lod_matob_get(ob, view_layer); | ||||
| } | } | ||||
| #else | #else | ||||
| UNUSED_VARS(scene_layer); | UNUSED_VARS(view_layer); | ||||
| #endif | #endif | ||||
| /* initialize state */ | /* initialize state */ | ||||
| /* DupliObject must be restored */ | /* DupliObject must be restored */ | ||||
| dob = GMS.dob; | dob = GMS.dob; | ||||
| memset(&GMS, 0, sizeof(GMS)); | memset(&GMS, 0, sizeof(GMS)); | ||||
| GMS.is_enabled = true; | GMS.is_enabled = true; | ||||
| GMS.dob = dob; | GMS.dob = dob; | ||||
| ▲ Show 20 Lines • Show All 417 Lines • ▼ Show 20 Lines | for (int a = 0; a < 8; a++) { | ||||
| } | } | ||||
| else | else | ||||
| GPU_basic_shader_light_set(a, NULL); | GPU_basic_shader_light_set(a, NULL); | ||||
| } | } | ||||
| return count; | return count; | ||||
| } | } | ||||
| int GPU_scene_object_lights(SceneLayer *scene_layer, float viewmat[4][4], int ortho) | int GPU_scene_object_lights(ViewLayer *view_layer, float viewmat[4][4], int ortho) | ||||
| { | { | ||||
| /* disable all lights */ | /* disable all lights */ | ||||
| for (int count = 0; count < 8; count++) | for (int count = 0; count < 8; count++) | ||||
| GPU_basic_shader_light_set(count, NULL); | GPU_basic_shader_light_set(count, NULL); | ||||
| /* view direction for specular is not computed correct by default in | /* view direction for specular is not computed correct by default in | ||||
| * opengl, so we set the settings ourselves */ | * opengl, so we set the settings ourselves */ | ||||
| GPU_basic_shader_light_set_viewer(!ortho); | GPU_basic_shader_light_set_viewer(!ortho); | ||||
| int count = 0; | int count = 0; | ||||
| for (Base *base = FIRSTBASE(scene_layer); base; base = base->next) { | for (Base *base = FIRSTBASE(view_layer); base; base = base->next) { | ||||
| if (base->object->type != OB_LAMP) | if (base->object->type != OB_LAMP) | ||||
| continue; | continue; | ||||
| Lamp *la = base->object->data; | Lamp *la = base->object->data; | ||||
| /* setup lamp transform */ | /* setup lamp transform */ | ||||
| gpuPushMatrix(); | gpuPushMatrix(); | ||||
| gpuLoadMatrix(viewmat); | gpuLoadMatrix(viewmat); | ||||
| ▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines | |||||