diff options
Diffstat (limited to 'source/blender/draw/engines')
5 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 996716d6def..766e721b1b8 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -176,7 +176,7 @@ enum { VAR_MAT_MESH = (1 << 0), VAR_MAT_VOLUME = (1 << 1), VAR_MAT_HAIR = (1 << 2), - /* VAR_MAT_PROBE = (1 << 3), UNUSED */ + VAR_MAT_POINTCLOUD = (1 << 3), VAR_MAT_BLEND = (1 << 4), VAR_MAT_LOOKDEV = (1 << 5), VAR_MAT_HOLDOUT = (1 << 6), diff --git a/source/blender/draw/engines/eevee/eevee_shaders.c b/source/blender/draw/engines/eevee/eevee_shaders.c index adede7676d5..e56097df6b7 100644 --- a/source/blender/draw/engines/eevee/eevee_shaders.c +++ b/source/blender/draw/engines/eevee/eevee_shaders.c @@ -1357,6 +1357,9 @@ static char *eevee_get_defines(int options) if ((options & VAR_MAT_HAIR) != 0) { BLI_dynstr_append(ds, "#define HAIR_SHADER\n"); } + if ((options & VAR_MAT_POINTCLOUD) != 0) { + BLI_dynstr_append(ds, "#define POINTCLOUD_SHADER\n"); + } if ((options & VAR_WORLD_PROBE) != 0) { BLI_dynstr_append(ds, "#define PROBE_CAPTURE\n"); } diff --git a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl index 0e342938396..cbfa9737a84 100644 --- a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl @@ -26,6 +26,9 @@ void main() worldNormal = cross(hairTangent, binor); vec3 world_pos = pos; +#elif defined(POINTCLOUD_SHADER) + pointcloud_get_pos_and_radius(pointPosition, pointRadius); + pointID = gl_VertexID; #else vec3 world_pos = point_object_to_world(pos); #endif diff --git a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl index 7d016d57c46..d7fc5e0b52a 100644 --- a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl @@ -42,3 +42,13 @@ IN_OUT ShaderHairInterface flat int hairStrandID; }; #endif + +#ifdef POINTCLOUD_SHADER +IN_OUT ShaderPointCloudInterface +{ + /* world space */ + float pointRadius; + float pointPosition; + flat int pointID; +}; +#endif diff --git a/source/blender/draw/engines/eevee/shaders/surface_vert.glsl b/source/blender/draw/engines/eevee/shaders/surface_vert.glsl index 0ad1393dd70..51e9eda6cc2 100644 --- a/source/blender/draw/engines/eevee/shaders/surface_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/surface_vert.glsl @@ -31,6 +31,9 @@ void main() hairThickTime); worldNormal = cross(hairTangent, binor); vec3 world_pos = pos; +#elif defined(POINTCLOUD_SHADER) + pointcloud_get_pos_and_radius(pointPosition, pointRadius); + pointID = gl_VertexID; #else vec3 world_pos = point_object_to_world(pos); #endif |