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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-08 17:07:16 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-08 17:07:16 +0400
commit28ee0f92184af8ba6f44d08eda23ce5eb3815697 (patch)
tree6aada8d509c7470bd3bff6e52ba32e1fd54ef2ee /source/blender/gpu/intern/gpu_material.c
parent19df3147f6920a2856bccb6e4601d57288119999 (diff)
Texturing: texture and 3d view draw type changes, these should only have any
effect for a render engine using new shading nodes. In short: * No longer uses images assigned to faces in the uv layer, rather the active image texture node is what is edited/painted/drawn. * Textured draw type now shows the active image texture node, with solid lighting. * Material draw mode shows GLSL shader of a simplified material node tree, using solid lighting. * Textures for modifiers, brushes, etc, are now available from a dropdown in the texture tab in the properties editor. These do not use new shading nodes yet. http://wiki.blender.org/index.php/Dev:2.6/Source/Render/TextureWorkflow
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 9344b4e680a..02ba2eba9e9 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1415,29 +1415,33 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
if(((GPUMaterial*)link->data)->scene == scene)
return link->data;
+ /* allocate material */
mat = GPU_material_construct_begin(ma);
mat->scene = scene;
if(!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
+ /* create nodes */
ntreeGPUMaterialNodes(ma->nodetree, mat);
}
else {
+ /* create material */
outlink = GPU_blender_material(mat, ma);
GPU_material_output_link(mat, outlink);
}
- if(gpu_do_color_management(mat))
- if(mat->outlink)
- GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
+ if(!scene_use_new_shading_nodes(scene)) {
+ if(gpu_do_color_management(mat))
+ if(mat->outlink)
+ GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
+ }
- /*if(!GPU_material_construct_end(mat)) {
- GPU_material_free(mat);
- mat= NULL;
- return 0;
- }*/
GPU_material_construct_end(mat);
+ /* note that even if building the shader fails in some way, we still keep
+ it to avoid trying to compile again and again, and simple do not use
+ the actual shader on drawing */
+
link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink");
link->data = mat;
BLI_addtail(&ma->gpumaterial, link);