2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-19 12:14:58 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-19 12:14:58 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup spview3d
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-19 22:17:30 +00:00
|
|
|
#include "DNA_mesh_types.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2012-04-30 08:24:44 +00:00
|
|
|
#include "DNA_object_types.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2018-10-16 13:18:03 +11:00
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
#include "BKE_DerivedMesh.h"
|
|
|
|
#include "BKE_global.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2013-04-13 20:31:52 +00:00
|
|
|
#include "BKE_editmesh.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2017-07-21 11:53:13 +02:00
|
|
|
#include "DEG_depsgraph.h"
|
2018-04-06 12:07:27 +02:00
|
|
|
#include "DEG_depsgraph_query.h"
|
2017-07-21 11:53:13 +02:00
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
#include "GPU_draw.h"
|
2015-12-06 21:20:19 +01:00
|
|
|
#include "GPU_shader.h"
|
2016-09-29 14:47:38 -04:00
|
|
|
#include "GPU_immediate.h"
|
2016-10-25 05:31:25 -04:00
|
|
|
#include "GPU_batch.h"
|
2016-10-18 20:57:36 -04:00
|
|
|
#include "GPU_matrix.h"
|
2018-06-27 19:07:23 -06:00
|
|
|
#include "GPU_state.h"
|
|
|
|
#include "GPU_framebuffer.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
#include "ED_mesh.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
|
|
|
|
#include "UI_resources.h"
|
|
|
|
|
2019-03-15 16:02:55 -03:00
|
|
|
#include "DRW_engine.h"
|
|
|
|
|
2012-10-10 03:13:02 +00:00
|
|
|
#include "view3d_intern.h" /* bad level include */
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2017-04-21 21:14:11 +10:00
|
|
|
#include "../../draw/intern/draw_cache_impl.h" /* bad level include (temporary) */
|
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
int view3d_effective_drawtype(const struct View3D *v3d)
|
|
|
|
{
|
2018-07-11 14:20:39 +02:00
|
|
|
if (v3d->shading.type == OB_RENDER) {
|
|
|
|
return v3d->shading.prev_type;
|
2008-12-19 12:14:58 +00:00
|
|
|
}
|
2018-07-11 14:20:39 +02:00
|
|
|
return v3d->shading.type;
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
}
|
2008-12-19 12:14:58 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
static bool check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
|
|
|
|
{
|
2019-03-26 21:16:47 +11:00
|
|
|
if ((sce->toolsettings->selectmode & SCE_SELECT_FACE) == 0) {
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
return false;
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2011-12-15 20:38:23 +00:00
|
|
|
|
2019-03-26 21:16:47 +11:00
|
|
|
if (G.f & G_FLAG_BACKBUFSEL) {
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
return false;
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2011-12-15 20:38:23 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
/* if its drawing textures with zbuf sel, then don't draw dots */
|
2019-03-26 21:16:47 +11:00
|
|
|
if (dt == OB_TEXTURE && vd->shading.type == OB_TEXTURE) {
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
return false;
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2011-12-15 20:38:23 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
return true;
|
|
|
|
}
|
2013-08-03 22:03:15 +00:00
|
|
|
|
2019-01-15 23:24:20 +11:00
|
|
|
/* OpenGL Circle Drawing - Tables for Optimized Drawing Speed */
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
/* 32 values of sin function (still same result!) */
|
|
|
|
#define CIRCLE_RESOL 32
|
2013-08-03 22:03:15 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
static const float sinval[CIRCLE_RESOL] = {
|
|
|
|
0.00000000,
|
|
|
|
0.20129852,
|
|
|
|
0.39435585,
|
|
|
|
0.57126821,
|
|
|
|
0.72479278,
|
|
|
|
0.84864425,
|
|
|
|
0.93775213,
|
|
|
|
0.98846832,
|
|
|
|
0.99871650,
|
|
|
|
0.96807711,
|
|
|
|
0.89780453,
|
|
|
|
0.79077573,
|
|
|
|
0.65137248,
|
|
|
|
0.48530196,
|
|
|
|
0.29936312,
|
|
|
|
0.10116832,
|
|
|
|
-0.10116832,
|
|
|
|
-0.29936312,
|
|
|
|
-0.48530196,
|
|
|
|
-0.65137248,
|
|
|
|
-0.79077573,
|
|
|
|
-0.89780453,
|
|
|
|
-0.96807711,
|
|
|
|
-0.99871650,
|
|
|
|
-0.98846832,
|
|
|
|
-0.93775213,
|
|
|
|
-0.84864425,
|
|
|
|
-0.72479278,
|
|
|
|
-0.57126821,
|
|
|
|
-0.39435585,
|
|
|
|
-0.20129852,
|
2019-02-03 14:01:45 +11:00
|
|
|
0.00000000,
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
};
|
2013-08-03 22:03:15 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
/* 32 values of cos function (still same result!) */
|
|
|
|
static const float cosval[CIRCLE_RESOL] = {
|
|
|
|
1.00000000,
|
|
|
|
0.97952994,
|
|
|
|
0.91895781,
|
|
|
|
0.82076344,
|
|
|
|
0.68896691,
|
|
|
|
0.52896401,
|
|
|
|
0.34730525,
|
|
|
|
0.15142777,
|
|
|
|
-0.05064916,
|
|
|
|
-0.25065253,
|
|
|
|
-0.44039415,
|
|
|
|
-0.61210598,
|
|
|
|
-0.75875812,
|
|
|
|
-0.87434661,
|
|
|
|
-0.95413925,
|
|
|
|
-0.99486932,
|
|
|
|
-0.99486932,
|
|
|
|
-0.95413925,
|
|
|
|
-0.87434661,
|
|
|
|
-0.75875812,
|
|
|
|
-0.61210598,
|
|
|
|
-0.44039415,
|
|
|
|
-0.25065253,
|
|
|
|
-0.05064916,
|
|
|
|
0.15142777,
|
|
|
|
0.34730525,
|
|
|
|
0.52896401,
|
|
|
|
0.68896691,
|
|
|
|
0.82076344,
|
|
|
|
0.91895781,
|
|
|
|
0.97952994,
|
2019-02-03 14:01:45 +11:00
|
|
|
1.00000000,
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
};
|
2013-08-03 22:03:15 +00:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
static void circball_array_fill(float verts[CIRCLE_RESOL][3], const float cent[3], float rad, const float tmat[4][4])
|
|
|
|
{
|
|
|
|
float vx[3], vy[3];
|
|
|
|
float *viter = (float *)verts;
|
2017-03-06 16:21:59 +01:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
mul_v3_v3fl(vx, tmat[0], rad);
|
|
|
|
mul_v3_v3fl(vy, tmat[1], rad);
|
2017-03-06 16:21:59 +01:00
|
|
|
|
2019-03-01 23:43:34 +11:00
|
|
|
for (uint a = 0; a < CIRCLE_RESOL; a++, viter += 3) {
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
|
|
|
|
viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
|
|
|
|
viter[2] = cent[2] + sinval[a] * vx[2] + cosval[a] * vy[2];
|
2008-12-19 12:14:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], unsigned pos)
|
2017-03-10 03:15:58 +11:00
|
|
|
{
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
float verts[CIRCLE_RESOL][3];
|
2017-03-10 03:15:58 +11:00
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
circball_array_fill(verts, cent, rad, tmat);
|
2017-03-10 03:15:58 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
immBegin(GPU_PRIM_LINE_LOOP, CIRCLE_RESOL);
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
for (int i = 0; i < CIRCLE_RESOL; ++i) {
|
|
|
|
immVertex3fv(pos, verts[i]);
|
2017-03-10 03:15:58 +11:00
|
|
|
}
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
immEnd();
|
2017-03-10 03:15:58 +11:00
|
|
|
}
|
|
|
|
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
#ifdef VIEW3D_CAMERA_BORDER_HACK
|
2019-03-01 23:43:34 +11:00
|
|
|
uchar view3d_camera_border_hack_col[3];
|
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.
2018-04-19 17:34:44 +02:00
|
|
|
bool view3d_camera_border_hack_test = false;
|
|
|
|
#endif
|
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
/* ***************** BACKBUF SEL (BBS) ********* */
|
2011-09-18 17:10:28 +00:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
/** See #DRW_shgroup_world_clip_planes_from_rv3d, same function for draw manager. */
|
|
|
|
static void bbs_world_clip_planes_from_rv3d(GPUBatch *batch, const float world_clip_planes[6][4])
|
|
|
|
{
|
|
|
|
GPU_batch_uniform_4fv_array(batch, "WorldClipPlanes", 6, world_clip_planes[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void bbs_mesh_verts(GPUBatch *batch, int offset, const float world_clip_planes[6][4])
|
2017-08-17 01:38:07 +10:00
|
|
|
{
|
2018-06-27 19:07:23 -06:00
|
|
|
GPU_point_size(UI_GetThemeValuef(TH_VERTEX_SIZE));
|
2017-12-04 12:32:45 -02:00
|
|
|
|
2019-02-10 11:02:06 +11:00
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_FLAT_SELECT_ID, sh_cfg);
|
2018-12-22 23:57:12 +01:00
|
|
|
GPU_batch_uniform_1ui(batch, "offset", offset);
|
2019-02-06 10:33:14 +11:00
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
GPU_batch_draw(batch);
|
2017-08-17 01:38:07 +10:00
|
|
|
}
|
2017-05-05 10:36:09 +10:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
static void bbs_mesh_wire(GPUBatch *batch, int offset, const float world_clip_planes[6][4])
|
2017-08-17 01:38:07 +10:00
|
|
|
{
|
2018-06-27 19:07:23 -06:00
|
|
|
GPU_line_width(1.0f);
|
2018-12-22 23:57:12 +01:00
|
|
|
glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
|
2017-12-04 15:30:56 -02:00
|
|
|
|
2019-02-10 11:02:06 +11:00
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_FLAT_SELECT_ID, sh_cfg);
|
2018-12-22 23:57:12 +01:00
|
|
|
GPU_batch_uniform_1ui(batch, "offset", offset);
|
2019-02-06 10:33:14 +11:00
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
GPU_batch_draw(batch);
|
2018-12-22 23:57:12 +01:00
|
|
|
|
|
|
|
glProvokingVertex(GL_LAST_VERTEX_CONVENTION);
|
2017-08-17 01:38:07 +10:00
|
|
|
}
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2018-12-22 23:57:12 +01:00
|
|
|
/* two options, facecolors or black */
|
2019-02-06 10:33:14 +11:00
|
|
|
static void bbs_mesh_face(GPUBatch *batch, const bool use_select, const float world_clip_planes[6][4])
|
2017-08-17 01:38:07 +10:00
|
|
|
{
|
|
|
|
if (use_select) {
|
2019-02-10 11:02:06 +11:00
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_FLAT_SELECT_ID, sh_cfg);
|
2018-12-22 23:57:12 +01:00
|
|
|
GPU_batch_uniform_1ui(batch, "offset", 1);
|
2019-02-06 10:33:14 +11:00
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
GPU_batch_draw(batch);
|
2017-08-17 01:38:07 +10:00
|
|
|
}
|
|
|
|
else {
|
2019-02-10 11:02:06 +11:00
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_UNIFORM_SELECT_ID, sh_cfg);
|
2018-12-22 23:57:12 +01:00
|
|
|
GPU_batch_uniform_1ui(batch, "id", 0);
|
2019-02-06 10:33:14 +11:00
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
GPU_batch_draw(batch);
|
2017-08-17 01:38:07 +10:00
|
|
|
}
|
|
|
|
}
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
static void bbs_mesh_face_dot(GPUBatch *batch, const float world_clip_planes[6][4])
|
2017-08-17 01:38:07 +10:00
|
|
|
{
|
2019-02-10 11:02:06 +11:00
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_FLAT_SELECT_ID, sh_cfg);
|
2018-12-22 23:57:12 +01:00
|
|
|
GPU_batch_uniform_1ui(batch, "offset", 1);
|
2019-02-06 10:33:14 +11:00
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
GPU_batch_draw(batch);
|
2017-08-17 01:38:07 +10:00
|
|
|
}
|
2017-05-05 10:36:09 +10:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
static void bbs_mesh_solid_verts(
|
|
|
|
Depsgraph *UNUSED(depsgraph), Scene *UNUSED(scene), Object *ob, const float world_clip_planes[6][4])
|
2017-08-17 07:13:02 +10:00
|
|
|
{
|
|
|
|
Mesh *me = ob->data;
|
|
|
|
|
2018-12-22 23:57:12 +01:00
|
|
|
GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
|
|
|
GPUBatch *geom_verts = DRW_mesh_batch_cache_get_verts_with_select_id(me);
|
|
|
|
DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true);
|
2017-08-17 07:13:02 +10:00
|
|
|
|
2018-12-22 23:57:12 +01:00
|
|
|
/* Only draw faces to mask out verts, we don't want their selection ID's. */
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_face(geom_faces, false, world_clip_planes);
|
|
|
|
bbs_mesh_verts(geom_verts, 1, world_clip_planes);
|
2017-08-17 07:13:02 +10:00
|
|
|
|
|
|
|
bm_vertoffs = me->totvert + 1;
|
|
|
|
}
|
2012-12-23 08:20:44 +00:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
static void bbs_mesh_solid_faces(Scene *UNUSED(scene), Object *ob, const float world_clip_planes[6][4])
|
2008-12-19 12:14:58 +00:00
|
|
|
{
|
2015-03-30 00:51:00 -04:00
|
|
|
Mesh *me = ob->data;
|
2018-12-01 14:38:11 +03:00
|
|
|
Mesh *me_orig = DEG_get_original_object(ob)->data;
|
2018-12-22 23:57:12 +01:00
|
|
|
|
|
|
|
const bool use_hide = (me_orig->editflag & ME_EDIT_PAINT_FACE_SEL);
|
|
|
|
GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
|
|
|
DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, use_hide);
|
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_face(geom_faces, true, world_clip_planes);
|
2008-12-19 12:14:58 +00:00
|
|
|
}
|
|
|
|
|
2019-03-15 16:02:55 -03:00
|
|
|
void draw_object_select_id(
|
2018-05-24 20:35:51 +02:00
|
|
|
Depsgraph *depsgraph, Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob,
|
|
|
|
short select_mode)
|
2008-12-19 12:14:58 +00:00
|
|
|
{
|
2012-03-25 23:54:33 +00:00
|
|
|
ToolSettings *ts = scene->toolsettings;
|
2018-05-24 20:35:51 +02:00
|
|
|
if (select_mode == -1) {
|
|
|
|
select_mode = ts->selectmode;
|
|
|
|
}
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2018-07-15 15:27:15 +02:00
|
|
|
GPU_matrix_mul(ob->obmat);
|
2018-06-27 19:07:23 -06:00
|
|
|
GPU_depth_test(true);
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
const float (*world_clip_planes)[4] = NULL;
|
|
|
|
if (rv3d->rflag & RV3D_CLIPPING) {
|
2019-02-08 21:50:07 +11:00
|
|
|
ED_view3d_clipping_local(rv3d, ob->obmat);
|
|
|
|
world_clip_planes = rv3d->clip_local;
|
2019-02-06 10:33:14 +11:00
|
|
|
}
|
|
|
|
|
2012-03-25 23:54:33 +00:00
|
|
|
switch (ob->type) {
|
2012-03-18 06:01:33 +00:00
|
|
|
case OB_MESH:
|
2018-04-05 18:20:27 +02:00
|
|
|
if (ob->mode & OB_MODE_EDIT) {
|
2012-03-25 23:54:33 +00:00
|
|
|
Mesh *me = ob->data;
|
2019-02-17 18:05:18 +11:00
|
|
|
BMEditMesh *em = me->edit_mesh;
|
2018-12-22 23:57:12 +01:00
|
|
|
const bool draw_facedot = check_ob_drawface_dot(scene, v3d, ob->dt);
|
|
|
|
const bool use_faceselect = (select_mode & SCE_SELECT_FACE) != 0;
|
2009-02-19 23:53:40 +00:00
|
|
|
|
2013-10-28 02:05:33 +00:00
|
|
|
BM_mesh_elem_table_ensure(em->bm, BM_VERT | BM_EDGE | BM_FACE);
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2018-12-22 23:57:12 +01:00
|
|
|
GPUBatch *geom_faces, *geom_edges, *geom_verts, *geom_facedots;
|
|
|
|
geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
|
|
|
if (select_mode & SCE_SELECT_EDGE) {
|
|
|
|
geom_edges = DRW_mesh_batch_cache_get_edges_with_select_id(me);
|
|
|
|
}
|
|
|
|
if (select_mode & SCE_SELECT_VERTEX) {
|
|
|
|
geom_verts = DRW_mesh_batch_cache_get_verts_with_select_id(me);
|
|
|
|
}
|
|
|
|
if (draw_facedot) {
|
|
|
|
geom_facedots = DRW_mesh_batch_cache_get_facedots_with_select_id(me);
|
|
|
|
}
|
|
|
|
DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true);
|
|
|
|
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_face(geom_faces, use_faceselect, world_clip_planes);
|
2018-12-22 23:57:12 +01:00
|
|
|
|
|
|
|
if (use_faceselect && draw_facedot) {
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_face_dot(geom_facedots, world_clip_planes);
|
2018-12-22 23:57:12 +01:00
|
|
|
}
|
|
|
|
|
2019-03-26 21:16:47 +11:00
|
|
|
if (select_mode & SCE_SELECT_FACE) {
|
2012-03-25 23:54:33 +00:00
|
|
|
bm_solidoffs = 1 + em->bm->totface;
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2017-12-08 12:42:00 -02:00
|
|
|
else {
|
2012-03-25 23:54:33 +00:00
|
|
|
bm_solidoffs = 1;
|
2017-12-08 12:42:00 -02:00
|
|
|
}
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2013-12-09 20:59:29 +11:00
|
|
|
ED_view3d_polygon_offset(rv3d, 1.0);
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2017-12-04 12:05:06 -02:00
|
|
|
/* we draw edges if edge select mode */
|
2018-05-24 20:35:51 +02:00
|
|
|
if (select_mode & SCE_SELECT_EDGE) {
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_wire(geom_edges, bm_solidoffs, world_clip_planes);
|
2017-12-04 12:05:06 -02:00
|
|
|
bm_wireoffs = bm_solidoffs + em->bm->totedge;
|
|
|
|
}
|
2017-12-08 12:42:00 -02:00
|
|
|
else {
|
|
|
|
/* `bm_vertoffs` is calculated from `bm_wireoffs`. (otherwise see T53512) */
|
|
|
|
bm_wireoffs = bm_solidoffs;
|
|
|
|
}
|
2011-08-09 16:32:15 +00:00
|
|
|
|
2018-12-23 00:11:42 +01:00
|
|
|
ED_view3d_polygon_offset(rv3d, 1.1);
|
|
|
|
|
2017-05-05 07:06:15 +10:00
|
|
|
/* we draw verts if vert select mode. */
|
2018-05-24 20:35:51 +02:00
|
|
|
if (select_mode & SCE_SELECT_VERTEX) {
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_verts(geom_verts, bm_wireoffs, world_clip_planes);
|
2012-03-25 23:54:33 +00:00
|
|
|
bm_vertoffs = bm_wireoffs + em->bm->totvert;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
bm_vertoffs = bm_wireoffs;
|
2012-03-18 06:01:33 +00:00
|
|
|
}
|
|
|
|
|
2013-12-09 20:59:29 +11:00
|
|
|
ED_view3d_polygon_offset(rv3d, 0.0);
|
2011-08-09 16:32:15 +00:00
|
|
|
}
|
2011-09-13 06:39:17 +00:00
|
|
|
else {
|
2018-12-22 23:57:12 +01:00
|
|
|
Mesh *me = DEG_get_original_object(ob)->data;
|
2012-12-22 14:25:34 +00:00
|
|
|
if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) &&
|
2017-09-29 17:10:15 +10:00
|
|
|
/* currently vertex select supports weight paint and vertex paint*/
|
2018-04-05 18:20:27 +02:00
|
|
|
((ob->mode & OB_MODE_WEIGHT_PAINT) || (ob->mode & OB_MODE_VERTEX_PAINT)))
|
2012-03-18 06:01:33 +00:00
|
|
|
{
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_solid_verts(depsgraph, scene, ob, world_clip_planes);
|
2012-03-18 06:01:33 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-02-06 10:33:14 +11:00
|
|
|
bbs_mesh_solid_faces(scene, ob, world_clip_planes);
|
2012-03-18 06:01:33 +00:00
|
|
|
}
|
2011-09-13 06:39:17 +00:00
|
|
|
}
|
2012-03-18 06:01:33 +00:00
|
|
|
break;
|
|
|
|
case OB_CURVE:
|
|
|
|
case OB_SURF:
|
|
|
|
break;
|
2008-12-19 12:14:58 +00:00
|
|
|
}
|
|
|
|
|
2018-07-15 15:27:15 +02:00
|
|
|
GPU_matrix_set(rv3d->viewmat);
|
2008-12-19 12:14:58 +00:00
|
|
|
}
|
|
|
|
|
2019-03-15 16:02:55 -03:00
|
|
|
void draw_object_depth(RegionView3D *rv3d, Object *ob)
|
|
|
|
{
|
|
|
|
GPU_matrix_mul(ob->obmat);
|
|
|
|
GPU_depth_test(true);
|
|
|
|
|
|
|
|
const float (*world_clip_planes)[4] = NULL;
|
|
|
|
if (rv3d->rflag & RV3D_CLIPPING) {
|
|
|
|
ED_view3d_clipping_local(rv3d, ob->obmat);
|
|
|
|
world_clip_planes = rv3d->clip_local;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (ob->type) {
|
|
|
|
case OB_MESH:
|
|
|
|
{
|
|
|
|
GPUBatch *batch;
|
|
|
|
|
|
|
|
Mesh *me = ob->data;
|
|
|
|
|
|
|
|
if (ob->mode & OB_MODE_EDIT) {
|
|
|
|
batch = DRW_mesh_batch_cache_get_edit_triangles(me);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
batch = DRW_mesh_batch_cache_get_surface(me);
|
|
|
|
}
|
|
|
|
|
|
|
|
DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true);
|
|
|
|
|
|
|
|
DRW_opengl_context_enable();
|
|
|
|
const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : GPU_SHADER_CFG_DEFAULT;
|
|
|
|
GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_DEPTH_ONLY, sh_cfg);
|
|
|
|
if (world_clip_planes != NULL) {
|
|
|
|
bbs_world_clip_planes_from_rv3d(batch, world_clip_planes);
|
|
|
|
}
|
|
|
|
|
|
|
|
GPU_batch_draw(batch);
|
|
|
|
DRW_opengl_context_disable();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OB_CURVE:
|
|
|
|
case OB_SURF:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
GPU_matrix_set(rv3d->viewmat);
|
|
|
|
}
|
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
|
2017-08-16 12:45:11 +10:00
|
|
|
void ED_draw_object_facemap(
|
2018-10-15 15:08:37 +11:00
|
|
|
Depsgraph *depsgraph, Object *ob, const float col[4], const int facemap)
|
2017-06-10 10:42:35 +10:00
|
|
|
{
|
|
|
|
/* happens on undo */
|
2018-10-15 15:08:37 +11:00
|
|
|
if (ob->type != OB_MESH || !ob->data) {
|
2017-07-26 05:10:20 +10:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-10-15 15:08:37 +11:00
|
|
|
Mesh *me = ob->data;
|
|
|
|
{
|
|
|
|
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
|
|
|
|
if (ob_eval->runtime.mesh_eval) {
|
|
|
|
me = ob_eval->runtime.mesh_eval;
|
|
|
|
}
|
|
|
|
}
|
2017-06-10 10:42:35 +10:00
|
|
|
|
|
|
|
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
|
2018-06-04 09:39:04 +02:00
|
|
|
|
2017-06-10 10:42:35 +10:00
|
|
|
/* Just to create the data to pass to immediate mode, grr! */
|
|
|
|
const int *facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP);
|
|
|
|
if (facemap_data) {
|
2018-06-27 19:07:23 -06:00
|
|
|
GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
|
|
|
|
GPU_blend(true);
|
2017-06-10 10:42:35 +10:00
|
|
|
|
2018-10-16 13:09:30 +11:00
|
|
|
const MVert *mvert = me->mvert;
|
|
|
|
const MPoly *mpoly = me->mpoly;
|
|
|
|
const MLoop *mloop = me->mloop;
|
2017-06-10 10:42:35 +10:00
|
|
|
|
2018-10-16 13:09:30 +11:00
|
|
|
int mpoly_len = me->totpoly;
|
|
|
|
int mloop_len = me->totloop;
|
2017-06-10 10:42:35 +10:00
|
|
|
|
2018-10-15 15:08:37 +11:00
|
|
|
facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP);
|
2017-06-10 10:42:35 +10:00
|
|
|
|
|
|
|
/* use gawain immediate mode fore now */
|
|
|
|
const int looptris_len = poly_to_tri_count(mpoly_len, mloop_len);
|
2018-10-16 13:09:30 +11:00
|
|
|
const int vbo_len_capacity = looptris_len * 3;
|
|
|
|
int vbo_len_used = 0;
|
|
|
|
|
|
|
|
GPUVertFormat format_pos = { 0 };
|
|
|
|
const uint pos_id = GPU_vertformat_attr_add(&format_pos, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
|
|
|
|
|
|
|
|
GPUVertBuf *vbo_pos = GPU_vertbuf_create_with_format(&format_pos);
|
|
|
|
GPU_vertbuf_data_alloc(vbo_pos, vbo_len_capacity);
|
2017-06-10 10:42:35 +10:00
|
|
|
|
2018-10-16 13:09:30 +11:00
|
|
|
GPUVertBufRaw pos_step;
|
|
|
|
GPU_vertbuf_attr_get_raw_data(vbo_pos, pos_id, &pos_step);
|
|
|
|
|
|
|
|
const MPoly *mp;
|
2017-06-10 10:42:35 +10:00
|
|
|
int i;
|
2018-10-16 13:09:30 +11:00
|
|
|
if (me->runtime.looptris.array) {
|
|
|
|
MLoopTri *mlt = me->runtime.looptris.array;
|
|
|
|
for (mp = mpoly, i = 0; i < mpoly_len; i++, mp++) {
|
|
|
|
if (facemap_data[i] == facemap) {
|
|
|
|
for (int j = 2; j < mp->totloop; j++) {
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[mloop[mlt->tri[0]].v].co);
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[mloop[mlt->tri[1]].v].co);
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[mloop[mlt->tri[2]].v].co);
|
|
|
|
vbo_len_used += 3;
|
|
|
|
mlt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mlt += mp->totloop - 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* No tessellation data, fan-fill. */
|
|
|
|
for (mp = mpoly, i = 0; i < mpoly_len; i++, mp++) {
|
|
|
|
if (facemap_data[i] == facemap) {
|
|
|
|
const MLoop *ml_start = &mloop[mp->loopstart];
|
|
|
|
const MLoop *ml_a = ml_start + 1;
|
|
|
|
const MLoop *ml_b = ml_start + 2;
|
|
|
|
for (int j = 2; j < mp->totloop; j++) {
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[ml_start->v].co);
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[ml_a->v].co);
|
|
|
|
copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[ml_b->v].co);
|
|
|
|
vbo_len_used += 3;
|
|
|
|
|
|
|
|
ml_a++;
|
|
|
|
ml_b++;
|
|
|
|
}
|
2017-06-10 10:42:35 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-16 13:09:30 +11:00
|
|
|
if (vbo_len_capacity != vbo_len_used) {
|
|
|
|
GPU_vertbuf_data_resize(vbo_pos, vbo_len_used);
|
|
|
|
}
|
|
|
|
|
|
|
|
GPUBatch *draw_batch = GPU_batch_create(GPU_PRIM_TRIS, vbo_pos, NULL);
|
|
|
|
GPU_batch_program_set_builtin(draw_batch, GPU_SHADER_3D_UNIFORM_COLOR);
|
|
|
|
GPU_batch_uniform_4fv(draw_batch, "color", col);
|
|
|
|
GPU_batch_draw(draw_batch);
|
|
|
|
GPU_batch_discard(draw_batch);
|
|
|
|
GPU_vertbuf_discard(vbo_pos);
|
2017-06-10 10:42:35 +10:00
|
|
|
|
2018-06-27 19:07:23 -06:00
|
|
|
GPU_blend(false);
|
2017-06-10 10:42:35 +10:00
|
|
|
}
|
|
|
|
}
|