From 6ccc605660ea0b45b723016e82b3635f8d5cc707 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 15 Dec 2011 13:58:09 +0000 Subject: Bicubic bump map filtering. This commit introduces bicubic bump map capabilities for the viewport for OpenGL 3.0+ capable GPUs. To use the functionality change the bump mapping method to "best quality" Previous "best quality" setting becomes "medium quality" now. For non OpenGL 3.0 GPUs this becomes the same as "medium quality" Also: * added tooltip descriptions to the bump method settings. * modified the shader to ommit extraneous matrix multiplications for matrices already provided by OpenGL. Bicubic shader by Morten Mikkelsen. Thanks a lot! Oh...and FIRST! --- source/blender/gpu/intern/gpu_material.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/intern/gpu_material.c') diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 2d8487deb71..4b991a36626 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1086,7 +1086,7 @@ static void do_material_tex(GPUShadeInput *shi) GPU_link(mat, "mtex_blend_normal", tnorfac, shi->vn, newnor, &shi->vn); } - } else if( (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) || found_deriv_map) { + } else if( (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP)) || found_deriv_map) { /* ntap bumpmap image */ int iBumpSpace; float ima_x, ima_y; @@ -1184,10 +1184,21 @@ static void do_material_tex(GPUShadeInput *shi) GPU_link( mat, "mtex_bump_tap3", texco, GPU_image(tex->ima, &tex->iuser), tnorfac, &dBs, &dBt ); - else - GPU_link( mat, "mtex_bump_tap5", + else if( mtex->texflag & MTEX_5TAP_BUMP ) + GPU_link( mat, "mtex_bump_tap5", texco, GPU_image(tex->ima, &tex->iuser), tnorfac, &dBs, &dBt ); + else if( mtex->texflag & MTEX_BICUBIC_BUMP ){ + if(GPU_bicubic_bump_support()){ + GPU_link( mat, "mtex_bump_bicubic", + texco, GPU_image(tex->ima, &tex->iuser), tnorfac, + &dBs, &dBt ); + }else{ + GPU_link( mat, "mtex_bump_tap5", + texco, GPU_image(tex->ima, &tex->iuser), tnorfac, + &dBs, &dBt ); + } + } if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) { -- cgit v1.2.3