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:
authorAntony Riakiotakis <kalast@gmail.com>2011-12-15 17:58:09 +0400
committerAntony Riakiotakis <kalast@gmail.com>2011-12-15 17:58:09 +0400
commit6ccc605660ea0b45b723016e82b3635f8d5cc707 (patch)
tree7def5ad95056f9c36a778d6de25565b420dfe048 /source/blender/gpu/intern/gpu_material.c
parent030694b26041d793ca53aa4282e3e4e2d98f559f (diff)
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!
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c17
1 files changed, 14 insertions, 3 deletions
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 ) {