Fix T97394: single points are brighter than stroke in 3D viewport
Convert 3D point shader fragment color from sRGB space to framebuffer space to match 3D line shader. Reviewed By: fclem Maniphest Tasks: T97394 Differential Revision: https://developer.blender.org/D16831
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#pragma BLENDER_REQUIRE(gpu_shader_colorspace_lib.glsl)
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@@ -11,7 +12,7 @@ void main()
|
|||||||
* ...
|
* ...
|
||||||
* dist = 0 at center of point */
|
* dist = 0 at center of point */
|
||||||
|
|
||||||
fragColor.rgb = color.rgb;
|
fragColor = blender_srgb_to_framebuffer_space(color);
|
||||||
fragColor.a = mix(color.a, 0.0, smoothstep(radii[1], radii[0], dist));
|
fragColor.a = mix(color.a, 0.0, smoothstep(radii[1], radii[0], dist));
|
||||||
|
|
||||||
if (fragColor.a == 0.0) {
|
if (fragColor.a == 0.0) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa)
|
|||||||
.push_constant(Type::FLOAT, "size")
|
.push_constant(Type::FLOAT, "size")
|
||||||
.vertex_source("gpu_shader_3D_point_uniform_size_aa_vert.glsl")
|
.vertex_source("gpu_shader_3D_point_uniform_size_aa_vert.glsl")
|
||||||
.fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl")
|
.fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl")
|
||||||
|
.additional_info("gpu_srgb_to_framebuffer_space")
|
||||||
.do_static_compilation(true);
|
.do_static_compilation(true);
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped)
|
GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped)
|
||||||
|
|||||||
Reference in New Issue
Block a user