diff options
Diffstat (limited to 'source')
12 files changed, 37 insertions, 37 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 7029d015b22..219c44de9dc 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -204,7 +204,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1); DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); - DRW_shgroup_uniform_float(grp, "roughness", &pinfo->roughness, 1); + DRW_shgroup_uniform_float(grp, "probe_roughness", &pinfo->roughness, 1); DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1); DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1); DRW_shgroup_uniform_float(grp, "texelSize", &pinfo->texel_size, 1); diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl index a5d11f52a1d..af2982b30c0 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl @@ -4,7 +4,7 @@ #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) uniform samplerCube probeHdr; -uniform float roughness; +uniform float probe_roughness; uniform float texelSize; uniform float lodFactor; uniform float lodMax; @@ -51,7 +51,7 @@ void main() float pdf; /* Microfacet normal */ - vec3 H = sample_ggx(Xi, roughness, V, N, T, B, pdf); + vec3 H = sample_ggx(Xi, probe_roughness, V, N, T, B, pdf); vec3 L = -reflect(V, H); float NL = dot(N, L); diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh index 6e1da090f9f..d3766da23cf 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh @@ -74,7 +74,7 @@ GPU_SHADER_INTERFACE_INFO(workbench_material_iface, "") .smooth(Type::FLOAT, "alpha_interp") .smooth(Type::VEC2, "uv_interp") .flat(Type::INT, "object_id") - .flat(Type::FLOAT, "roughness") + .flat(Type::FLOAT, "_roughness") .flat(Type::FLOAT, "metallic"); GPU_SHADER_CREATE_INFO(workbench_material) diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl index 1b20171b3ff..82fa65449eb 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl @@ -7,7 +7,7 @@ void main() { normalData = workbench_normal_encode(gl_FrontFacing, normal_interp); - materialData = vec4(color_interp, workbench_float_pair_encode(roughness, metallic)); + materialData = vec4(color_interp, workbench_float_pair_encode(_roughness, metallic)); objectId = uint(object_id); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl index 65b9f4de4b6..71cf08b7e8c 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl @@ -66,7 +66,7 @@ void main() normal_interp = normalize(normal_world_to_view(nor)); - workbench_material_data_get(resource_handle, color_interp, alpha_interp, roughness, metallic); + workbench_material_data_get(resource_handle, color_interp, alpha_interp, _roughness, metallic); if (materialIndex == 0) { color_interp = hair_get_customdata_vec3(ac); @@ -76,7 +76,7 @@ void main() * So we lower their alpha artificially. */ alpha_interp *= 0.3; - workbench_hair_random_material(hair_rand, color_interp, roughness, metallic); + workbench_hair_random_material(hair_rand, color_interp, _roughness, metallic); object_id = int(uint(resource_handle) & 0xFFFFu) + 1; } diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl index 911d6f5b036..366bc2f9105 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl @@ -19,7 +19,7 @@ void main() uv_interp = vec2(0.0); - workbench_material_data_get(resource_handle, color_interp, alpha_interp, roughness, metallic); + workbench_material_data_get(resource_handle, color_interp, alpha_interp, _roughness, metallic); if (materialIndex == 0) { color_interp = vec3(1.0); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl index 3a63b141c5f..0637f669961 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl @@ -16,7 +16,7 @@ void main() normal_interp = normalize(normal_object_to_view(nor)); - workbench_material_data_get(resource_handle, color_interp, alpha_interp, roughness, metallic); + workbench_material_data_get(resource_handle, color_interp, alpha_interp, _roughness, metallic); if (materialIndex == 0) { color_interp = ac.rgb; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl index 9c0f93c67d9..d8f1b83d747 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl @@ -62,7 +62,7 @@ void main() #endif #ifdef V3D_LIGHTING_STUDIO - vec3 shaded_color = get_world_lighting(color, roughness, metallic, N, I); + vec3 shaded_color = get_world_lighting(color, _roughness, metallic, N, I); #endif #ifdef V3D_LIGHTING_FLAT diff --git a/source/blender/draw/intern/shaders/common_colormanagement_lib.glsl b/source/blender/draw/intern/shaders/common_colormanagement_lib.glsl index 45f711296f3..92d13c6d48b 100644 --- a/source/blender/draw/intern/shaders/common_colormanagement_lib.glsl +++ b/source/blender/draw/intern/shaders/common_colormanagement_lib.glsl @@ -12,19 +12,19 @@ vec4 texture_read_as_linearrgb(sampler2D tex, bool premultiplied, vec2 co) { /* By convention image textures return scene linear colors, but * overlays still assume srgb. */ - vec4 color = texture(tex, co); + vec4 col = texture(tex, co); /* Unpremultiply if stored multiplied, since straight alpha is expected by shaders. */ - if (premultiplied && !(color.a == 0.0 || color.a == 1.0)) { - color.rgb = color.rgb / color.a; + if (premultiplied && !(col.a == 0.0 || col.a == 1.0)) { + col.rgb = col.rgb / col.a; } - return color; + return col; } vec4 texture_read_as_srgb(sampler2D tex, bool premultiplied, vec2 co) { - vec4 color = texture_read_as_linearrgb(tex, premultiplied, co); - color.r = linearrgb_to_srgb(color.r); - color.g = linearrgb_to_srgb(color.g); - color.b = linearrgb_to_srgb(color.b); - return color; + vec4 col = texture_read_as_linearrgb(tex, premultiplied, co); + col.r = linearrgb_to_srgb(col.r); + col.g = linearrgb_to_srgb(col.g); + col.b = linearrgb_to_srgb(col.b); + return col; } diff --git a/source/blender/draw/intern/shaders/common_view_clipping_lib.glsl b/source/blender/draw/intern/shaders/common_view_clipping_lib.glsl index d55808c42d2..bae818cf9f3 100644 --- a/source/blender/draw/intern/shaders/common_view_clipping_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_clipping_lib.glsl @@ -6,13 +6,13 @@ void view_clipping_distances(vec3 wpos) { # ifdef USE_WORLD_CLIP_PLANES - vec4 pos = vec4(wpos, 1.0); - gl_ClipDistance[0] = dot(drw_view.clip_planes[0], pos); - gl_ClipDistance[1] = dot(drw_view.clip_planes[1], pos); - gl_ClipDistance[2] = dot(drw_view.clip_planes[2], pos); - gl_ClipDistance[3] = dot(drw_view.clip_planes[3], pos); - gl_ClipDistance[4] = dot(drw_view.clip_planes[4], pos); - gl_ClipDistance[5] = dot(drw_view.clip_planes[5], pos); + vec4 pos_4d = vec4(wpos, 1.0); + gl_ClipDistance[0] = dot(drw_view.clip_planes[0], pos_4d); + gl_ClipDistance[1] = dot(drw_view.clip_planes[1], pos_4d); + gl_ClipDistance[2] = dot(drw_view.clip_planes[2], pos_4d); + gl_ClipDistance[3] = dot(drw_view.clip_planes[3], pos_4d); + gl_ClipDistance[4] = dot(drw_view.clip_planes[4], pos_4d); + gl_ClipDistance[5] = dot(drw_view.clip_planes[5], pos_4d); # endif } diff --git a/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl b/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl index cdc716db7a4..3edf0e31799 100644 --- a/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl +++ b/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl @@ -7,13 +7,13 @@ uniform vec4 WorldClipPlanes[6]; # define _world_clip_planes_calc_clip_distance(wpos, _clipplanes) \ { \ - vec4 pos = vec4(wpos, 1.0); \ - gl_ClipDistance[0] = dot(_clipplanes[0], pos); \ - gl_ClipDistance[1] = dot(_clipplanes[1], pos); \ - gl_ClipDistance[2] = dot(_clipplanes[2], pos); \ - gl_ClipDistance[3] = dot(_clipplanes[3], pos); \ - gl_ClipDistance[4] = dot(_clipplanes[4], pos); \ - gl_ClipDistance[5] = dot(_clipplanes[5], pos); \ + vec4 _pos = vec4(wpos, 1.0); \ + gl_ClipDistance[0] = dot(_clipplanes[0], _pos); \ + gl_ClipDistance[1] = dot(_clipplanes[1], _pos); \ + gl_ClipDistance[2] = dot(_clipplanes[2], _pos); \ + gl_ClipDistance[3] = dot(_clipplanes[3], _pos); \ + gl_ClipDistance[4] = dot(_clipplanes[4], _pos); \ + gl_ClipDistance[5] = dot(_clipplanes[5], _pos); \ } /* When all shaders are builtin shaders are migrated this could be applied directly. */ diff --git a/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl b/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl index 7d69cba5017..abd4592dc9d 100644 --- a/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl +++ b/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl @@ -6,13 +6,13 @@ uniform bool srgbTarget = false; #endif -vec4 blender_srgb_to_framebuffer_space(vec4 col) +vec4 blender_srgb_to_framebuffer_space(vec4 in_color) { if (srgbTarget) { - vec3 c = max(col.rgb, vec3(0.0)); + vec3 c = max(in_color.rgb, vec3(0.0)); vec3 c1 = c * (1.0 / 12.92); vec3 c2 = pow((c + 0.055) * (1.0 / 1.055), vec3(2.4)); - col.rgb = mix(c1, c2, step(vec3(0.04045), c)); + in_color.rgb = mix(c1, c2, step(vec3(0.04045), c)); } - return col; + return in_color; } |