Cycles: add Point Info node
With (center) position, radius and random value outputs. Eevee does not yet support rendering point clouds, but an untested implementation of this node was added for when it does. Ref T92573
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user