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:
authorTon Roosendaal <ton@blender.org>2018-04-19 18:34:44 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-19 18:35:25 +0300
commit51b796ff1528c52cc8b4079fab1003671652a4d9 (patch)
tree0dfc2d2dabe5e77959264f5b6667897569290a41 /source/blender/freestyle
parent785e8a636a293941a4295e669cb5aeecfafae039 (diff)
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually do it. Here it goes; Blender Internal. Bye bye, you did great! * Point density, voxel data, ocean, environment map textures were removed, as these only worked within BI rendering. Note that the ocean modifier and the Cycles point density shader node continue to work. * Dynamic paint using material shading was removed, as this only worked with BI. If we ever wanted to support this again probably it should go through the baking API. * GPU shader export through the Python API was removed. This only worked for the old BI GLSL shaders, which no longer exists. Doing something similar for Eevee would be significantly more complicated because it uses a lot of multiplass rendering and logic outside the shader, it's probably impractical. * Collada material import / export code is mostly gone, as it only worked for BI materials. We need to add Cycles / Eevee material support at some point. * The mesh noise operator was removed since it only worked with BI material texture slots. A displacement modifier can be used instead. * The delete texture paint slot operator was removed since it only worked for BI material texture slots. Could be added back with node support. * Not all legacy viewport features are supported in the new viewport, but their code was removed. If we need to bring anything back we can look at older git revisions. * There is some legacy viewport code that I could not remove yet, and some that I probably missed. * Shader node execution code was left mostly intact, even though it is not used anywhere now. We may eventually use this to replace the texture nodes with Cycles / Eevee shader nodes. * The Cycles Bake panel now includes settings for baking multires normal and displacement maps. The underlying code needs to be merged properly, and we plan to add back support for multires AO baking and add support to Cycles baking for features like vertex color, displacement, and other missing baking features. * This commit removes DNA and the Python API for BI material, lamp, world and scene settings. This breaks a lot of addons. * There is more DNA that can be removed or renamed, where Cycles or Eevee are reusing some old BI properties but the names are not really correct anymore. * Texture slots for materials, lamps and world were removed. They remain for brushes, particles and freestyle linestyles. * 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and other renderers use this to find all panels to show, minus a few panels that they have their own replacement for.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp26
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h1
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp93
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.h3
5 files changed, 14 insertions, 113 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
index 29d14442a47..d571ca135a1 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
@@ -425,19 +425,8 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
float v1[3], v2[3], v3[3];
float n1[3], n2[3], n3[3], facenormal[3];
int clip[3];
- int wire_material = 0;
for (int a = 0; a < tottri; a++) {
const MLoopTri *lt = &mlooptri[a];
- const MPoly *mp = &mpoly[lt->poly];
- Material *mat = give_current_material(ob, mp->mat_nr + 1);
-
- if (mat && mat->mode & MA_ONLYCAST) {
- continue;
- }
- if (mat && mat->material_type == MA_TYPE_WIRE) {
- wire_material = 1;
- continue;
- }
copy_v3_v3(v1, mvert[mloop[lt->tri[0]].v].co);
copy_v3_v3(v2, mvert[mloop[lt->tri[1]].v].co);
@@ -453,11 +442,6 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
numFaces += countClippedFaces(v1, v2, v3, clip);
}
- if (wire_material) {
- if (G.debug & G_DEBUG_FREESTYLE) {
- cout << "Warning: Object " << name << " has wire materials (ignored)" << endl;
- }
- }
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
cout << "numFaces " << numFaces << endl;
@@ -514,9 +498,6 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
const MPoly *mp = &mpoly[lt->poly];
Material *mat = give_current_material(ob, mp->mat_nr + 1);
- if (mat && ((mat->mode & MA_ONLYCAST) || mat->material_type == MA_TYPE_WIRE))
- continue;
-
copy_v3_v3(v1, mvert[mloop[lt->tri[0]].v].co);
copy_v3_v3(v2, mvert[mloop[lt->tri[1]].v].co);
copy_v3_v3(v3, mvert[mloop[lt->tri[2]].v].co);
@@ -566,11 +547,8 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
if (mat) {
tmpMat.setLine(mat->line_col[0], mat->line_col[1], mat->line_col[2], mat->line_col[3]);
tmpMat.setDiffuse(mat->r, mat->g, mat->b, mat->alpha);
- tmpMat.setSpecular(mat->specr, mat->specg, mat->specb, mat->spectra);
- float s = 1.0 * (mat->har + 1) / 4 ; // in Blender: [1;511] => in OpenGL: [0;128]
- if (s > 128.f)
- s = 128.f;
- tmpMat.setShininess(s);
+ tmpMat.setSpecular(mat->specr, mat->specg, mat->specb, 1.0f);
+ tmpMat.setShininess(128.f);
tmpMat.setPriority(mat->line_priority);
}
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index f9a8c787c08..0542b7f45fd 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -49,7 +49,6 @@ extern "C" {
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "renderdatabase.h"
#include "render_types.h"
#include "BKE_customdata.h"
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 2de1050e167..06f62f5a5dc 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -89,7 +89,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
freestyle_scene = BKE_scene_add(freestyle_bmain, name);
freestyle_scene->r.cfra = old_scene->r.cfra;
freestyle_scene->r.mode = old_scene->r.mode &
- ~(R_EDGE_FRS | R_SHADOW | R_SSS | R_PANORAMA | R_ENVMAP | R_MBLUR | R_BORDER);
+ ~(R_EDGE_FRS | R_PANORAMA | R_MBLUR | R_BORDER);
freestyle_scene->r.xsch = re->rectx; // old_scene->r.xsch
freestyle_scene->r.ysch = re->recty; // old_scene->r.ysch
freestyle_scene->r.xasp = 1.0f; // old_scene->r.xasp;
@@ -97,8 +97,6 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
freestyle_scene->r.tilex = old_scene->r.tilex;
freestyle_scene->r.tiley = old_scene->r.tiley;
freestyle_scene->r.size = 100; // old_scene->r.size
- //freestyle_scene->r.maximsize = old_scene->r.maximsize; /* DEPRECATED */
- freestyle_scene->r.ocres = old_scene->r.ocres;
freestyle_scene->r.color_mgt_flag = 0; // old_scene->r.color_mgt_flag;
freestyle_scene->r.scemode = old_scene->r.scemode & ~(R_SINGLE_LAYER | R_NO_FRAME_UPDATE | R_MULTIVIEW);
freestyle_scene->r.flag = old_scene->r.flag;
@@ -112,9 +110,6 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
freestyle_scene->r.safety.ymin = old_scene->r.safety.ymin;
freestyle_scene->r.safety.xmax = old_scene->r.safety.xmax;
freestyle_scene->r.safety.ymax = old_scene->r.safety.ymax;
- freestyle_scene->r.osa = old_scene->r.osa;
- freestyle_scene->r.filtertype = old_scene->r.filtertype;
- freestyle_scene->r.gauss = old_scene->r.gauss;
freestyle_scene->r.dither_intensity = old_scene->r.dither_intensity;
STRNCPY(freestyle_scene->r.engine, old_scene->r.engine);
if (G.debug & G_DEBUG_FREESTYLE) {
@@ -167,14 +162,8 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
// Reset serial mesh ID (used for BlenderStrokeRenderer::NewMesh())
_mesh_id = 0xffffffff;
- // Check if the rendering engine uses new shading nodes
- _use_shading_nodes = BKE_scene_use_new_shading_nodes(freestyle_scene);
-
// Create a bNodeTree-to-Material hash table
- if (_use_shading_nodes)
- _nodetree_hash = BLI_ghash_ptr_new("BlenderStrokeRenderer::_nodetree_hash");
- else
- _nodetree_hash = NULL;
+ _nodetree_hash = BLI_ghash_ptr_new("BlenderStrokeRenderer::_nodetree_hash");
// Depsgraph
freestyle_depsgraph = DEG_graph_new(freestyle_scene, view_layer, DAG_EVAL_RENDER);
@@ -230,21 +219,11 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer()
while (lnk)
{
Material *ma = (Material*)lnk;
- // We want to retain the linestyle mtexs, so let's detach them first
- for (int a = 0; a < MAX_MTEX; a++) {
- if (ma->mtex[a]) {
- ma->mtex[a] = NULL;
- }
- else {
- break; // Textures are ordered, no empty slots between two textures
- }
- }
lnk = lnk->next;
BKE_libblock_free(freestyle_bmain, ma);
}
- if (_use_shading_nodes)
- BLI_ghash_free(_nodetree_hash, NULL, NULL);
+ BLI_ghash_free(_nodetree_hash, NULL, NULL);
DEG_graph_free(freestyle_depsgraph);
@@ -488,67 +467,13 @@ void BlenderStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const
void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
{
- if (_use_shading_nodes) {
- bNodeTree *nt = iStrokeRep->getNodeTree();
- Material *ma = (Material *)BLI_ghash_lookup(_nodetree_hash, nt);
- if (!ma) {
- ma = BlenderStrokeRenderer::GetStrokeShader(freestyle_bmain, nt, false);
- BLI_ghash_insert(_nodetree_hash, nt, ma);
- }
- iStrokeRep->setMaterial(ma);
- }
- else {
- bool has_mat = false;
- int a = 0;
-
- // Look for a good existing material
- for (Link *lnk = (Link *)freestyle_bmain->mat.first; lnk; lnk = lnk->next) {
- Material *ma = (Material*)lnk;
- bool texs_are_good = true;
- // as soon as textures differ it's not the right one
- for (int a = 0; a < MAX_MTEX; a++) {
- if (ma->mtex[a] != iStrokeRep->getMTex(a)) {
- texs_are_good = false;
- break;
- }
- }
-
- if (texs_are_good) {
- iStrokeRep->setMaterial(ma);
- has_mat = true;
- break; // if textures are good, no need to search anymore
- }
- }
-
- // If still no material, create one
- if (!has_mat) {
- Material *ma = BKE_material_add(freestyle_bmain, "stroke_material");
- DEG_relations_tag_update(freestyle_bmain);
- ma->mode |= MA_VERTEXCOLP;
- ma->mode |= MA_TRANSP;
- ma->mode |= MA_SHLESS;
- ma->vcol_alpha = 1;
-
- id_us_min(&ma->id);
-
- // Textures
- while (iStrokeRep->getMTex(a)) {
- ma->mtex[a] = (MTex *)iStrokeRep->getMTex(a);
-
- // We'll generate both with tips and without tips
- // coordinates, on two different UV layers.
- if (ma->mtex[a]->texflag & MTEX_TIPS) {
- BLI_strncpy(ma->mtex[a]->uvname, uvNames[1], sizeof(ma->mtex[a]->uvname));
- }
- else {
- BLI_strncpy(ma->mtex[a]->uvname, uvNames[0], sizeof(ma->mtex[a]->uvname));
- }
- a++;
- }
-
- iStrokeRep->setMaterial(ma);
- }
+ bNodeTree *nt = iStrokeRep->getNodeTree();
+ Material *ma = (Material *)BLI_ghash_lookup(_nodetree_hash, nt);
+ if (!ma) {
+ ma = BlenderStrokeRenderer::GetStrokeShader(freestyle_bmain, nt, false);
+ BLI_ghash_insert(_nodetree_hash, nt, ma);
}
+ iStrokeRep->setMaterial(ma);
const vector<Strip*>& strips = iStrokeRep->getStrips();
const bool hasTex = iStrokeRep->hasTex();
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index e2560a33443..75687edd9f6 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -58,12 +58,12 @@ extern "C" {
#include "BLI_blenlib.h"
#include "BLI_math.h"
+#include "BLI_math_color_blend.h"
#include "BLI_callbacks.h"
#include "BPY_extern.h"
#include "renderpipeline.h"
-#include "pixelblending.h"
#include "FRS_freestyle.h"
@@ -530,7 +530,7 @@ void FRS_composite_result(Render *re, ViewLayer *view_layer, Render *freestyle_r
pixSrc = src + 4 * (rectx * y + x);
if (pixSrc[3] > 0.0) {
pixDest = dest + 4 * (rectx * y + x);
- addAlphaOverFloat(pixDest, pixSrc);
+ blend_color_mix_float(pixDest, pixDest, pixSrc);
}
}
}
diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h
index db96a27e073..c004d73e6fe 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.h
+++ b/source/blender/freestyle/intern/stroke/Stroke.h
@@ -44,8 +44,7 @@
#endif
extern "C" {
-#include "DNA_material_types.h"
-
+struct MTex;
struct bNodeTree;
}