[Bf-blender-cvs] [ed7b8e847fb] temp-eeveelightcache: Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache

Clément Foucault noreply at git.blender.org
Thu Jun 28 15:55:18 CEST 2018


Commit: ed7b8e847fbc6215a38ec869da46c8c1d90e58df
Author: Clément Foucault
Date:   Thu Jun 28 15:54:48 2018 +0200
Branches: temp-eeveelightcache
https://developer.blender.org/rBed7b8e847fbc6215a38ec869da46c8c1d90e58df

Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache

# Conflicts:
#	source/blender/gpu/GPU_texture.h
#	source/blender/gpu/intern/gpu_texture.c

===================================================================



===================================================================

diff --cc release/scripts/startup/bl_ui/properties_render.py
index 4d2b8fd2163,580c31465b3..a9f50644986
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@@ -716,28 -717,10 +717,28 @@@ class RENDER_PT_eevee_indirect_lighting
          props = scene.eevee
  
          col = layout.column()
 +        col.operator("scene.light_cache_bake", text="Bake Indirect Lighting", icon='RENDER_STILL')
          col.prop(props, "gi_diffuse_bounces")
          col.prop(props, "gi_cubemap_resolution")
-         col.prop(props, "gi_visibility_resolution")
+         col.prop(props, "gi_visibility_resolution", text="Diffuse Occlusion")
  
 +        layout.use_property_split = False
 +        row = layout.row(align=True)
 +        row.label("Cubemap Display")
 +        row.prop(props, "gi_cubemap_draw_size", text="Size")
 +        if props.gi_show_cubemaps :
 +            row.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_OFF')
 +        else:
 +            row.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_ON')
 +
 +        row = layout.row(align=True)
 +        row.label("Irradiance Display")
 +        row.prop(props, "gi_irradiance_draw_size", text="Size")
 +        if props.gi_show_irradiance :
 +            row.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_OFF')
 +        else:
 +            row.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_ON')
 +
  
  class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
      bl_label = "Film"
diff --cc source/blender/gpu/GPU_texture.h
index 3fb6aefc29f,341abeba72f..3ed9014d431
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@@ -142,36 -144,8 +144,23 @@@ typedef enum GPUTextureFormat 
  	GPU_DEPTH_COMPONENT16,
  } GPUTextureFormat;
  
 +typedef enum GPUDataFormat {
 +	GPU_DATA_FLOAT,
 +	GPU_DATA_INT,
 +	GPU_DATA_UNSIGNED_INT,
 +	GPU_DATA_UNSIGNED_BYTE,
 +	GPU_DATA_UNSIGNED_INT_24_8,
 +	GPU_DATA_10_11_11_REV,
 +} GPUDataFormat;
 +
- /* These map directly to the GL_ blend functions, to minimize API add as needed*/
- typedef enum GPUBlendFunction {
- 	GPU_ONE,
- 	GPU_SRC_ALPHA,
- 	GPU_ONE_MINUS_SRC_ALPHA
- } GPUBlendFunction;
- 
- /* These map directly to the GL_ filter functions, to minimize API add as needed*/
- typedef enum GPUFilterFunction {
- 	GPU_NEAREST,
- 	GPU_LINEAR
- } GPUFilterFunction;
- 
  unsigned int GPU_texture_memory_usage_get(void);
  
 +/* TODO make it static function again. (create function with GPUDataFormat exposed) */
 +GPUTexture *GPU_texture_create_nD(
 +        int w, int h, int d, int n, const void *pixels,
 +        GPUTextureFormat tex_format, GPUDataFormat gpu_data_format, int samples,
 +        const bool can_rescale, char err_out[256]);
 +
  GPUTexture *GPU_texture_create_1D(
          int w, GPUTextureFormat data_type, const float *pixels, char err_out[256]);
  GPUTexture *GPU_texture_create_2D(
@@@ -241,12 -210,6 +230,8 @@@ bool GPU_texture_stencil(const GPUTextu
  bool GPU_texture_integer(const GPUTexture *tex);
  int GPU_texture_opengl_bindcode(const GPUTexture *tex);
  
 +void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size);
 +
- void GPU_blend(bool enable);
- void GPU_blend_set_func_separate(GPUBlendFunction src_rgb, GPUBlendFunction dst_rgb, GPUBlendFunction src_alpha, GPUBlendFunction dst_alpha);
- void GPU_blend_set_func(GPUBlendFunction sfactor, GPUBlendFunction dfactor);
- 
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/gpu/intern/gpu_texture.c
index 08490eeb6c2,ae037ca442e..3740d382562
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@@ -1435,64 -1260,3 +1435,24 @@@ int GPU_texture_detach_framebuffer(GPUT
  	BLI_assert(!"Error: Texture: Framebuffer is not attached");
  	return 0;
  }
 +
 +void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size)
 +{
 +	/* TODO assert if lvl is bellow the limit of 1px in each dimension. */
 +	int div = 1 << lvl;
 +	size[0] = max_ii(1, tex->w / div);
 +
 +	if (tex->target == GL_TEXTURE_1D_ARRAY) {
 +		size[1] = tex->h;
 +	}
 +	else if (tex->h > 0) {
 +		size[1] = max_ii(1, tex->h / div);
 +	}
 +
 +	if (tex->target == GL_TEXTURE_2D_ARRAY) {
 +		size[2] = tex->d;
 +	}
 +	else if (tex->d > 0) {
 +		size[2] = max_ii(1, tex->d / div);
 +	}
 +}
- 
- void GPU_blend(bool enable)
- {
- 	if (enable) {
- 		glEnable(GL_BLEND);
- 	}
- 	else {
- 		glDisable(GL_BLEND);
- 	}
- }
- 
- static GLenum gpu_get_gl_blendfunction(GPUBlendFunction blend)
- {
- 	switch (blend) {
- 		case GPU_ONE:
- 			return GL_ONE;
- 		case GPU_SRC_ALPHA:
- 			return GL_SRC_ALPHA;
- 		case GPU_ONE_MINUS_SRC_ALPHA:
- 			return GL_ONE_MINUS_SRC_ALPHA;
- 		default:
- 			BLI_assert(!"Unhandled blend mode");
- 			return GL_ZERO;
- 	}
- }
- 
- void GPU_blend_set_func_separate(
-         GPUBlendFunction src_rgb, GPUBlendFunction dst_rgb,
-         GPUBlendFunction src_alpha, GPUBlendFunction dst_alpha)
- {
- 	glBlendFuncSeparate(gpu_get_gl_blendfunction(src_rgb),
- 		gpu_get_gl_blendfunction(dst_rgb),
- 		gpu_get_gl_blendfunction(src_alpha),
- 		gpu_get_gl_blendfunction(dst_alpha));
- }
- 
- void GPU_blend_set_func(GPUBlendFunction sfactor, GPUBlendFunction dfactor)
- {
- 	glBlendFunc(gpu_get_gl_blendfunction(sfactor), gpu_get_gl_blendfunction(dfactor));
- }



More information about the Bf-blender-cvs mailing list