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:
authorClément Foucault <foucault.clem@gmail.com>2017-02-07 13:20:15 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-02-07 13:31:22 +0300
commit83adc544382689217e19564fd5f2dd62160956cb (patch)
tree1026a590c1079b4907a6cab43e2c5759339c4350 /source/blender/blenloader/intern/writefile.c
parentaeb8e81f2741aabc95d14bce7a83cef45481959c (diff)
Clay-Engine (merge clay-engine)
Initial work by Clément Foucault with contributions from Dalai Felinto (mainly per-collection engine settings logic, and depsgraph iterator placeholder). This makes Blender require OpenGL 3.3. Which means Intel graphic card and OSX will break. Disable CLAY_ENGINE in CMake in those cases. This is a prototype render engine intended to help the design of real render engines. This is mainly an engine with enphasis in matcap and ambient occlusion. Implemented Features -------------------- * Clay Render Engine, following the new API, to be used as reference for future engines * A more complete Matcap customization with more options * Per-Collection render engine settings * New Ground Truth AO - not enabled Missing Features ---------------- * Finish object edit mode - Fix shaders to use new matrix - Fix artifacts when edge does off screen - Fix depth issue - Selection sillhouette - Mesh wires - Use mesh normals (for higher quality matcap) - Non-Mesh objects drawing - Widget drawing - Performance issues * Finish mesh edit mode - Derived-Mesh-less edit mode API (mesh_rende.c) * General edit mode - Per-collection edit mode settings * General engines - Per-collection engine settings (they are their, but they still need to be flushed by depsgraph, and used by the drawing code)
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 4ddf83d306b..0ad879b9aa6 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1894,6 +1894,8 @@ static void write_objects(WriteData *wd, ListBase *idbase)
writelist(wd, DATA, LinkData, &ob->pc_ids);
writelist(wd, DATA, LodLevel, &ob->lodlevels);
+
+ ob->collection_settings = NULL;
}
write_previews(wd, ob->preview);
@@ -2469,6 +2471,21 @@ static void write_textures(WriteData *wd, ListBase *idbase)
mywrite_flush(wd);
}
+static void write_material_engines_settings(WriteData *wd, ListBase *lb)
+{
+ for (MaterialEngineSettings *res = lb->first; res; res = res->next) {
+ writestruct(wd, DATA, MaterialEngineSettings, 1, res);
+
+ if (STREQ(res->name, RE_engine_id_BLENDER_CLAY)) {
+ writestruct(wd, DATA, MaterialEngineSettingsClay, 1, res->data);
+ }
+ else {
+ /* No engine matched */
+ /* error: don't know how to write this file */
+ }
+ }
+}
+
static void write_materials(WriteData *wd, ListBase *idbase)
{
Material *ma;
@@ -2505,6 +2522,8 @@ static void write_materials(WriteData *wd, ListBase *idbase)
}
write_previews(wd, ma->preview);
+
+ write_material_engines_settings(wd, &ma->engines_settings);
}
ma = ma->id.next;
}
@@ -2639,6 +2658,26 @@ static void write_scene_collection(WriteData *wd, SceneCollection *sc)
}
}
+static void write_collection_engine_settings(WriteData *wd, ListBase *lb)
+{
+ for (CollectionEngineSettings *ces = lb->first; ces; ces = ces->next) {
+ writestruct(wd, DATA, CollectionEngineSettings, 1, ces);
+
+ for (CollectionEngineProperty *prop = ces->properties.first; prop; prop = prop->next) {
+ switch (prop->type) {
+ case COLLECTION_PROP_TYPE_FLOAT:
+ writestruct(wd, DATA, CollectionEnginePropertyFloat, 1, prop);
+ break;
+ case COLLECTION_PROP_TYPE_INT:
+ writestruct(wd, DATA, CollectionEnginePropertyInt, 1, prop);
+ break;
+ default:
+ ; /* error: don't know how to write this file */
+ }
+ }
+ }
+}
+
static void write_layer_collections(WriteData *wd, ListBase *lb)
{
for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
@@ -2647,10 +2686,27 @@ static void write_layer_collections(WriteData *wd, ListBase *lb)
writelist(wd, DATA, LinkData, &lc->object_bases);
writelist(wd, DATA, CollectionOverride, &lc->overrides);
+ write_collection_engine_settings(wd, &lc->engine_settings);
+
write_layer_collections(wd, &lc->layer_collections);
}
}
+static void write_render_engines_settings(WriteData *wd, ListBase *lb)
+{
+ for (RenderEngineSettings *res = lb->first; res; res = res->next) {
+ writestruct(wd, DATA, RenderEngineSettings, 1, res);
+
+ if (STREQ(res->name, RE_engine_id_BLENDER_CLAY)) {
+ writestruct(wd, DATA, RenderEngineSettingsClay, 1, res->data);
+ }
+ else {
+ /* No engine matched */
+ /* error: don't know how to write this file */
+ }
+ }
+}
+
static void write_scenes(WriteData *wd, ListBase *scebase)
{
Scene *sce;
@@ -2880,6 +2936,8 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
write_layer_collections(wd, &sl->layer_collections);
}
+ write_render_engines_settings(wd, &sce->engines_settings);
+
sce = sce->id.next;
}