Implementation of the design task #142969. This adds the following: - Exact GPU interpolation of curves of all types. - Radius attribute support. - Cyclic curve support. - Resolution attribute support. - New Cylinder hair shape type.  What changed: - EEVEE doesn't compute random normals for strand hairs anymore. These are considered legacy now. - EEVEE now have an internal shadow bias to avoid self shadowing on hair. - Workbench Curves Strip display option is no longer flat and has better shading. - Legacy Hair particle system evaluates radius at control points before applying additional subdivision. This now matches Cycles. - Color Attribute Node without a name do not fetch the active color attribute anymore. This now matches Cycles. Notes: - This is not 100% matching the CPU implementation for interpolation (see the epsilons in the tests). - Legacy Hair Particle points is now stored in local space after interpolation. The new cylinder shape allows for more correct hair shading in workbench and better intersection in EEVEE. | | Strand | Strip | Cylinder | | ---- | --- | --- | --- | | Main |  |  | N/A | | PR |  |  |  | | | Strand | Strip | Cylinder | | ---- | --- | --- | --- | | Main |  | | N/A | | PR | ||  | Cyclic Curve, Mixed curve type, and proper radius support:  Test file for attribute lookup: [test_attribute_lookup.blend](/attachments/1d54dd06-379b-4480-a1c5-96adc1953f77) Follow Up Tasks: - Correct full tube segments orientation based on tangent and normal attributes - Correct V resolution property per object - More attribute type support (currently only color) TODO: - [x] Attribute Loading Changes - [x] Generic Attributes - [x] Length Attribute - [x] Intercept Attribute - [x] Original Coordinate Attribute - [x] Cyclic Curves - [x] Legacy Hair Particle conversion - [x] Attribute Loading - [x] Additional Subdivision - [x] Move some function to generic headers (VertBuf, OffsetIndices) - [x] Fix default UV/Color attribute assignment Pull Request: https://projects.blender.org/blender/blender/pulls/143180
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
/* SPDX-FileCopyrightText: 2021 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup draw
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "draw_curves_private.hh"
|
|
#include "draw_hair_private.hh"
|
|
|
|
namespace blender::gpu {
|
|
class Shader;
|
|
} // namespace blender::gpu
|
|
|
|
/* draw_shader.cc */
|
|
|
|
blender::gpu::Shader *DRW_shader_curves_topology_get();
|
|
blender::gpu::Shader *DRW_shader_curves_refine_get(blender::draw::CurvesEvalShader type);
|
|
|
|
blender::gpu::Shader *DRW_shader_debug_draw_display_get();
|
|
blender::gpu::Shader *DRW_shader_draw_visibility_compute_get();
|
|
blender::gpu::Shader *DRW_shader_draw_view_finalize_get();
|
|
blender::gpu::Shader *DRW_shader_draw_resource_finalize_get();
|
|
blender::gpu::Shader *DRW_shader_draw_command_generate_get();
|
|
|
|
/* Subdivision */
|
|
enum class SubdivShaderType {
|
|
BUFFER_LINES = 0,
|
|
BUFFER_LINES_LOOSE = 1,
|
|
BUFFER_EDGE_FAC = 2,
|
|
BUFFER_LNOR = 3,
|
|
BUFFER_TRIS = 4,
|
|
BUFFER_TRIS_MULTIPLE_MATERIALS = 5,
|
|
BUFFER_NORMALS_ACCUMULATE = 6,
|
|
BUFFER_PAINT_OVERLAY_FLAG = 7,
|
|
PATCH_EVALUATION = 8,
|
|
PATCH_EVALUATION_FVAR = 9,
|
|
PATCH_EVALUATION_FACE_DOTS = 10,
|
|
PATCH_EVALUATION_FACE_DOTS_WITH_NORMALS = 11,
|
|
PATCH_EVALUATION_ORCO = 12,
|
|
COMP_CUSTOM_DATA_INTERP = 13,
|
|
BUFFER_SCULPT_DATA = 14,
|
|
BUFFER_UV_STRETCH_ANGLE = 15,
|
|
BUFFER_UV_STRETCH_AREA = 16,
|
|
};
|
|
constexpr int SUBDIVISION_MAX_SHADERS = 17;
|
|
|
|
blender::gpu::Shader *DRW_shader_subdiv_get(SubdivShaderType shader_type);
|
|
blender::gpu::Shader *DRW_shader_subdiv_custom_data_get(GPUVertCompType comp_type, int dimensions);
|
|
blender::gpu::Shader *DRW_shader_subdiv_interp_corner_normals_get();
|
|
|
|
void DRW_shaders_free();
|