Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_private.h
| Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | else if (workbench_is_in_vertex_paint_mode() || 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) | BLI_INLINE float workbench_background_dither_factor(const WORKBENCH_PrivateData *wpd) | ||||
| { | { | ||||
| /* Only apply dithering when rendering on a RGBA8 texture. | /* Only apply dithering when rendering gradient background on a RGBA8 texture. | ||||
| * The dithering will remove banding when using a gradient as background */ | * The dithering will remove banding when using a gradient as background */ | ||||
| return workbench_color_texture_format(wpd) == GPU_RGBA8; | const WORKBENCH_UBO_World *wd = &wpd->world_data; | ||||
| const float dither = ((workbench_color_texture_format(wpd) == GPU_RGBA8) && | |||||
| !equals_v3v3(wd->background_color_low, wd->background_color_high)) ? | |||||
| 1.0f : | |||||
| 0.0f; | |||||
| printf("dither: %f\n", dither); | |||||
| return dither; | |||||
| } | } | ||||
| /* 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); | ||||
| ▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines | |||||