diff options
author | Tom Musgrove <LetterRip@gmail.com> | 2010-08-06 22:40:05 +0400 |
---|---|---|
committer | Tom Musgrove <LetterRip@gmail.com> | 2010-08-06 22:40:05 +0400 |
commit | dc3c979ac82d69881f23ec4c259e0b22d484bf88 (patch) | |
tree | 3480351333d8119d86f00dd9cbe360acf7c3369e /source/blender/gpu/intern/gpu_material.c | |
parent | 8c40bda539c82d8304850391886c82b884fd7d99 (diff) |
after discussion with brecht reverting this commit, will pass on feedback to the patch author
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index b7fbe2c6482..f5898c8d0be 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -48,7 +48,6 @@ #include "BKE_colortools.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" -#include "BKE_image.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_scene.h" @@ -61,9 +60,6 @@ #include "GPU_extensions.h" #include "GPU_material.h" -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - #include "gpu_codegen.h" #include <string.h> @@ -897,10 +893,8 @@ static void do_material_tex(GPUShadeInput *shi) GPUNodeLink *texco_global, *texco_uv = NULL; GPUNodeLink *newnor, *orn; char *lastuvname = NULL; - float one = 1.0f, norfac, ofs[3], texsize[2]; + float one = 1.0f, norfac, ofs[3]; int tex_nr, rgbnor, talpha; - void *lock; - ImBuf *ibuf; GPU_link(mat, "set_value", GPU_uniform(&one), &stencil); @@ -966,46 +960,7 @@ static void do_material_tex(GPUShadeInput *shi) rgbnor = 0; if(tex && tex->type == TEX_IMAGE && tex->ima) { - ibuf= BKE_image_acquire_ibuf(tex->ima, NULL, &lock); - if (ibuf) { - texsize[0] = ibuf->x; - texsize[1] = ibuf->y; - } - else - { - texsize[0] = 0; - texsize[1] = 0; - } - BKE_image_release_ibuf(tex->ima, lock); - if(mtex->mapto & MAP_NORM && (tex->imaflag & TEX_NORMALMAP)==0) { - GPU_link(mat, "mtex_height_to_normal", texco, GPU_image(tex->ima, &tex->iuser), GPU_uniform(texsize), &tin, &trgb, &tnor); - - if(mtex->norfac < 0.0f) - GPU_link(mat, "mtex_negate_texnormal", tnor, &tnor); - - if(mtex->normapspace == MTEX_NSPACE_TANGENT) - GPU_link(mat, "mtex_nspace_tangent", GPU_attribute(CD_TANGENT, ""), shi->vn, tnor, &newnor); - else - newnor = tnor; - - /* norfac = MIN2(fabsf(mtex->norfac), 1.0); */ - norfac = fabsf(mtex->norfac); /* To not limit bumps to [-1, 1]. */ - if(norfac == 1.0f && !GPU_link_changed(stencil)) { - shi->vn = newnor; - } - else { - tnorfac = GPU_uniform(&norfac); - - if(GPU_link_changed(stencil)) - GPU_link(mat, "math_multiply", tnorfac, stencil, &tnorfac); - - GPU_link(mat, "mtex_blend_normal", tnorfac, shi->vn, newnor, &shi->vn); - } - - } - else { - GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser), &tin, &trgb, &tnor); - } + GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser), &tin, &trgb, &tnor); rgbnor= TEX_RGB; if(tex->imaflag & TEX_USEALPHA) |