Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_private.h
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | typedef struct WORKBENCH_UBO_World { | ||||
| float shadow_direction_vs[4]; | float shadow_direction_vs[4]; | ||||
| WORKBENCH_UBO_Light lights[4]; | WORKBENCH_UBO_Light lights[4]; | ||||
| float ambient_color[4]; | float ambient_color[4]; | ||||
| int num_lights; | int num_lights; | ||||
| int matcap_orientation; | int matcap_orientation; | ||||
| float background_alpha; | float background_alpha; | ||||
| float curvature_ridge; | float curvature_ridge; | ||||
| float curvature_valley; | float curvature_valley; | ||||
| int pad[3]; | float background_dither_factor; | ||||
| int pad[2]; | |||||
| } WORKBENCH_UBO_World; | } WORKBENCH_UBO_World; | ||||
| BLI_STATIC_ASSERT_ALIGN(WORKBENCH_UBO_World, 16) | BLI_STATIC_ASSERT_ALIGN(WORKBENCH_UBO_World, 16) | ||||
| typedef struct WORKBENCH_PrivateData { | typedef struct WORKBENCH_PrivateData { | ||||
| struct GHash *material_hash; | struct GHash *material_hash; | ||||
| struct GHash *material_transp_hash; | struct GHash *material_transp_hash; | ||||
| struct GPUShader *prepass_sh; | struct GPUShader *prepass_sh; | ||||
| struct GPUShader *prepass_hair_sh; | struct GPUShader *prepass_hair_sh; | ||||
| ▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | else if (VERTEX_COLORS_ENABLED(wpd)) { | ||||
| result = GPU_RGBA16; | result = GPU_RGBA16; | ||||
| } | } | ||||
| else { | else { | ||||
| result = GPU_RGBA8; | result = GPU_RGBA8; | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| BLI_INLINE bool workbench_background_dither_factor(const WORKBENCH_PrivateData *wpd) { | |||||
| /* Only apply dithering when rendering on a RGBA8 texture. | |||||
| * The dithering will remove banding when using a gradient as background */ | |||||
| return workbench_color_texture_format(wpd) == GPU_RGBA8; | |||||
| } | |||||
| /* workbench_deferred.c */ | /* workbench_deferred.c */ | ||||
| void workbench_deferred_engine_init(WORKBENCH_Data *vedata); | void workbench_deferred_engine_init(WORKBENCH_Data *vedata); | ||||
| void workbench_deferred_engine_free(void); | void workbench_deferred_engine_free(void); | ||||
| void workbench_deferred_draw_background(WORKBENCH_Data *vedata); | void workbench_deferred_draw_background(WORKBENCH_Data *vedata); | ||||
| void workbench_deferred_draw_scene(WORKBENCH_Data *vedata); | void workbench_deferred_draw_scene(WORKBENCH_Data *vedata); | ||||
| void workbench_deferred_draw_finish(WORKBENCH_Data *vedata); | void workbench_deferred_draw_finish(WORKBENCH_Data *vedata); | ||||
| void workbench_deferred_cache_init(WORKBENCH_Data *vedata); | void workbench_deferred_cache_init(WORKBENCH_Data *vedata); | ||||
| void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob); | void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob); | ||||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||