EEVEE: Remove GPencil from geometry types

The Grease pencil is taking a different direction
and will not be supported in EEVEE.

See https://devtalk.blender.org/t/2025-08-13-grease-pencil-rendering-meeting/41845
This commit is contained in:
Clément Foucault
2025-08-26 15:38:17 +02:00
parent 1f3971cae9
commit 7e26323724
7 changed files with 0 additions and 118 deletions

View File

@@ -373,7 +373,6 @@ set(GLSL_SRC
engines/eevee/shaders/eevee_gbuffer_closure_test.glsl
engines/eevee/shaders/eevee_gbuffer_normal_test.glsl
engines/eevee/shaders/eevee_geom_curves_vert.glsl
engines/eevee/shaders/eevee_geom_gpencil_vert.glsl
engines/eevee/shaders/eevee_geom_mesh_vert.glsl
engines/eevee/shaders/eevee_geom_pointcloud_vert.glsl
engines/eevee/shaders/eevee_geom_volume_vert.glsl

View File

@@ -52,7 +52,6 @@ enum eMaterialGeometry {
MAT_GEOM_MESH = 0,
MAT_GEOM_POINTCLOUD,
MAT_GEOM_CURVES,
MAT_GEOM_GPENCIL,
MAT_GEOM_VOLUME,
/* These maps to special shader. */
@@ -192,8 +191,6 @@ static inline eMaterialGeometry to_material_geometry(const Object *ob)
return MAT_GEOM_CURVES;
case OB_VOLUME:
return MAT_GEOM_VOLUME;
case OB_GREASE_PENCIL:
return MAT_GEOM_GPENCIL;
case OB_POINTCLOUD:
return MAT_GEOM_POINTCLOUD;
default:

View File

@@ -578,9 +578,6 @@ class SamplerSlots {
if (ELEM(geometry_type, MAT_GEOM_POINTCLOUD, MAT_GEOM_CURVES)) {
index_ = 1;
}
else if (geometry_type == MAT_GEOM_GPENCIL) {
index_ = 2;
}
first_reserved_ = MATERIAL_TEXTURE_RESERVED_SLOT_FIRST;
last_reserved_ = MATERIAL_TEXTURE_RESERVED_SLOT_LAST_NO_EVAL;
@@ -834,17 +831,6 @@ void ShaderModule::material_create_info_amend(GPUMaterial *gpumat, GPUCodegenOut
* make the attribs_load function calls valid.
*/
ATTR_FALLTHROUGH;
case MAT_GEOM_GPENCIL:
/**
* Only one uv and one color attribute layer are supported by gpencil objects and they are
* already declared in another createInfo. These are here to make the attribs_load
* function calls valid.
*/
for (auto &input : info.vertex_inputs_) {
global_vars << input.type << " " << input.name << ";\n";
}
info.vertex_inputs_.clear();
break;
case MAT_GEOM_VOLUME:
/** Volume grid attributes come from 3D textures. Transfer attributes to samplers. */
for (auto &input : info.vertex_inputs_) {
@@ -982,9 +968,6 @@ void ShaderModule::material_create_info_amend(GPUMaterial *gpumat, GPUCodegenOut
case MAT_GEOM_WORLD:
info.additional_info("eevee_geom_world");
break;
case MAT_GEOM_GPENCIL:
info.additional_info("eevee_geom_gpencil");
break;
case MAT_GEOM_CURVES:
info.additional_info("eevee_geom_curves");
break;

View File

@@ -30,7 +30,6 @@ set(SRC_GLSL_VERT
eevee_display_lightprobe_sphere_vert.glsl
eevee_display_lightprobe_volume_vert.glsl
eevee_geom_curves_vert.glsl
# eevee_geom_gpencil_vert.glsl # Not yet supported
eevee_geom_mesh_vert.glsl
eevee_geom_pointcloud_vert.glsl
eevee_geom_volume_vert.glsl

View File

@@ -1,74 +0,0 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_gpencil)
#include "draw_grease_pencil_lib.glsl"
#include "draw_model_lib.glsl"
#include "eevee_attributes_gpencil_lib.glsl"
#include "eevee_nodetree_vert_lib.glsl"
#include "eevee_reverse_z_lib.glsl"
#include "eevee_surf_lib.glsl"
#include "eevee_velocity_lib.glsl"
void main()
{
DRW_VIEW_FROM_RESOURCE_ID;
#ifdef MAT_SHADOW
shadow_viewport_layer_set(int(drw_view_id), int(render_view_buf[drw_view_id].viewport_index));
#endif
init_interface();
/* TODO(fclem): Expose through a node? */
float4 sspos;
float2 aspect;
float strength;
float hardness;
float2 thickness;
gl_Position = gpencil_vertex(
/* TODO */
float4(1024.0f, 1024.0f, 1.0f / 1024.0f, 1.0f / 1024.0f),
interp.P,
interp.N,
g_color,
strength,
g_uvs,
sspos,
aspect,
thickness,
hardness);
#ifdef MAT_VELOCITY
/* GPencil do not support deformation motion blur. */
float3 lP_curr = drw_point_world_to_object(interp.P);
/* FIXME(fclem): Evaluating before displacement avoid displacement being treated as motion but
* ignores motion from animated displacement. Supporting animated displacement motion vectors
* would require evaluating the node-tree multiple time with different node-tree UBOs evaluated
* at different times, but also with different attributes (maybe we could assume static attribute
* at least). */
velocity_vertex(lP_curr, lP_curr, lP_curr, motion.prev, motion.next);
#endif
init_globals();
attrib_load();
interp.P += nodetree_displacement();
#ifdef MAT_CLIP_PLANE
clip_interp.clip_distance = dot(clip_plane.plane, float4(interp.P, 1.0f));
#endif
#ifdef MAT_SHADOW
float3 vs_P = drw_point_world_to_view(interp.P);
ShadowRenderView view = render_view_buf[drw_view_id];
shadow_clip.position = shadow_position_vector_get(vs_P, view);
shadow_clip.vector = shadow_clip_vector_get(vs_P, view.clip_distance_inv);
#endif
gl_Position = reverse_z::transform(gl_Position);
}

View File

@@ -70,12 +70,6 @@ void init_globals_curves()
#endif
}
void init_globals_gpencil()
{
/* Undo back-face flip as the grease-pencil normal is already pointing towards the camera. */
g_data.N = g_data.Ni = interp.N;
}
void init_globals()
{
/* Default values. */
@@ -114,8 +108,6 @@ void init_globals()
init_globals_mesh();
#elif defined(MAT_GEOM_CURVES)
init_globals_curves();
#elif defined(MAT_GEOM_GPENCIL)
init_globals_gpencil();
#endif
}

View File

@@ -90,18 +90,6 @@ ADDITIONAL_INFO(draw_volume_infos)
ADDITIONAL_INFO(draw_view)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_geom_gpencil)
ADDITIONAL_INFO(eevee_shared)
DEFINE("MAT_GEOM_GPENCIL")
VERTEX_SOURCE("eevee_geom_gpencil_vert.glsl")
VERTEX_OUT(eevee_surf_iface)
ADDITIONAL_INFO(draw_gpencil)
ADDITIONAL_INFO(draw_modelmat)
ADDITIONAL_INFO(draw_object_infos)
ADDITIONAL_INFO(draw_resource_id_varying)
ADDITIONAL_INFO(draw_resource_id)
GPU_SHADER_CREATE_END()
GPU_SHADER_NAMED_INTERFACE_INFO(eevee_surf_curve_iface, curve_interp)
SMOOTH(float2, barycentric_coords)
SMOOTH(float3, tangent)
@@ -358,8 +346,6 @@ GPU_SHADER_CREATE_END()
# define EEVEE_MAT_GEOM_VARIATIONS(prefix, ...) \
CREATE_INFO_VARIANT(prefix##_world, eevee_geom_world, __VA_ARGS__) \
/* Turned off until dependency on common_view/math_lib are sorted out. */ \
/* CREATE_INFO_VARIANT(prefix##_gpencil, eevee_geom_gpencil, __VA_ARGS__) */ \
CREATE_INFO_VARIANT(prefix##_curves, eevee_geom_curves, __VA_ARGS__) \
CREATE_INFO_VARIANT(prefix##_mesh, eevee_geom_mesh, __VA_ARGS__) \
CREATE_INFO_VARIANT(prefix##_pointcloud, eevee_geom_pointcloud, __VA_ARGS__) \