diff --git a/indra/newview/app_settings/graphic_preset_controls.xml b/indra/newview/app_settings/graphic_preset_controls.xml index 4868db86d2..bb81fea675 100644 --- a/indra/newview/app_settings/graphic_preset_controls.xml +++ b/indra/newview/app_settings/graphic_preset_controls.xml @@ -20,27 +20,22 @@ RenderAttachedParticles RenderAutoMaskAlphaDeferred RenderAutoMaskAlphaNonDeferred - RenderAvatarCloth RenderAvatarLODFactor RenderAvatarMaxComplexity RenderAvatarMaxNonImpostors RenderAvatarPhysicsLODFactor RenderCompressTextures - RenderDeferred RenderDeferredSSAO RenderDepthOfField RenderDepthOfFieldInEditMode RenderFarClip RenderFlexTimeFactor - RenderFogRatio RenderFSAASamples - RenderGamma RenderGlow RenderGlowIterations RenderGlowResolutionPow RenderLocalLights RenderMaxPartCount - RenderObjectBump RenderPBR RenderQualityPerformance RenderReflectionDetail @@ -60,7 +55,6 @@ RenderWaterRefResolution TextureDiscardLevel TextureMemory - WindLightUseAtmosShaders WLSkyDetail diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 012cfff443..f17fea3151 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11717,13 +11717,13 @@ Change of this parameter will affect the layout of buttons in notification toast RenderAvatarCloth Comment - Controls if avatars use wavy cloth + DEPRECATED - only false supported - Controls if avatars use wavy cloth Persist 1 Type Boolean Value - 1 + 0 RenderComplexityColorMin @@ -12689,19 +12689,19 @@ Change of this parameter will affect the layout of buttons in notification toast Type Boolean Value - 0 + 1 RenderDeferred Comment - Use deferred rendering pipeline (Advanced Lighting Model). + DEPRECATED (only true supported) - Use deferred rendering pipeline (Advanced Lighting Model). Persist 1 Type Boolean Value - 0 + 1 RenderDeferredSun @@ -12942,7 +12942,7 @@ Change of this parameter will affect the layout of buttons in notification toast RenderFogRatio Comment - Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance) + DEPRECATED - Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance) Persist 1 Type @@ -12953,7 +12953,7 @@ Change of this parameter will affect the layout of buttons in notification toast RenderGamma Comment - Sets gamma exponent for renderer + DEPRECATED - Sets gamma exponent for renderer Persist 1 Type @@ -13358,7 +13358,7 @@ Change of this parameter will affect the layout of buttons in notification toast RenderObjectBump Comment - Show bumpmapping on primitives + DEPRECATED (only TRUE supported) Show bumpmapping on primitives Persist 1 Type @@ -18723,7 +18723,7 @@ Change of this parameter will affect the layout of buttons in notification toast WindLightUseAtmosShaders Comment - Whether to enable or disable WindLight atmospheric shaders. + DEPRECATED (only true supported) - Whether to enable or disable WindLight atmospheric shaders. Persist 1 Type diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 4df74b762a..ad3a93128d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -25,12 +25,27 @@ uniform sampler2DRect normalMap; uniform sampler2DRect depthMap; +uniform sampler2D projectionMap; // rgba + +// projected lighted params +uniform mat4 proj_mat; //screen space to light space projector +uniform vec3 proj_n; // projector normal +uniform vec3 proj_p; //plane projection is emitting from (in screen space) +uniform float proj_focus; // distance from plane to begin blurring +uniform float proj_lod ; // (number of mips in proj map) +uniform float proj_range; // range between near clip and far clip plane of projection + +// light params +uniform vec3 color; // light_color +uniform float size; // light_size uniform mat4 inv_proj; uniform vec2 screen_res; const float M_PI = 3.14159265; +vec3 srgb_to_linear(vec3 cs); + // In: // lv unnormalized surface to light vector // n normal of the surface @@ -52,6 +67,33 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, lightDist = length(lv); } +// In: +// light_center +// pos +// Out: +// dist +// l_dist +// lv +// proj_tc Projector Textue Coordinates +bool clipProjectedLightVars(vec3 light_center, vec3 pos, out float dist, out float l_dist, out vec3 lv, out vec4 proj_tc ) +{ + lv = light_center - pos.xyz; + dist = length(lv); + bool clipped = (dist >= size); + if ( !clipped ) + { + dist /= size; + + l_dist = -dot(lv, proj_n); + vec4 projected_point = (proj_mat * vec4(pos.xyz, 1.0)); + clipped = (projected_point.z < 0.0); + projected_point.xyz /= projected_point.w; + proj_tc = projected_point; + } + + return clipped; +} + vec2 getScreenCoordinate(vec2 screenpos) { vec2 sc = screenpos.xy * 2.0; @@ -104,6 +146,80 @@ float getDepth(vec2 pos_screen) return depth; } +vec4 getTexture2DLodDiffuse(vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + ret.rgb = srgb_to_linear(ret.rgb); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + float det = min(lod/(proj_lod*0.5), 1.0); + float d = min(dist.x, dist.y); + float edge = 0.25*det; + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +// Returns projected light in Linear +// Uses: +// color +// NOTE: projected.a will be pre-multiplied with projected.rgb +vec3 getProjectedLightDiffuseColor(float light_distance, vec2 projected_uv) +{ + float diff = clamp((light_distance - proj_focus)/proj_range, 0.0, 1.0); + float lod = diff * proj_lod; + vec4 plcol = getTexture2DLodDiffuse(projected_uv.xy, lod); + + return color.rgb * plcol.rgb * plcol.a; +} + +vec4 texture2DLodSpecular(vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + ret.rgb = srgb_to_linear(ret.rgb); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + float det = min(lod/(proj_lod*0.5), 1.0); + float d = min(dist.x, dist.y); + d *= min(1, d * (proj_lod - lod)); // BUG? extra factor compared to diffuse causes N repeats + float edge = 0.25*det; + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +// See: clipProjectedLightVars() +vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n ) +{ + vec3 slit = vec3(0); + vec3 ref = reflect(normalize(pos), n); + + //project from point pos in direction ref to plane proj_p, proj_n + vec3 pdelta = proj_p-pos; + float l_dist = length(pdelta); + float ds = dot(ref, proj_n); + if (ds < 0.0) + { + vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; + vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); + if (stc.z > 0.0) + { + stc /= stc.w; + slit = getProjectedLightDiffuseColor( l_dist, stc.xy ); // NOTE: Using diffuse due to texture2DLodSpecular() has extra: d *= min(1, d * (proj_lod - lod)); + } + } + return slit; // specular light +} + +vec3 getProjectedLightSpecularColor(float light_distance, vec2 projected_uv) +{ + float diff = clamp((light_distance - proj_focus)/proj_range, 0.0, 1.0); + float lod = diff * proj_lod; + vec4 plcol = getTexture2DLodDiffuse(projected_uv.xy, lod); // NOTE: Using diffuse due to texture2DLodSpecular() has extra: d *= min(1, d * (proj_lod - lod)); + + return color.rgb * plcol.rgb * plcol.a; +} + vec4 getPosition(vec2 pos_screen) { float depth = getDepth(pos_screen); @@ -174,7 +290,7 @@ vec2 getGGX( vec2 brdfPoint ) float getLightAttenuationPointSpot(float range, float distance) { #if 1 - return range; + return distance; #else float range2 = pow(range, 2.0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl index 5072f16988..e6f2c9d02b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl @@ -25,6 +25,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 // Output Diffuse=0.75, Emissive=0, ORM=0,0,0 + #define DEBUG_BASIC 0 #define DEBUG_VERTEX 0 #define DEBUG_NORMAL_MAP 0 // Output packed normal map "as is" to diffuse @@ -120,7 +122,11 @@ void main() emissive *= texture2D(emissiveMap, vary_texcoord0.xy).rgb; #endif - +#if DEBUG_PBR_LIGHT_TYPE + col.rgb = vec3(0.75); + emissive = vec3(0); + spec.rgb = vec3(0); +#endif #if DEBUG_BASIC col.rgb = vec3( 1, 0, 1 ); #endif diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index 513b748f5f..699a9c0276 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -27,6 +27,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -95,17 +97,24 @@ void main() for (int light_idx = 0; light_idx < LIGHT_COUNT; ++light_idx) { vec3 lightColor = light_col[ light_idx ].rgb; + float falloff = light_col[ light_idx ].a; float lightSize = light [ light_idx ].w; vec3 lv =(light [ light_idx ].xyz - pos); calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); if (nl > 0.0 || nv > 0.0) { - vec3 intensity = getLightIntensityPoint(lightColor, lightSize, lightDist); + float dist = lightDist / lightSize; + float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); + vec3 intensity = dist_atten * getLightIntensityPoint(lightColor, lightSize, lightDist); colorDiffuse += intensity * nl * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh); colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); } } + + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0,0.5,0); colorSpec = vec3(0); + #endif final_color = colorDiffuse + colorSpec; } else diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index b86402b031..20309d9673 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -28,6 +28,16 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 // Ouput gray if PBR multiSpot lights object +#define DEBUG_PBR_SPOT 0 +#define DEBUG_PBR_SPOT_DIFFUSE 0 // PBR diffuse lit +#define DEBUG_PBR_SPOT_SPECULAR 0 // PBR spec lit + +#define DEBUG_SPOT_DIFFUSE 0 +#define DEBUG_SPOT_NL 0 // monochome area effected by light +#define DEBUG_SPOT_SPEC_POS 0 +#define DEBUG_SPOT_REFLECTION 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -42,7 +52,7 @@ uniform sampler2DRect emissiveRect; // PBR linear packed Occlusion, Roughness, M uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D projectionMap; +uniform sampler2D projectionMap; // rgba uniform sampler2D lightFunc; uniform mat4 proj_mat; //screen space to light space @@ -76,48 +86,15 @@ uniform mat4 inv_proj; vec3 BRDFLambertian( vec3 reflect0, vec3 reflect90, vec3 c_diff, float specWeight, float vh ); vec3 BRDFSpecularGGX( vec3 reflect0, vec3 reflect90, float alphaRoughness, float specWeight, float vh, float nl, float nv, float nh ); void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); +bool clipProjectedLightVars(vec3 center, vec3 pos, out float dist, out float l_dist, out vec3 lv, out vec4 proj_tc ); vec3 getLightIntensitySpot(vec3 lightColor, float lightRange, float lightDistance, vec3 v); vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity); +vec3 getProjectedLightDiffuseColor(float light_distance, vec2 projected_uv ); +vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n); vec2 getScreenXY(vec4 clip); void initMaterial( vec3 diffuse, vec3 packedORM, out float alphaRough, out vec3 c_diff, out vec3 reflect0, out vec3 reflect90, out float specWeight ); vec3 srgb_to_linear(vec3 cs); - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - d *= min(1, d * (proj_lod - lod)); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} +vec4 texture2DLodSpecular(vec2 tc, float lod); vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) { @@ -144,14 +121,13 @@ void main() vec2 tc = getScreenXY(vary_fragcoord); vec3 pos = getPosition(tc).xyz; - vec3 lv = center.xyz-pos.xyz; - float dist = length(lv); - - if (dist >= size) + vec3 lv; + vec4 proj_tc; + float dist, l_dist; + if (clipProjectedLightVars(center, pos, dist, l_dist, lv, proj_tc)) { discard; } - dist /= size; float shadow = 1.0; @@ -167,24 +143,7 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z < 0.0) - { - discard; - } - - proj_tc.xyz /= proj_tc.w; - - float fa = falloff+1.0; - float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); - dist_atten *= dist_atten; - dist_atten *= 2.0; - if (dist_atten <= 0.0) - { - discard; - } + float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); lv = proj_origin-pos.xyz; vec3 h, l, v = -normalize(pos); @@ -194,6 +153,7 @@ void main() vec3 diffuse = texture2DRect(diffuseRect, tc).rgb; vec4 spec = texture2DRect(specularRect, tc); vec3 dlit = vec3(0, 0, 0); + vec3 slit = vec3(0, 0, 0); if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { @@ -201,11 +161,68 @@ void main() vec3 colorSpec = vec3(0); vec3 colorEmissive = spec.rgb; // PBR sRGB Emissive. See: pbropaqueF.glsl vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl + float metal = packedORM.b; + +// if (proj_tc.x > 0.0 && proj_tc.x < 1.0 +// && proj_tc.y > 0.0 && proj_tc.y < 1.0) + if (nl > 0.0) + { + vec3 c_diff, reflect0, reflect90; + float alphaRough, specWeight; + initMaterial( diffuse, packedORM, alphaRough, c_diff, reflect0, reflect90, specWeight ); + + dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); + slit = getProjectedLightSpecularColor( pos, n ); + +// vec3 intensity = getLightIntensitySpot( color, size, lightDist, v ); + colorDiffuse = shadow * dlit * nl * dist_atten; + colorSpec = shadow * slit * nl * dist_atten; + +// colorDiffuse *= BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ); +// colorSpec *= BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ); + + #if DEBUG_PBR_SPOT_DIFFUSE + colorDiffuse = dlit.rgb; colorSpec = vec3(0); + #endif + #if DEBUG_PBR_SPOT_SPECULAR + colorDiffuse = vec3(0); colorSpec = slit.rgb; + #endif + #if DEBUG_PBR_SPOT + colorDiffuse = dlit; colorSpec = vec3(0); + colorDiffuse *= nl; + colorDiffuse *= shadow; + #endif + + #if DEBUG_SPOT_SPEC_POS + colorDiffuse = pos + ref * dot(pdelta, proj_n)/ds; colorSpec = vec3(0); + #endif + #if DEBUG_SPOT_REFLECTION + colorDiffuse = ref; colorSpec = vec3(0); + #endif + + } + + #if DEBUG_SPOT_DIFFUSE + colorDiffuse = vec3(nl * dist_atten); + #endif + #if DEBUG_SPOT_NL + colorDiffuse = vec3(nl); colorSpec = vec3(0); + #endif + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0.5); colorSpec = vec3(0); + #endif final_color = colorDiffuse + colorSpec; } else { + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) + { + discard; + } + float noise = texture2D(noiseMap, tc/128.0).b; if (proj_tc.z > 0.0 && proj_tc.x < 1.0 && @@ -220,13 +237,8 @@ void main() { lit = nl * dist_atten * noise; - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - dlit = color.rgb * plcol.rgb * plcol.a; - + dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); + final_color = dlit*lit*diffuse*shadow; // unshadowed for consistency between forward and deferred? @@ -244,7 +256,6 @@ void main() final_color += amb_da*color.rgb*diffuse.rgb*amb_plcol.rgb*amb_plcol.a; } - if (spec.a > 0.0) { dlit *= min(nl*6.0, 1.0) * dist_atten; @@ -286,11 +297,25 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - final_color += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; + final_color += color.rgb * texture2DLodSpecular(stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } + #if DEBUG_SPOT_SPEC_POS + final_color = pos + ref * dot(pdelta, proj_n)/ds; + #endif + #if DEBUG_SPOT_REFLECTION + final_color = ref; + #endif } + +#if DEBUG_SPOT_NL + final_color =vec3(nl); +#endif +#if DEBUG_SPOT_DIFFUSE + final_color = vec3(nl * dist_atten * noise); +#endif + } //not sure why, but this line prevents MATBUG-194 diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index 8886abb7d1..defd577266 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl @@ -27,6 +27,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -86,6 +88,9 @@ void main() float nh, nl, nv, vh, lightDist; calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); + float dist = lightDist / size; + float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); + if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { vec3 colorDiffuse = vec3(0); @@ -99,11 +104,15 @@ void main() if (nl > 0.0 || nv > 0.0) { - vec3 intensity = getLightIntensityPoint(color, size, lightDist); + vec3 intensity = dist_atten * getLightIntensityPoint(color, size, lightDist); colorDiffuse += intensity * nl * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh); colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); } +#if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0,0,0.5); colorSpec = vec3(0); +#endif + final_color = colorDiffuse + colorSpec; } else @@ -120,8 +129,6 @@ void main() discard; } - float fa = falloff+1.0; - float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); dist_atten *= dist_atten; dist_atten *= 2.0; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 59076d9760..c2a3e472d0 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -27,6 +27,7 @@ #define PBR_USE_GGX_EMS_HACK 0 #define PBR_USE_IRRADIANCE_HACK 1 +#define DEBUG_PBR_LIGHT_TYPE 0 // Output no global light to make it easier to see pointLight and spotLight #define DEBUG_PBR_PACKORM0 0 // Rough=0, Metal=0 #define DEBUG_PBR_PACKORM1 0 // Rough=1, Metal=1 #define DEBUG_PBR_TANGENT1 1 // Tangent = 1,0,0 @@ -54,6 +55,8 @@ #define DEBUG_PBR_DOT_NV 0 // Output: grayscale dot(Normal ,Vertex2Camera) #define DEBUG_PBR_BRDF_UV 0 // Output: red green BRDF UV (GGX input) #define DEBUG_PBR_BRDF_SCALE_BIAS 0 // Output: red green BRDF Scale Bias (GGX output) +#define DEBUG_PBR_BRDF_SCALE_ONLY 0 // Output: grayscale BRDF Scale +#define DEBUG_PBR_BRDF_BIAS_ONLY 0 // Output: grayscale BRDER Bias #define DEBUG_PBR_FRESNEL 0 // Output: roughness dependent fresnel #define DEBUG_PBR_KSPEC 0 // Output: K spec #define DEBUG_PBR_REFLECTION_DIR 0 // Output: reflection dir @@ -66,7 +69,7 @@ #define DEBUG_PBR_IRRADIANCE_RAW 0 // Output: Diffuse Irradiance pre-mix #define DEBUG_PBR_IRRADIANCE 0 // Output: Diffuse Irradiance #define DEBUG_PBR_FSS_ESS_LAMBERT 0 // Output: FssEssLambert -#define DEBUG_PBR_EMS 0 // Output: Ems +#define DEBUG_PBR_EMS 0 // Output: Ems = (1 - BRDF Scale + BRDF Bias) #define DEBUG_PBR_AVG 0 // Output: Avg #define DEBUG_PBR_FMS_EMS 0 // Output: FmsEms #define DEBUG_PBR_DIFFUSE_K 0 // Output: diffuse FssEssLambert + FmsEms @@ -178,8 +181,7 @@ void main() da = pow(da, light_gamma); vec4 diffuse = texture2DRect(diffuseRect, tc); - vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - + vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); // NOTE: PBR sRGB Emissive #if defined(HAS_SUN_SHADOW) || defined(HAS_SSAO) vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; @@ -306,10 +308,7 @@ void main() // Reference: getIBLRadianceLambertian vec3 FssEssLambert = specWeight * kSpec * vScaleBias.x + vScaleBias.y; // NOTE: Very similar to FssEssRadiance but with extra specWeight term - float Ems = (1.0 - vScaleBias.x + vScaleBias.y); -#if PBR_USE_GGX_EMS_HACK - Ems = alphaRough; // With GGX approximation Ems = 0 so use substitute -#endif + float Ems = 1.0 - (vScaleBias.x + vScaleBias.y); vec3 avg = specWeight * (reflect0 + (1.0 - reflect0) / 21.0); vec3 AvgEms = avg * Ems; vec3 FmsEms = AvgEms * FssEssLambert / (1.0 - AvgEms); @@ -390,6 +389,12 @@ void main() #if DEBUG_PBR_DIFFUSE_C color.rgb = c_diff; #endif + #if DEBUG_PBR_BRDF_SCALE_ONLY + color.rgb = vec3(vScaleBias.x); + #endif + #if DEBUG_PBR_BRDF_BIAS_ONLY + color.rgb = vec3(vScaleBias.y); + #endif #if DEBUG_PBR_DIFFUSE_K color.rgb = kDiffuse; #endif @@ -477,6 +482,9 @@ void main() #endif #if DEBUG_PBR_SUN_CONTRIB color.rgb = sun_contrib; + #endif + #if DEBUG_PBR_LIGHT_TYPE + color.rgb = vec3(0); #endif frag_color.rgb = color.rgb; // PBR is done in linear } diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 680fcbfab3..a82581d1a1 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -28,6 +28,12 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 +#define DEBUG_PBR_SPOT 0 +#define DEBUG_PBR_NL 0 // monochome area effected by light +#define DEBUG_PBR_SPOT_DIFFUSE 0 +#define DEBUG_PBR_SPOT_SPECULAR 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -42,7 +48,7 @@ uniform sampler2DRect emissiveRect; // PBR linear packed Occlusion, Roughness, M uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D projectionMap; +uniform sampler2D projectionMap; // rgba uniform sampler2D lightFunc; uniform mat4 proj_mat; //screen space to light space @@ -75,40 +81,15 @@ uniform mat4 inv_proj; vec3 BRDFLambertian( vec3 reflect0, vec3 reflect90, vec3 c_diff, float specWeight, float vh ); vec3 BRDFSpecularGGX( vec3 reflect0, vec3 reflect90, float alphaRoughness, float specWeight, float vh, float nl, float nv, float nh ); void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); +bool clipProjectedLightVars(vec3 center, vec3 pos, out float dist, out float l_dist, out vec3 lv, out vec4 proj_tc ); vec3 getLightIntensitySpot(vec3 lightColor, float lightRange, float lightDistance, vec3 v); vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity); +vec3 getProjectedLightDiffuseColor(float light_distance, vec2 projected_uv ); +vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n); vec2 getScreenXY(vec4 clip_point); void initMaterial( vec3 diffuse, vec3 packedORM, out float alphaRough, out vec3 c_diff, out vec3 reflect0, out vec3 reflect90, out float specWeight ); vec3 srgb_to_linear(vec3 c); - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = min(lod/(proj_lod*0.5), 1.0); - float d = min(dist.x, dist.y); - d *= min(1, d * (proj_lod - lod)); - float edge = 0.25*det; - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = min(lod/(proj_lod*0.5), 1.0); - float d = min(dist.x, dist.y); - float edge = 0.25*det; - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} +vec4 texture2DLodSpecular(vec2 tc, float lod); vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) { @@ -133,13 +114,13 @@ void main() vec2 tc = getScreenXY(vary_fragcoord); vec3 pos = getPosition(tc).xyz; - vec3 lv = trans_center.xyz-pos.xyz; - float dist = length(lv); - if (dist >= size) + vec3 lv; + vec4 proj_tc; + float dist, l_dist; + if (clipProjectedLightVars(trans_center, pos, dist, l_dist, lv, proj_tc)) { discard; } - dist /= size; float shadow = 1.0; @@ -155,27 +136,9 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() - float l_dist = -dot(lv, proj_n); + float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z < 0.0) - { - discard; - } - - proj_tc.xyz /= proj_tc.w; - - float fa = falloff+1.0; - float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); - dist_atten *= dist_atten; - dist_atten *= 2.0; - - if (dist_atten <= 0.0) - { - discard; - } - - lv = proj_origin-pos.xyz; + lv = proj_origin-pos.xyz; // NOTE: Re-using lv vec3 h, l, v = -normalize(pos); float nh, nl, nv, vh, lightDist; calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); @@ -183,6 +146,7 @@ void main() vec3 diffuse = texture2DRect(diffuseRect, tc).rgb; vec4 spec = texture2DRect(specularRect, tc); vec3 dlit = vec3(0, 0, 0); + vec3 slit = vec3(0, 0, 0); if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { @@ -190,11 +154,65 @@ void main() vec3 colorSpec = vec3(0); vec3 colorEmissive = spec.rgb; // PBR sRGB Emissive. See: pbropaqueF.glsl vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl + float metal = packedORM.b; + +// if (proj_tc.x > 0.0 && proj_tc.x < 1.0 +// && proj_tc.y > 0.0 && proj_tc.y < 1.0) + if (nl > 0.0) + { + vec3 c_diff, reflect0, reflect90; + float alphaRough, specWeight; + initMaterial( diffuse, packedORM, alphaRough, c_diff, reflect0, reflect90, specWeight ); + + dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); + slit = getProjectedLightSpecularColor( pos, n ); + +// vec3 intensity = getLightIntensitySpot( color, size, lightDist, v ); +// colorDiffuse = shadow * dlit * nl; +// colorSpec = shadow * slit * nl; + +// colorDiffuse *= BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ); +// colorSpec *= BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ); + + colorDiffuse = shadow * dlit * nl * dist_atten; + colorSpec = shadow * slit * nl * dist_atten; + + #if DEBUG_PBR_SPOT_DIFFUSE + colorDiffuse = dlit.rgb; colorSpec = vec3(0); + #endif + #if DEBUG_PBR_SPOT_SPECULAR + colorDiffuse = vec3(0); colorSpec = slit.rgb; + #endif + #if DEBUG_PBR_SPOT + colorDiffuse = dlit; colorSpec = vec3(0); + colorDiffuse *= nl; + colorDiffuse *= shadow; + #endif + + } + + #if DEBUG_SPOT_DIFFUSE + colorDiffuse = vec3(nl * dist_atten); + #endif + #if DEBUG_PBR_NL + colorDiffuse = vec3(nl); colorSpec = vec3(0); + #endif + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0.5,0,0); colorSpec = vec3(0.0); + #endif final_color = colorDiffuse + colorSpec; } else { + dist_atten *= dist_atten; + dist_atten *= 2.0; + + if (dist_atten <= 0.0) + { + discard; + } + float noise = texture2D(noiseMap, tc/128.0).b; if (proj_tc.z > 0.0 && proj_tc.x < 1.0 && @@ -209,12 +227,7 @@ void main() { lit = nl * dist_atten * noise; - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - dlit = color.rgb * plcol.rgb * plcol.a; + dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); final_color = dlit*lit*diffuse*shadow; @@ -271,7 +284,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - final_color += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; + final_color += color.rgb * texture2DLodSpecular(stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 310c0af25d..6f46f0258a 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 34 +version 35 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -28,7 +28,7 @@ version 34 // list all RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 +RenderAvatarCloth 0 0 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -43,7 +43,6 @@ RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 @@ -62,6 +61,7 @@ Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 +RenderPBR 1 1 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 @@ -78,7 +78,6 @@ RenderGLMultiThreaded 1 1 // list Low RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -88,15 +87,13 @@ RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 RenderLocalLights 1 0 RenderMaxPartCount 1 256 -RenderObjectBump 1 0 RenderReflectionDetail 1 0 RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.5 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -108,7 +105,6 @@ RenderFSAASamples 1 0 // list LowMid RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 @@ -116,7 +112,6 @@ RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 RenderMaxPartCount 1 2048 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -124,8 +119,7 @@ RenderTerrainLODFactor 1 1.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -137,7 +131,6 @@ RenderFSAASamples 1 0 // list Mid RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -145,7 +138,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -153,8 +145,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -166,7 +156,6 @@ RenderFSAASamples 1 2 // list MidHigh RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -174,7 +163,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -182,8 +170,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -195,7 +181,6 @@ RenderFSAASamples 1 2 // list High RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -203,7 +188,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -211,8 +195,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -224,7 +206,6 @@ RenderFSAASamples 1 2 // list HighUltra RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 350000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -232,7 +213,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -240,8 +220,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -253,7 +231,6 @@ RenderFSAASamples 1 2 // list Ultra RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderFarClip 1 256 @@ -261,7 +238,6 @@ RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderLocalLights 1 1 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 @@ -270,7 +246,6 @@ RenderTreeLODFactor 1 1.0 RenderVolumeLODFactor 1 3.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 @@ -281,8 +256,8 @@ RenderFSAASamples 1 2 // list Unknown RenderShadowDetail 1 0 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 +RenderPBR 1 0 RenderUseAdvancedAtmospherics 1 0 // @@ -296,18 +271,15 @@ RenderCompressTextures 1 0 // list safe RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 -RenderObjectBump 0 0 RenderLocalLights 1 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 +RenderPBR 1 0 list Intel RenderAnisotropic 1 0 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index fb16e7005d..c708cf8dff 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,10 +1,10 @@ -version 29 +version 30 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended // defaults. This should be as rare an event as we can manage. -// NOTE: This is mostly identical to featuretable_mac.txt with a few differences +// NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table // @@ -28,7 +28,7 @@ version 29 // list all RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 +RenderAvatarCloth 0 0 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -43,7 +43,6 @@ RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 @@ -62,6 +61,7 @@ Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 +RenderPBR 1 1 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 @@ -69,7 +69,7 @@ RenderShadowDetail 1 2 RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 RenderMaxTextureIndex 1 16 -RenderGLContextCoreProfile 1 1 +RenderGLContextCoreProfile 1 1 RenderGLMultiThreaded 1 1 @@ -78,7 +78,6 @@ RenderGLMultiThreaded 1 1 // list Low RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -88,15 +87,13 @@ RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 RenderLocalLights 1 0 RenderMaxPartCount 1 256 -RenderObjectBump 1 0 RenderReflectionDetail 1 0 RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.5 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -108,7 +105,6 @@ RenderFSAASamples 1 0 // list LowMid RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 @@ -116,7 +112,6 @@ RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 RenderMaxPartCount 1 2048 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -124,8 +119,7 @@ RenderTerrainLODFactor 1 1.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -137,7 +131,6 @@ RenderFSAASamples 1 0 // list Mid RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -145,7 +138,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -153,8 +145,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -166,7 +156,6 @@ RenderFSAASamples 1 2 // list MidHigh RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -174,7 +163,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -182,8 +170,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -195,7 +181,6 @@ RenderFSAASamples 1 2 // list High RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -203,7 +188,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -211,8 +195,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -224,7 +206,6 @@ RenderFSAASamples 1 2 // list HighUltra RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 350000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -232,7 +213,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -240,8 +220,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -253,7 +231,6 @@ RenderFSAASamples 1 2 // list Ultra RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderFarClip 1 256 @@ -261,7 +238,6 @@ RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderLocalLights 1 1 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 @@ -270,7 +246,6 @@ RenderTreeLODFactor 1 1.0 RenderVolumeLODFactor 1 3.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 @@ -281,8 +256,8 @@ RenderFSAASamples 1 2 // list Unknown RenderShadowDetail 1 0 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 +RenderPBR 1 0 RenderUseAdvancedAtmospherics 1 0 // @@ -296,18 +271,15 @@ RenderCompressTextures 1 0 // list safe RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 -RenderObjectBump 0 0 RenderLocalLights 1 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 +RenderPBR 1 0 list Intel RenderAnisotropic 1 0 @@ -315,12 +287,12 @@ RenderAnisotropic 1 0 RenderCubeMap 0 0 RenderFSAASamples 1 0 RenderGLMultiThreaded 1 0 -RenderGLContextCoreProfile 1 0 +RenderGLContextCoreProfile 1 0 // AMD cards generally perform better when not using VBOs for streaming data // AMD cards also prefer an OpenGL Compatibility Profile Context list AMD RenderUseStreamVBO 1 0 -RenderGLContextCoreProfile 1 0 +RenderGLContextCoreProfile 1 0 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index bffbbec13b..f34e168542 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 38 +version 39 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -28,7 +28,7 @@ version 38 // list all RenderAnisotropic 1 0 -RenderAvatarCloth 1 1 +RenderAvatarCloth 0 0 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -63,6 +63,7 @@ RenderTextureMemoryMultiple 1 1.0 RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 +RenderPBR 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 @@ -77,7 +78,6 @@ RenderGLMultiThreaded 1 0 // list Low RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -87,15 +87,13 @@ RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 RenderLocalLights 1 0 RenderMaxPartCount 1 256 -RenderObjectBump 1 0 RenderReflectionDetail 1 0 RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.5 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -107,7 +105,6 @@ RenderFSAASamples 1 0 // list LowMid RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 @@ -115,7 +112,6 @@ RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 RenderMaxPartCount 1 2048 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -123,8 +119,7 @@ RenderTerrainLODFactor 1 1.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.5 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -136,7 +131,6 @@ RenderFSAASamples 1 0 // list Mid RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -144,7 +138,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -152,8 +145,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.5 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -165,7 +156,6 @@ RenderFSAASamples 1 2 // list MidHigh RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -173,7 +163,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -181,8 +170,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -194,7 +181,6 @@ RenderFSAASamples 1 2 // list High RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -202,7 +188,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -210,8 +195,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 @@ -223,7 +206,6 @@ RenderFSAASamples 1 2 // list HighUltra RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 350000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -231,7 +213,6 @@ RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 @@ -239,8 +220,6 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 2.0 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 0 RenderUseAdvancedAtmospherics 1 0 @@ -252,7 +231,6 @@ RenderFSAASamples 1 2 // list Ultra RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderFarClip 1 256 @@ -260,7 +238,6 @@ RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderLocalLights 1 1 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 @@ -269,7 +246,6 @@ RenderTreeLODFactor 1 1.0 RenderVolumeLODFactor 1 3.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 @@ -280,7 +256,7 @@ RenderFSAASamples 1 2 // list Unknown RenderShadowDetail 1 0 -RenderDeferred 1 0 +RenderPBR 1 0 RenderDeferredSSAO 1 0 RenderUseAdvancedAtmospherics 1 0 @@ -296,16 +272,13 @@ RenderCompressTextures 1 0 // list safe RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 -RenderObjectBump 0 0 RenderLocalLights 1 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 +RenderPBR 1 0 RenderDeferredSSAO 0 0 RenderUseAdvancedAtmospherics 0 0 RenderShadowDetail 0 0 diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9ad8254421..ae62700526 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2087,32 +2087,8 @@ void LLFloaterPreference::onUpdatePopupFilter() void LLFloaterPreference::refreshEnabledState() { // Improved graphics preferences - //LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - //LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_pbr = getChild("UsePBRShaders"); - //// if vertex shaders off, disable all shader related products - //if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) - //{ - // ctrl_wind_light->setEnabled(FALSE); - // ctrl_wind_light->setValue(FALSE); - //} - //else - //{ - // ctrl_wind_light->setEnabled(TRUE); - //} - - ////Deferred/SSAO/Shadows - //BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); - //BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); - //BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - // bumpshiny && - // shaders && - // gGLManager.mHasFramebufferObject && - // (ctrl_wind_light->get()) ? TRUE : FALSE; - - //ctrl_deferred->setEnabled(enabled); - F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); @@ -2147,99 +2123,41 @@ void LLFloaterPreference::refreshEnabledState() getChildView("texture compression")->setEnabled(FALSE); } - // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - LLSpinCtrl* gamma_ctrl = getChild("gamma"); - gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - // anti-aliasing - { - LLUICtrl* fsaa_ctrl = getChild("fsaa"); - - // Enable or disable the control, the "Antialiasing:" label and the restart warning - // based on code support for the feature on the current hardware. + LLUICtrl* fsaa_ctrl = getChild("fsaa"); - if (gPipeline.canUseAntiAliasing()) - { - fsaa_ctrl->setEnabled(TRUE); - } - else - { - fsaa_ctrl->setEnabled(FALSE); - fsaa_ctrl->setValue((LLSD::Integer) 0); - } + // Enable or disable the control, the "Antialiasing:" label and the restart warning + // based on code support for the feature on the current hardware. + + if (gPipeline.canUseAntiAliasing()) + { + fsaa_ctrl->setEnabled(TRUE); + } + else + { + fsaa_ctrl->setEnabled(FALSE); + fsaa_ctrl->setValue((LLSD::Integer) 0); } LLComboBox* ctrl_reflections = getChild("Reflections"); -// [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9) - if (RlvActions::isRlvEnabled()) - { - getChild("do_not_disturb_response")->setEnabled(!RlvActions::hasBehaviour(RLV_BHVR_SENDIM)); - } -// [/RLVa:KB] - // Reflections BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; ctrl_reflections->setEnabled(reflections); - - // Bump & Shiny - LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); - bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); - bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - - // Does not exist - //LLCheckBoxCtrl* ctrl_enhanced_skel = getChild("AvatarEnhancedSkeleton"); - //bool enhanced_skel_enabled = gSavedSettings.getBOOL("IncludeEnhancedSkeleton"); - //ctrl_enhanced_skel->setValue(enhanced_skel_enabled); - // - // Avatar Mode - // Avatar Render Mode - getChild("AvatarCloth")->setEnabled(TRUE); - - /* remove orphaned code left over from EEP - // Vertex Shaders, Global Shader Enable - LLRadioGroup* terrain_detail = getChild("TerrainDetailRadio"); // can be linked with control var - - terrain_detail->setEnabled(FALSE); - */ - // WindLight - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); - -// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a - // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n - ctrl_wind_light->setEnabled( ((RlvActions::canChangeEnvironment()) && (!RlvActions::hasBehaviour(RLV_BHVR_SETSPHERE))) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); -// [/RLVa:KB] -// ctrl_wind_light->setEnabled(TRUE); - sky->setEnabled(TRUE); - //Deferred/SSAO/Shadows - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && - gGLManager.mHasFramebufferObject && - (ctrl_wind_light->get()) ? TRUE : FALSE; - - ctrl_deferred->setEnabled(enabled); - //PBR BOOL deferred = gSavedSettings.getBOOL("RenderDeferred"); - // TODO: add "RenderPBR" to LLFeatureManager - ctrl_pbr->setEnabled(deferred); + ctrl_pbr->setEnabled(deferred && LLFeatureManager::getInstance()->isFeatureAvailable("RenderPBR")); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); LLComboBox* ctrl_shadow = getChild("ShadowDetail"); - // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); - - ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO"); ctrl_ssao->setEnabled(enabled); ctrl_dof->setEnabled(enabled); @@ -2256,6 +2174,13 @@ void LLFloaterPreference::refreshEnabledState() getChild("fs_default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true); getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); + + // [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9) + if (RlvActions::isRlvEnabled()) + { + getChild("do_not_disturb_response")->setEnabled(!RlvActions::hasBehaviour(RLV_BHVR_SENDIM)); + } + // [/RLVa:KB] } // Dynamic texture memory calculation @@ -2335,9 +2260,10 @@ void LLAvatarComplexityControls::setIndirectMaxArc() void LLFloaterPreference::disableUnavailableSettings() { LLComboBox* ctrl_reflections = getChild("Reflections"); - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + // Doesn't exist anymore + //LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); + //LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + //LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -2346,8 +2272,9 @@ void LLFloaterPreference::disableUnavailableSettings() // disabled windlight if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) { - ctrl_wind_light->setEnabled(FALSE); - ctrl_wind_light->setValue(FALSE); + // Doesn't exist anymore + //ctrl_wind_light->setEnabled(FALSE); + //ctrl_wind_light->setValue(FALSE); sky->setEnabled(FALSE); @@ -2361,8 +2288,9 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_dof->setEnabled(FALSE); ctrl_dof->setValue(FALSE); - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); + // Doesn't exist anymore + //ctrl_deferred->setEnabled(FALSE); + //ctrl_deferred->setValue(FALSE); } // disabled deferred @@ -2378,8 +2306,9 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_dof->setEnabled(FALSE); ctrl_dof->setValue(FALSE); - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); + // Doesn't exist anymore + //ctrl_deferred->setEnabled(FALSE); + //ctrl_deferred->setValue(FALSE); } // disabled deferred SSAO @@ -2402,13 +2331,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); } - - // disabled cloth - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) - { - ctrl_avatar_cloth->setEnabled(FALSE); - ctrl_avatar_cloth->setValue(FALSE); - } } void LLFloaterPreference::refresh() diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 47ae2ab4d1..57cd74e0f2 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1343,18 +1343,26 @@ void LLMaterialEditor::importMaterial() void LLMaterialEditor::applyToSelection() { - // Todo: associate with a specific 'selection' instead - // of modifying something that is selected - // This should be disabled when working from agent's - // inventory and for initial upload + // Todo: fix this, this is a hack, not a proper live preview LLViewerObject* objectp = LLSelectMgr::instance().getSelection()->getFirstObject(); - if (objectp && objectp->getVolume()) + if (objectp && objectp->getVolume() && objectp->permModify()) { LLGLTFMaterial* mat = new LLGLTFMaterial(); getGLTFMaterial(mat); LLVOVolume* vobjp = (LLVOVolume*)objectp; for (int i = 0; i < vobjp->getNumTEs(); ++i) { + // this is here just to prevent material from immediately resetting + if (mAssetID.notNull()) + { + vobjp->setRenderMaterialID(i, mAssetID); + } + else + { + const LLUUID placeholder("984e183e-7811-4b05-a502-d79c6f978a98"); + vobjp->setRenderMaterialID(i, placeholder); + } + vobjp->getTE(i)->setGLTFMaterial(mat); vobjp->updateTEMaterialTextures(i); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index dd620723c0..b79fd272c6 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -1166,7 +1166,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2)); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b3bbaeb886..5ba62e6f8b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -937,7 +937,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) gCubeSnapshot = TRUE; mRT = &mAuxillaryRT; U32 res = LL_REFLECTION_PROBE_RESOLUTION * 2; - allocateScreenBuffer(res, res, 0); + allocateScreenBuffer(res, res, samples); mRT = &mMainRT; gCubeSnapshot = FALSE; } diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index 723610abb9..825f8df43e 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -592,8 +592,6 @@ BOOL FloaterQuickPrefs::postBuild() // Phototools additions if (getIsPhototools()) { - mCtrlWindLight = getChild("WindLightUseAtmosShaders"); - mCtrlDeferred = getChild("RenderDeferred"); mCtrlUseSSAO = getChild("UseSSAO"); mCtrlUseDoF = getChild("UseDepthofField"); mCtrlShadowDetail = getChild("ShadowDetail"); @@ -1049,8 +1047,6 @@ void FloaterQuickPrefs::refreshSettings() BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; mCtrlReflectionDetail->setEnabled(reflections); - mCtrlWindLight->setEnabled((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV) && !gRlvHandler.hasBehaviour(RLV_BHVR_SETSPHERE)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ); - LLTextBox* sky_label = getChild("T_Sky_Detail"); LLSlider* sky_slider = getChild("SB_Sky_Detail"); LLSpinCtrl* sky_spinner = getChild("S_Sky_Detail"); @@ -1061,17 +1057,7 @@ void FloaterQuickPrefs::refreshSettings() sky_spinner->setEnabled(TRUE); sky_default_button->setEnabled(TRUE); - BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); - BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - bumpshiny && - shaders && - gGLManager.mHasFramebufferObject && - (mCtrlWindLight->get()) ? TRUE : FALSE; - - mCtrlDeferred->setEnabled(enabled); - - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (mCtrlDeferred->get() ? TRUE : FALSE); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO"); mCtrlUseSSAO->setEnabled(enabled); mCtrlUseDoF->setEnabled(enabled); @@ -1083,15 +1069,11 @@ void FloaterQuickPrefs::refreshSettings() // disabled windlight if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) { - mCtrlWindLight->setEnabled(FALSE); - mCtrlWindLight->setValue(FALSE); - sky_label->setEnabled(FALSE); sky_slider->setEnabled(FALSE); sky_spinner->setEnabled(FALSE); sky_default_button->setEnabled(FALSE); - //deferred needs windlight, disable deferred mCtrlShadowDetail->setEnabled(FALSE); mCtrlShadowDetail->setValue(0); @@ -1100,9 +1082,6 @@ void FloaterQuickPrefs::refreshSettings() mCtrlUseDoF->setEnabled(FALSE); mCtrlUseDoF->setValue(FALSE); - - mCtrlDeferred->setEnabled(FALSE); - mCtrlDeferred->setValue(FALSE); } // disabled deferred @@ -1117,9 +1096,6 @@ void FloaterQuickPrefs::refreshSettings() mCtrlUseDoF->setEnabled(FALSE); mCtrlUseDoF->setValue(FALSE); - - mCtrlDeferred->setEnabled(FALSE); - mCtrlDeferred->setValue(FALSE); } // disabled deferred SSAO diff --git a/indra/newview/quickprefs.h b/indra/newview/quickprefs.h index e55338b450..2fc9674b55 100644 --- a/indra/newview/quickprefs.h +++ b/indra/newview/quickprefs.h @@ -119,8 +119,6 @@ private: LLComboBox* mDayCyclePresetsCombo; // Phototools additions - LLCheckBoxCtrl* mCtrlWindLight; - LLCheckBoxCtrl* mCtrlDeferred; LLCheckBoxCtrl* mCtrlUseSSAO; LLCheckBoxCtrl* mCtrlUseDoF; LLComboBox* mCtrlShadowDetail; diff --git a/indra/newview/skins/default/xui/en/floater_material_editor.xml b/indra/newview/skins/default/xui/en/floater_material_editor.xml index 7d532ecd7b..74adc86126 100644 --- a/indra/newview/skins/default/xui/en/floater_material_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_material_editor.xml @@ -245,7 +245,7 @@ layout="topleft" left_delta="0" top_pad="5" - max_val="100" + max_val="1" name="metalness factor" width="64" /> @@ -270,7 +270,8 @@ layout="topleft" left_delta="0" top_pad="5" - max_val="100" + + max_val="1" name="roughness factor" width="64" /> diff --git a/indra/newview/skins/default/xui/en/floater_phototools.xml b/indra/newview/skins/default/xui/en/floater_phototools.xml index b101bc2781..4277eb88f3 100644 --- a/indra/newview/skins/default/xui/en/floater_phototools.xml +++ b/indra/newview/skins/default/xui/en/floater_phototools.xml @@ -61,30 +61,6 @@ - - - - - - - - - - - - (0 = default brightness, lower = brighter) - - - - - - - - - Low - - - - Water Reflections: @@ -723,20 +617,6 @@ value="4"/> - - - - - - - - @@ -806,7 +672,7 @@ initial_value="true" label="Depth of Field" layout="topleft" - left="480" + left="420" name="UseDoF" top_delta="16" width="240"> @@ -814,29 +680,13 @@ function="Pref.RenderOptionUpdate" /> - -