diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-04-25 17:46:14 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-04-25 17:46:14 +0400 |
commit | 228132ca55d0eec052b6bd384663e39e3bfd40df (patch) | |
tree | c1df97ca378992e45ae9ec48a9489deab9919b71 /source/blender/src/drawobject.c | |
parent | 7a23da05d3a148ded2d6a6964e1f5671c9e96b7a (diff) |
Apricot Branch
==============
GLSL materials:
- Added the beginning of texture stack evaluation, only a few options
are supported.
- Added a few lines of code to display non-node materials, with solid
mode lighting to at least see something.
Diffstat (limited to 'source/blender/src/drawobject.c')
-rw-r--r-- | source/blender/src/drawobject.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 73c6f8baff8..dc8e4b20966 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -186,9 +186,13 @@ int set_gl_material_attribs(int nr, GPUVertexAttribs *attribs) if(attribs) { Material *mat = gpumatbuf[nr]; - if(mat && mat->nodetree && mat->use_nodes) { - if(!mat->gpumaterial) - mat->gpumaterial= ntreeShaderCreateGPU(mat->nodetree); + if(mat) { + if(!mat->gpumaterial) { + if(mat->nodetree && mat->use_nodes) + mat->gpumaterial= ntreeShaderCreateGPU(mat->nodetree); + else + mat->gpumaterial= GPU_material_from_blender(mat); + } if(mat->gpumaterial) { GPU_material_vertex_attributes(mat->gpumaterial, attribs); @@ -286,10 +290,7 @@ int init_gl_materials(Object *ob, int check_alpha, int gpu) matbuf[a][1][3]= 1.0; } - if(gpu && ma->nodetree && ma->use_nodes) - gpumatbuf[a]= ma; - else - gpumatbuf[a]= NULL; + gpumatbuf[a]= (gpu)? ma: NULL; } } |