diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-11-24 19:18:56 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-11-26 17:07:26 +0300 |
commit | 8fa55d95e43392a0e7925e1327e86220a33b4394 (patch) | |
tree | b68b040a975e6231c8ec40d89cebad93582c52af /source/blender/blenkernel/intern | |
parent | 8bc84e10f501e516e0839b6a3efa573d55fb4f7b (diff) |
World background working on cycle nodes.
This is added in the spirit of the general cycles GLSL system
which is pretty much WIP still.
This will only work on cycles at the moment but generating for blender
internal is possible too of course though it will be done in a separate
commit.
This hasn't been tested with all and every node in cycles, but
environment and regular textures with texture coordinates work.
There is some difference between the way cycles treats some coordinates,
which is in world space and the way GLSL treats them, which is in view
space.
We might want to explore and improve this further in the future.
...also </drumroll>
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/world.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index ea1b9a3f13d..af2080c1b61 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -116,7 +116,7 @@ void BKE_material_free_ex(Material *ma, bool do_id_user) MEM_freeN(ma->texpaintslot); if (ma->gpumaterial.first) - GPU_material_free(ma); + GPU_material_free(&ma->gpumaterial); } void init_material(Material *ma) @@ -1724,7 +1724,7 @@ void paste_matcopybuf(Material *ma) MEM_freeN(ma->nodetree); } - GPU_material_free(ma); + GPU_material_free(&ma->gpumaterial); id = (ma->id); memcpy(ma, &matcopybuf, sizeof(Material)); diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 8e3c92314e6..29a345e111b 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -49,6 +49,8 @@ #include "BKE_node.h" #include "BKE_world.h" +#include "GPU_material.h" + void BKE_world_free_ex(World *wrld, bool do_id_user) { MTex *mtex; @@ -69,6 +71,9 @@ void BKE_world_free_ex(World *wrld, bool do_id_user) MEM_freeN(wrld->nodetree); } + if (wrld->gpumaterial.first) + GPU_material_free(&wrld->gpumaterial); + BKE_icon_delete((struct ID *)wrld); wrld->id.icon_id = 0; } |