diff options
author | M.G. Kishalmi <lmg@kishalmi.net> | 2011-01-30 19:57:28 +0300 |
---|---|---|
committer | M.G. Kishalmi <lmg@kishalmi.net> | 2011-01-30 19:57:28 +0300 |
commit | 1b28e8c162d4ebcb480e89461e5d93356792970d (patch) | |
tree | f6535bcf55ecb775321a2d099a9baf0dcea99f50 /source/blender/gpu/intern/gpu_material.c | |
parent | d5da54e1e648c264cadc77fd43d80d4ef29688f2 (diff) |
moved texture_space scaling factor from glsl to C.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 2886a5450af..c57499890ee 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1056,12 +1056,14 @@ static void do_material_tex(GPUShadeInput *shi) } else if( mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) { /* ntap bumpmap image */ float hScale = 0.1f; // compatibility adjustment factor for all bumpspace types - float fScaleTex = 130.0f; // factor for scaling texspace bumps + float hScaleTex = 13.0f; // factor for scaling texspace bumps GPUNodeLink *surf_pos = GPU_builtin(GPU_VIEW_POSITION); GPUNodeLink *vR1, *vR2, *fDet; GPUNodeLink *dBs, *dBt, *vN; + if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) + hScale = hScaleTex; norfac = hScale * mtex->norfac; tnorfac = GPU_uniform(&norfac); @@ -1094,7 +1096,7 @@ static void do_material_tex(GPUShadeInput *shi) ima_x= ibuf->x; ima_y= ibuf->y; GPU_link( mat, "mtex_bump_apply_texspace", - fDet, dBs, dBt, vR1, vR2, vN, GPU_image(tex->ima, &tex->iuser), texco, GPU_uniform(&fScaleTex), + fDet, dBs, dBt, vR1, vR2, vN, GPU_image(tex->ima, &tex->iuser), texco, GPU_uniform(&ima_x), GPU_uniform(&ima_y), &shi->vn ); } else GPU_link( mat, "mtex_bump_apply", |