From e11d22a6b751c750c40226cb027e7805adb7d4e4 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 22 Jan 2013 11:18:41 +0000 Subject: Matcap support in 3D Viewport. Full log is here: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability#Matcap_in_3D_viewport Implementation notes: - Matcaps are an extension of Solid draw mode, and don't show in other drawmodes. (It's mostly intended to aid modeling/sculpt) - By design, Matcaps are a UI feature, and only stored locally for the UI itself, and won't affect rendering or materials. - Currently a set of 16 (GPL licensed) Matcaps have been compiled into Blender. It doesn't take memory or cpu time, until you use it. - Brush Icons and Matcaps use same code now, and only get generated/allocated on actually using it (instead of on startup). - The current set might get new or different images still, based on user feedback. - Matcap images are 512x512 pixels, so each image takes 1 Mb memory. Unused matcaps get freed immediately. The Matcap icon previews (128x128 pixels) stay in memory. - Loading own matcap image files will be added later. That needs design and code work to get it stable and memory-friendly. - The GLSL code uses the ID PreviewImage for matcaps. I tested it using the existing Material previews, which has its limits... especially for textured previews the normal-mapped matcap won't look good. --- source/blender/gpu/GPU_extensions.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu/GPU_extensions.h') diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 7eaa4084e61..66a7c917a55 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -38,7 +38,8 @@ extern "C" { struct Image; struct ImageUser; - +struct PreviewImage; + struct GPUTexture; typedef struct GPUTexture GPUTexture; @@ -112,6 +113,8 @@ GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256]); GPUTexture *GPU_texture_create_vsm_shadow_map(int size, char err_out[256]); GPUTexture *GPU_texture_from_blender(struct Image *ima, struct ImageUser *iuser, int isdata, double time, int mipmap); +GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap); + void GPU_texture_free(GPUTexture *tex); void GPU_texture_ref(GPUTexture *tex); -- cgit v1.2.3