Vulkan: Convert Eevee(-next) Stage Interfaces #111224
|
@ -32,8 +32,8 @@ void main()
|
|||
|
||||
uvs = 2.0 * uvs - 1.0;
|
||||
|
||||
vec3 cubevec = x_axis[geom_iface.fFace] * uvs.x + y_axis[geom_iface.fFace] * uvs.y +
|
||||
maj_axes[geom_iface.fFace];
|
||||
vec3 cubevec = x_axis[geom_iface_flat.fFace] * uvs.x + y_axis[geom_iface_flat.fFace] * uvs.y +
|
||||
maj_axes[geom_iface_flat.fFace];
|
||||
|
||||
FragColor = textureLod(source, cubevec, 0.0);
|
||||
}
|
||||
|
|
|
@ -6,20 +6,23 @@
|
|||
|
||||
/* EEVEE_shaders_probe_filter_glossy_sh_get */
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_lightprobe_vert_geom_iface, "vert_iface")
|
||||
.smooth(Type::VEC4, "vPos")
|
||||
.smooth(Type::VEC4, "vPos");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_lightprobe_vert_geom_flat_iface, "vert_iface_flat")
|
||||
.flat(Type::INT, "face");
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_lightprobe_geom_frag_iface, "geom_iface")
|
||||
.smooth(Type::VEC3, "worldPosition")
|
||||
.smooth(Type::VEC3, "viewPosition")
|
||||
.smooth(Type::VEC3, "worldNormal")
|
||||
.smooth(Type::VEC3, "viewNormal")
|
||||
.smooth(Type::VEC3, "viewNormal");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_lightprobe_geom_frag_flat_iface, "geom_iface_flat")
|
||||
.flat(Type::INT, "fFace");
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_vert)
|
||||
.vertex_in(0, Type::VEC3, "pos")
|
||||
.vertex_source("lightprobe_vert.glsl")
|
||||
.vertex_out(eevee_legacy_lightprobe_vert_geom_iface)
|
||||
.vertex_out(eevee_legacy_lightprobe_vert_geom_flat_iface)
|
||||
.builtins(BuiltinBits::INSTANCE_ID);
|
||||
|
||||
#ifdef WITH_METAL_BACKEND
|
||||
|
@ -28,12 +31,14 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_vert_no_geom)
|
|||
.push_constant(Type::INT, "Layer")
|
||||
.vertex_source("lightprobe_vert_no_geom.glsl")
|
||||
.vertex_out(eevee_legacy_lightprobe_geom_frag_iface)
|
||||
.vertex_out(eevee_legacy_lightprobe_geom_frag_flat_iface)
|
||||
.builtins(BuiltinBits::INSTANCE_ID);
|
||||
#endif
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_geom)
|
||||
.geometry_source("lightprobe_geom.glsl")
|
||||
.geometry_out(eevee_legacy_lightprobe_geom_frag_iface)
|
||||
.geometry_out(eevee_legacy_lightprobe_geom_frag_flat_iface)
|
||||
.push_constant(Type::INT, "Layer")
|
||||
.geometry_layout(PrimitiveIn::TRIANGLES, PrimitiveOut::TRIANGLE_STRIP, 3);
|
||||
|
||||
|
@ -208,8 +213,10 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_studiolight_background)
|
|||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_probe_planar_downsample_vert_geom_iface,
|
||||
"lightprobe_vert_iface")
|
||||
.flat(Type::INT, "instance")
|
||||
.smooth(Type::VEC2, "vPos");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_probe_planar_downsample_vert_geom_flat_iface,
|
||||
"lightprobe_vert_iface_flat")
|
||||
.flat(Type::INT, "instance");
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_legacy_probe_planar_downsample_geom_frag_iface,
|
||||
"lightprobe_geom_iface")
|
||||
|
@ -219,6 +226,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_planar_downsample_common)
|
|||
.vertex_source("lightprobe_planar_downsample_vert.glsl")
|
||||
.fragment_source("lightprobe_planar_downsample_frag.glsl")
|
||||
.vertex_out(eevee_legacy_probe_planar_downsample_vert_geom_iface)
|
||||
.vertex_out(eevee_legacy_probe_planar_downsample_vert_geom_flat_iface)
|
||||
.sampler(0, ImageType::FLOAT_2D_ARRAY, "source")
|
||||
.push_constant(Type::FLOAT, "fireflyFactor")
|
||||
.fragment_out(0, Type::VEC4, "FragColor")
|
||||
|
|
|
@ -20,14 +20,14 @@ const vec3 y_axis[6] = vec3[6](vec3(0.0, -1.0, 0.0),
|
|||
|
||||
void main()
|
||||
{
|
||||
geom_iface.fFace = vert_iface[0].face;
|
||||
gl_Layer = Layer + geom_iface.fFace;
|
||||
geom_iface_flat.fFace = vert_iface_flat[0].face;
|
||||
gl_Layer = Layer + geom_iface_flat.fFace;
|
||||
|
||||
for (int v = 0; v < 3; v++) {
|
||||
gl_Position = vert_iface[v].vPos;
|
||||
geom_iface.worldPosition = x_axis[geom_iface.fFace] * vert_iface[v].vPos.x +
|
||||
y_axis[geom_iface.fFace] * vert_iface[v].vPos.y +
|
||||
maj_axes[geom_iface.fFace];
|
||||
geom_iface.worldPosition = x_axis[geom_iface_flat.fFace] * vert_iface[v].vPos.x +
|
||||
y_axis[geom_iface_flat.fFace] * vert_iface[v].vPos.y +
|
||||
maj_axes[geom_iface_flat.fFace];
|
||||
EmitVertex();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ layout(triangle_strip, max_vertices = 3) out;
|
|||
|
||||
void main()
|
||||
{
|
||||
gl_Layer = lightprobe_vert_iface[0].instance;
|
||||
lightprobe_geom_iface.layer = float(lightprobe_vert_iface[0].instance);
|
||||
gl_Layer = lightprobe_vert_iface_flat[0].instance;
|
||||
lightprobe_geom_iface.layer = float(lightprobe_vert_iface_flat[0].instance);
|
||||
|
||||
gl_Position = vec4(lightprobe_vert_iface[0].vPos, 0.0, 1.0);
|
||||
EmitVertex();
|
||||
|
|
|
@ -5,11 +5,11 @@ void main()
|
|||
lightprobe_vert_iface.vPos.x = -1.0 + float((v & 1) << 2);
|
||||
lightprobe_vert_iface.vPos.y = -1.0 + float((v & 2) << 1);
|
||||
|
||||
lightprobe_vert_iface.instance = gl_VertexID / 3;
|
||||
lightprobe_vert_iface_flat.instance = gl_VertexID / 3;
|
||||
|
||||
#ifdef GPU_METAL
|
||||
gpu_Layer = lightprobe_vert_iface.instance;
|
||||
lightprobe_geom_iface.layer = float(lightprobe_vert_iface.instance);
|
||||
gpu_Layer = lightprobe_vert_iface_flat.instance;
|
||||
lightprobe_geom_iface.layer = float(lightprobe_vert_iface_flat.instance);
|
||||
gl_Position = vec4(lightprobe_vert_iface.vPos, 0.0, 1.0);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
void main()
|
||||
{
|
||||
vert_iface.vPos = vec4(pos, 1.0);
|
||||
vert_iface.face = gl_InstanceID;
|
||||
vert_iface_flat.face = gl_InstanceID;
|
||||
}
|
||||
|
|
|
@ -22,14 +22,15 @@ void main()
|
|||
vec3(0.0, 0.0, -1.0),
|
||||
vec3(0.0, -1.0, 0.0),
|
||||
vec3(0.0, -1.0, 0.0));
|
||||
geom_iface.fFace = gl_InstanceID;
|
||||
geom_iface_flat.fFace = gl_InstanceID;
|
||||
gl_Position = vec4(pos.xyz, 1.0);
|
||||
geom_iface.worldPosition = x_axis[geom_iface.fFace] * pos.x + y_axis[geom_iface.fFace] * pos.y +
|
||||
maj_axes[geom_iface.fFace];
|
||||
geom_iface.worldPosition = x_axis[geom_iface_flat.fFace] * pos.x +
|
||||
y_axis[geom_iface_flat.fFace] * pos.y +
|
||||
maj_axes[geom_iface_flat.fFace];
|
||||
|
||||
#ifdef GPU_METAL
|
||||
/* In the Metal API, gl_Layer equivalent is specified in the vertex shader for multilayered
|
||||
* rendering support. */
|
||||
gpu_Layer = Layer + geom_iface.fFace;
|
||||
gpu_Layer = Layer + geom_iface_flat.fFace;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ int g_curves_attr_id = 0;
|
|||
* based on the attribute scope (point or spline). */
|
||||
int curves_attribute_element_id()
|
||||
{
|
||||
int id = interp.curves_strand_id;
|
||||
int id = interp_flat.curves_strand_id;
|
||||
if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) {
|
||||
# ifdef COMMON_HAIR_LIB
|
||||
id = hair_get_base_id();
|
||||
|
@ -202,11 +202,11 @@ vec4 attr_load_tangent(samplerBuffer cd_buf)
|
|||
}
|
||||
vec3 attr_load_uv(samplerBuffer cd_buf)
|
||||
{
|
||||
return texelFetch(cd_buf, interp.curves_strand_id).rgb;
|
||||
return texelFetch(cd_buf, interp_flat.curves_strand_id).rgb;
|
||||
}
|
||||
vec4 attr_load_color(samplerBuffer cd_buf)
|
||||
{
|
||||
return texelFetch(cd_buf, interp.curves_strand_id).rgba;
|
||||
return texelFetch(cd_buf, interp_flat.curves_strand_id).rgba;
|
||||
}
|
||||
vec4 attr_load_vec4(samplerBuffer cd_buf)
|
||||
{
|
||||
|
|
|
@ -12,24 +12,24 @@
|
|||
|
||||
void main()
|
||||
{
|
||||
vec4 coc4 = vec4(interp.color_and_coc1.w,
|
||||
interp.color_and_coc2.w,
|
||||
interp.color_and_coc3.w,
|
||||
interp.color_and_coc4.w);
|
||||
vec4 coc4 = vec4(interp_flat.color_and_coc1.w,
|
||||
interp_flat.color_and_coc2.w,
|
||||
interp_flat.color_and_coc3.w,
|
||||
interp_flat.color_and_coc4.w);
|
||||
vec4 shapes;
|
||||
if (use_bokeh_lut) {
|
||||
shapes = vec4(texture(bokeh_lut_tx, interp.rect_uv1).r,
|
||||
texture(bokeh_lut_tx, interp.rect_uv2).r,
|
||||
texture(bokeh_lut_tx, interp.rect_uv3).r,
|
||||
texture(bokeh_lut_tx, interp.rect_uv4).r);
|
||||
shapes = vec4(texture(bokeh_lut_tx, interp_noperspective.rect_uv1).r,
|
||||
texture(bokeh_lut_tx, interp_noperspective.rect_uv2).r,
|
||||
texture(bokeh_lut_tx, interp_noperspective.rect_uv3).r,
|
||||
texture(bokeh_lut_tx, interp_noperspective.rect_uv4).r);
|
||||
}
|
||||
else {
|
||||
shapes = vec4(length(interp.rect_uv1),
|
||||
length(interp.rect_uv2),
|
||||
length(interp.rect_uv3),
|
||||
length(interp.rect_uv4));
|
||||
shapes = vec4(length(interp_noperspective.rect_uv1),
|
||||
length(interp_noperspective.rect_uv2),
|
||||
length(interp_noperspective.rect_uv3),
|
||||
length(interp_noperspective.rect_uv4));
|
||||
}
|
||||
shapes *= interp.distance_scale;
|
||||
shapes *= interp_flat.distance_scale;
|
||||
/* Becomes signed distance field in pixel units. */
|
||||
shapes -= coc4;
|
||||
/* Smooth the edges a bit to fade out the undersampling artifacts. */
|
||||
|
@ -52,8 +52,8 @@ void main()
|
|||
shapes *= variance * safe_rcp(variance + sqr(max(coc4 * correction_fac - mean, 0.0)));
|
||||
}
|
||||
|
||||
out_color = (interp.color_and_coc1 * shapes[0] + interp.color_and_coc2 * shapes[1] +
|
||||
interp.color_and_coc3 * shapes[2] + interp.color_and_coc4 * shapes[3]);
|
||||
out_color = (interp_flat.color_and_coc1 * shapes[0] + interp_flat.color_and_coc2 * shapes[1] +
|
||||
interp_flat.color_and_coc3 * shapes[2] + interp_flat.color_and_coc4 * shapes[3]);
|
||||
/* Do not accumulate alpha. This has already been accumulated by the gather pass. */
|
||||
out_color.a = 0.0;
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ void main()
|
|||
{
|
||||
ScatterRect rect = scatter_list_buf[gl_InstanceID];
|
||||
|
||||
interp.color_and_coc1 = rect.color_and_coc[0];
|
||||
interp.color_and_coc2 = rect.color_and_coc[1];
|
||||
interp.color_and_coc3 = rect.color_and_coc[2];
|
||||
interp.color_and_coc4 = rect.color_and_coc[3];
|
||||
interp_flat.color_and_coc1 = rect.color_and_coc[0];
|
||||
interp_flat.color_and_coc2 = rect.color_and_coc[1];
|
||||
interp_flat.color_and_coc3 = rect.color_and_coc[2];
|
||||
interp_flat.color_and_coc4 = rect.color_and_coc[3];
|
||||
|
||||
vec2 uv = vec2(gl_VertexID & 1, gl_VertexID >> 1) * 2.0 - 1.0;
|
||||
uv = uv * rect.half_extent;
|
||||
|
@ -26,20 +26,20 @@ void main()
|
|||
|
||||
if (use_bokeh_lut) {
|
||||
/* Bias scale to avoid sampling at the texture's border. */
|
||||
interp.distance_scale = (float(DOF_BOKEH_LUT_SIZE) / float(DOF_BOKEH_LUT_SIZE - 1));
|
||||
vec2 uv_div = 1.0 / (interp.distance_scale * abs(rect.half_extent));
|
||||
interp.rect_uv1 = ((uv + quad_offsets[0]) * uv_div) * 0.5 + 0.5;
|
||||
interp.rect_uv2 = ((uv + quad_offsets[1]) * uv_div) * 0.5 + 0.5;
|
||||
interp.rect_uv3 = ((uv + quad_offsets[2]) * uv_div) * 0.5 + 0.5;
|
||||
interp.rect_uv4 = ((uv + quad_offsets[3]) * uv_div) * 0.5 + 0.5;
|
||||
interp_flat.distance_scale = (float(DOF_BOKEH_LUT_SIZE) / float(DOF_BOKEH_LUT_SIZE - 1));
|
||||
vec2 uv_div = 1.0 / (interp_flat.distance_scale * abs(rect.half_extent));
|
||||
interp_noperspective.rect_uv1 = ((uv + quad_offsets[0]) * uv_div) * 0.5 + 0.5;
|
||||
interp_noperspective.rect_uv2 = ((uv + quad_offsets[1]) * uv_div) * 0.5 + 0.5;
|
||||
interp_noperspective.rect_uv3 = ((uv + quad_offsets[2]) * uv_div) * 0.5 + 0.5;
|
||||
interp_noperspective.rect_uv4 = ((uv + quad_offsets[3]) * uv_div) * 0.5 + 0.5;
|
||||
/* Only for sampling. */
|
||||
interp.distance_scale *= max_v2(abs(rect.half_extent));
|
||||
interp_flat.distance_scale *= max_v2(abs(rect.half_extent));
|
||||
}
|
||||
else {
|
||||
interp.distance_scale = 1.0;
|
||||
interp.rect_uv1 = uv + quad_offsets[0];
|
||||
interp.rect_uv2 = uv + quad_offsets[1];
|
||||
interp.rect_uv3 = uv + quad_offsets[2];
|
||||
interp.rect_uv4 = uv + quad_offsets[3];
|
||||
interp_flat.distance_scale = 1.0;
|
||||
interp_noperspective.rect_uv1 = uv + quad_offsets[0];
|
||||
interp_noperspective.rect_uv2 = uv + quad_offsets[1];
|
||||
interp_noperspective.rect_uv3 = uv + quad_offsets[2];
|
||||
interp_noperspective.rect_uv4 = uv + quad_offsets[3];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ void main()
|
|||
interp.curves_time_width);
|
||||
|
||||
interp.N = cross(interp.curves_tangent, interp.curves_binormal);
|
||||
interp.curves_strand_id = hair_get_strand_id();
|
||||
interp_flat.curves_strand_id = hair_get_strand_id();
|
||||
interp.barycentric_coords = hair_get_barycentric();
|
||||
#ifdef MAT_VELOCITY
|
||||
/* Due to the screen space nature of the vertex positioning, we compute only the motion of curve
|
||||
|
|
|
@ -16,7 +16,7 @@ void main()
|
|||
|
||||
init_interface();
|
||||
|
||||
point_cloud_interp.id = pointcloud_get_point_id();
|
||||
point_cloud_interp_flat.id = pointcloud_get_point_id();
|
||||
pointcloud_get_pos_and_radius(point_cloud_interp.position, point_cloud_interp.radius);
|
||||
pointcloud_get_pos_and_nor(interp.P, interp.N);
|
||||
#ifdef MAT_SHADOW
|
||||
|
@ -30,7 +30,7 @@ void main()
|
|||
#ifdef MAT_VELOCITY
|
||||
vec3 lP = point_world_to_object(point_cloud_interp.position);
|
||||
vec3 prv, nxt;
|
||||
velocity_local_pos_get(lP, point_cloud_interp.id, prv, nxt);
|
||||
velocity_local_pos_get(lP, point_cloud_interp_flat.id, prv, nxt);
|
||||
/* 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 nodetree multiple time with different nodetree UBOs evaluated at
|
||||
|
|
|
@ -96,7 +96,7 @@ void main()
|
|||
* and fallback to the inflated ones if theres no hit.
|
||||
* The inflated bounds can cause unnecesary extra steps. */
|
||||
float ls_near_box_t = ray_aabb(
|
||||
ls_near_plane, ls_view_direction, interp.ls_aabb_min, interp.ls_aabb_max);
|
||||
ls_near_plane, ls_view_direction, interp_flat.ls_aabb_min, interp_flat.ls_aabb_max);
|
||||
vec3 ls_near_box = ls_near_plane + ls_view_direction * ls_near_box_t;
|
||||
vec3 ws_near_box = point_object_to_world(ls_near_box);
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ void main()
|
|||
ls_conservative_max = max(ls_conservative_max, lP);
|
||||
}
|
||||
|
||||
interp.ls_aabb_min = ls_conservative_min;
|
||||
interp.ls_aabb_max = ls_conservative_max;
|
||||
interp_flat.ls_aabb_min = ls_conservative_min;
|
||||
interp_flat.ls_aabb_max = ls_conservative_max;
|
||||
|
||||
vec3 lP = mix(ls_conservative_min, ls_conservative_max, max(vec3(0), pos));
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ void init_globals_curves()
|
|||
g_data.is_strand = true;
|
||||
g_data.hair_time = interp.curves_time;
|
||||
g_data.hair_thickness = interp.curves_thickness;
|
||||
g_data.hair_strand_id = interp.curves_strand_id;
|
||||
g_data.hair_strand_id = interp_flat.curves_strand_id;
|
||||
#if defined(USE_BARYCENTRICS) && defined(GPU_FRAGMENT_SHADER) && defined(MAT_GEOM_CURVES)
|
||||
g_data.barycentric_coords = hair_resolve_barycentric(interp.barycentric_coords);
|
||||
#endif
|
||||
|
@ -120,7 +120,7 @@ void init_interface()
|
|||
interp.curves_time = 0.0;
|
||||
interp.curves_time_width = 0.0;
|
||||
interp.curves_thickness = 0.0;
|
||||
interp.curves_strand_id = 0;
|
||||
interp_flat.curves_strand_id = 0;
|
||||
drw_ResourceID_iface.resource_index = resource_id;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -192,19 +192,20 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_filter)
|
|||
/** \name Scatter
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_depth_of_field_scatter_iface, "interp")
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_depth_of_field_scatter_flat_iface, "interp_flat")
|
||||
/** Colors, weights, and Circle of confusion radii for the 4 pixels to scatter. */
|
||||
.flat(Type::VEC4, "color_and_coc1")
|
||||
.flat(Type::VEC4, "color_and_coc2")
|
||||
.flat(Type::VEC4, "color_and_coc3")
|
||||
.flat(Type::VEC4, "color_and_coc4")
|
||||
/** Scaling factor for the bokeh distance. */
|
||||
.flat(Type::FLOAT, "distance_scale");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_depth_of_field_scatter_noperspective_iface, "interp_noperspective")
|
||||
/** Sprite pixel position with origin at sprite center. In pixels. */
|
||||
.no_perspective(Type::VEC2, "rect_uv1")
|
||||
.no_perspective(Type::VEC2, "rect_uv2")
|
||||
.no_perspective(Type::VEC2, "rect_uv3")
|
||||
.no_perspective(Type::VEC2, "rect_uv4")
|
||||
/** Scaling factor for the bokeh distance. */
|
||||
.flat(Type::FLOAT, "distance_scale");
|
||||
.no_perspective(Type::VEC2, "rect_uv4");
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_depth_of_field_scatter)
|
||||
.do_static_compilation(true)
|
||||
|
@ -214,7 +215,8 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_scatter)
|
|||
.storage_buf(0, Qualifier::READ, "ScatterRect", "scatter_list_buf[]")
|
||||
.fragment_out(0, Type::VEC4, "out_color")
|
||||
.push_constant(Type::BOOL, "use_bokeh_lut")
|
||||
.vertex_out(eevee_depth_of_field_scatter_iface)
|
||||
.vertex_out(eevee_depth_of_field_scatter_flat_iface)
|
||||
.vertex_out(eevee_depth_of_field_scatter_noperspective_iface)
|
||||
.vertex_source("eevee_depth_of_field_scatter_vert.glsl")
|
||||
.fragment_source("eevee_depth_of_field_scatter_frag.glsl");
|
||||
|
||||
|
|
|
@ -41,7 +41,8 @@ GPU_SHADER_CREATE_INFO(eevee_geom_mesh)
|
|||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_surf_point_cloud_iface, "point_cloud_interp")
|
||||
.smooth(Type::FLOAT, "radius")
|
||||
.smooth(Type::VEC3, "position")
|
||||
.smooth(Type::VEC3, "position");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_surf_point_cloud_flat_iface, "point_cloud_interp_flat")
|
||||
.flat(Type::INT, "id");
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_geom_point_cloud)
|
||||
|
@ -49,10 +50,11 @@ GPU_SHADER_CREATE_INFO(eevee_geom_point_cloud)
|
|||
.define("MAT_GEOM_POINT_CLOUD")
|
||||
.vertex_source("eevee_geom_point_cloud_vert.glsl")
|
||||
.vertex_out(eevee_surf_point_cloud_iface)
|
||||
.vertex_out(eevee_surf_point_cloud_flat_iface)
|
||||
/* TODO(Miguel Pozo): Remove once we get rid of old EEVEE. */
|
||||
.define("pointRadius", "point_cloud_interp.radius")
|
||||
.define("pointPosition", "point_cloud_interp.position")
|
||||
.define("pointID", "point_cloud_interp.id")
|
||||
.define("pointID", "point_cloud_interp_flat.id")
|
||||
.additional_info("draw_pointcloud_new",
|
||||
"draw_modelmat_new",
|
||||
"draw_resource_id_varying",
|
||||
|
@ -95,7 +97,8 @@ GPU_SHADER_INTERFACE_INFO(eevee_surf_iface, "interp")
|
|||
.smooth(Type::VEC3, "curves_binormal")
|
||||
.smooth(Type::FLOAT, "curves_time")
|
||||
.smooth(Type::FLOAT, "curves_time_width")
|
||||
.smooth(Type::FLOAT, "curves_thickness")
|
||||
.smooth(Type::FLOAT, "curves_thickness");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_surf_flat_iface, "interp_flat")
|
||||
.flat(Type::INT, "curves_strand_id");
|
||||
|
||||
#define image_out(slot, qualifier, format, name) \
|
||||
|
@ -115,6 +118,7 @@ GPU_SHADER_CREATE_INFO(eevee_cryptomatte_out)
|
|||
|
||||
GPU_SHADER_CREATE_INFO(eevee_surf_deferred)
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
/* NOTE: This removes the possibility of using gl_FragDepth. */
|
||||
.early_fragment_test(true)
|
||||
/* Direct output. (Emissive, Holdout) */
|
||||
|
@ -135,6 +139,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_deferred)
|
|||
|
||||
GPU_SHADER_CREATE_INFO(eevee_surf_forward)
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
/* Early fragment test is needed for render passes support for forward surfaces. */
|
||||
/* NOTE: This removes the possibility of using gl_FragDepth. */
|
||||
.early_fragment_test(true)
|
||||
|
@ -157,6 +162,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_forward)
|
|||
|
||||
GPU_SHADER_CREATE_INFO(eevee_surf_capture)
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
.define("MAT_CAPTURE")
|
||||
.storage_buf(SURFEL_BUF_SLOT, Qualifier::WRITE, "Surfel", "surfel_buf[]")
|
||||
.storage_buf(CAPTURE_BUF_SLOT, Qualifier::READ_WRITE, "CaptureInfoData", "capture_info_buf")
|
||||
|
@ -166,11 +172,13 @@ GPU_SHADER_CREATE_INFO(eevee_surf_capture)
|
|||
GPU_SHADER_CREATE_INFO(eevee_surf_depth)
|
||||
.define("MAT_DEPTH")
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
.fragment_source("eevee_surf_depth_frag.glsl")
|
||||
.additional_info("eevee_sampling_data", "eevee_camera", "eevee_utility_texture");
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_surf_world)
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
.push_constant(Type::FLOAT, "world_opacity_fade")
|
||||
.fragment_out(0, Type::VEC4, "out_background")
|
||||
.fragment_source("eevee_surf_world_frag.glsl")
|
||||
|
@ -185,6 +193,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_shadow)
|
|||
.define("DRW_VIEW_LEN", "64")
|
||||
.define("MAT_SHADOW")
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
.vertex_out(eevee_shadow_iface)
|
||||
.sampler(SHADOW_RENDER_MAP_SLOT, ImageType::UINT_2D_ARRAY, "shadow_render_map_tx")
|
||||
.image(SHADOW_ATLAS_SLOT,
|
||||
|
|
|
@ -84,7 +84,8 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_surfels)
|
|||
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_shadow_tag_transparent_iface, "interp")
|
||||
.smooth(Type::VEC3, "P")
|
||||
.smooth(Type::VEC3, "vP")
|
||||
.smooth(Type::VEC3, "vP");
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_shadow_tag_transparent_flat_iface, "interp_flat")
|
||||
.flat(Type::VEC3, "ls_aabb_min")
|
||||
.flat(Type::VEC3, "ls_aabb_max");
|
||||
|
||||
|
@ -99,6 +100,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_transparent)
|
|||
.push_constant(Type::IVEC2, "fb_resolution")
|
||||
.push_constant(Type::INT, "fb_lod")
|
||||
.vertex_out(eevee_shadow_tag_transparent_iface)
|
||||
.vertex_out(eevee_shadow_tag_transparent_flat_iface)
|
||||
.additional_info("eevee_shared",
|
||||
"draw_resource_id_varying",
|
||||
"draw_view",
|
||||
|
|
Loading…
Reference in New Issue