diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-26 04:49:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-26 04:49:42 +0400 |
commit | 4643d61ffbbd99cf7c194fb73b77e7f2a256249f (patch) | |
tree | 04f88f46833d7c06d7ab51b43ca58a77bf5f43ce /source/blender/gpu/intern/gpu_codegen.c | |
parent | a9facca8999bbf3278ebb10d36099e581c0b528b (diff) |
OpenGL: implemenation of fixed function lighting as per pixel GLSL shaders. The
code is still unused, but the intention is to use this to solve the double sided
lighting problem on NVidia, and to make the materials work on OpenGL ES 2.0
eventually.
The code works and matches the fixed function lighting pretty much exactly, but
still needs optimizations. The actual integration in object draw will be
committed later when more fixing & testing, there's lots of different combinations
and unclear OpenGL state here.
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index b27a4be9f21..59953659a2c 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -237,8 +237,6 @@ GPUFunction *GPU_lookup_function(const char *name) if (!FUNCTION_HASH) { FUNCTION_HASH = BLI_ghash_str_new("GPU_lookup_function gh"); gpu_parse_functions_string(FUNCTION_HASH, glsl_material_library); - /*FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH); - FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);*/ } return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, (void *)name); @@ -758,7 +756,7 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes) } } - GPU_shader_unbind(shader); + GPU_shader_unbind(); } void GPU_pass_bind(GPUPass *pass, double time, int mipmap) @@ -820,7 +818,7 @@ void GPU_pass_unbind(GPUPass *pass) input->tex = NULL; } - GPU_shader_unbind(shader); + GPU_shader_unbind(); } /* Node Link Functions */ @@ -1368,7 +1366,7 @@ GPUPass *GPU_generate_pass(ListBase *nodes, GPUNodeLink *outlink, GPUVertexAttri /* generate code and compile with opengl */ fragmentcode = code_generate_fragment(nodes, outlink->output, name); vertexcode = code_generate_vertex(nodes); - shader = GPU_shader_create(vertexcode, fragmentcode, glsl_material_library); /*FUNCTION_LIB);*/ + shader = GPU_shader_create(vertexcode, fragmentcode, glsl_material_library, NULL); /* failed? */ if (!shader) { |