Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-08-27 09:42:50 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-08-27 09:56:56 +0300
commit66700196074ad168f3322f2766846a0a07f7a00f (patch)
treef3f90a971ad58a78c7618c18e9ac693974c7ee99 /source/blender/blenkernel/BKE_studiolight.h
parentbc51250c1fbfe8309e42a4a0b6257e93939346a7 (diff)
Workbench: Specular Highlighting for MatCaps
With Blender 2.80 we introduced a more flexible matcap system. One change we did was to multiply the matcap with the base color that was shaded. As matcaps contains diffuse and specular lighting in a single texture this lead to rendering artifacts. Artists were complaining that everything looked to metalic. We now support a separate `diffuse` and `specular` pass for matcaps. `shaded_color = diffuse_light * base_color + specular_light` For matcaps to support this feature they need to be multilayer openexr files with 2 renderpasses (named `diffuse` and `specular`). In the future we can change this to first pass/second pass in stead of this naming convention. Reviewed By: fclem, brecht Differential Revision: https://developer.blender.org/D5335
Diffstat (limited to 'source/blender/blenkernel/BKE_studiolight.h')
-rw-r--r--source/blender/blenkernel/BKE_studiolight.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h
index d6fff528348..108e93d9caa 100644
--- a/source/blender/blenkernel/BKE_studiolight.h
+++ b/source/blender/blenkernel/BKE_studiolight.h
@@ -87,6 +87,11 @@ enum StudioLightFlag {
STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED = (1 << 11),
STUDIOLIGHT_USER_DEFINED = (1 << 12),
STUDIOLIGHT_UI_EXPANDED = (1 << 13),
+
+ STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE = (1 << 14),
+ STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE = (1 << 15),
+ /* Is set for studio lights and matcaps with specular highlight pass. */
+ STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS = (1 << 16),
};
#define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE)
@@ -97,6 +102,11 @@ enum StudioLightFlag {
typedef void StudioLightFreeFunction(struct StudioLight *, void *data);
+typedef struct StudioLightImage {
+ ImBuf *ibuf;
+ struct GPUTexture *gputexture;
+} StudioLightImage;
+
typedef struct StudioLight {
struct StudioLight *next, *prev;
@@ -112,6 +122,8 @@ typedef struct StudioLight {
int icon_id_matcap_flipped;
float spherical_harmonics_coefs[STUDIOLIGHT_SH_EFFECTIVE_COEFS_LEN][3];
float light_direction[3];
+ StudioLightImage matcap_diffuse;
+ StudioLightImage matcap_specular;
ImBuf *equirect_radiance_buffer;
ImBuf *equirect_irradiance_buffer;
ImBuf *radiance_cubemap_buffers[6];