diff --git a/worldeditor/bin/engine/materials/AreaLight.shader b/worldeditor/bin/engine/materials/AreaLight.shader index 7ab0d1845..5d5f2fb5e 100644 --- a/worldeditor/bin/engine/materials/AreaLight.shader +++ b/worldeditor/bin/engine/materials/AreaLight.shader @@ -123,10 +123,10 @@ void main (void) { proj.y = 1.0 - proj.y; #endif - vec4 slice0 = texture(normalsMap, proj); + vec4 normalsSlice = texture(normalsMap, proj); // Light model LIT - if(slice0.w > 0.0) { + if(normalsSlice.w > 0.0) { float depth = texture(depthMap, proj).x; vec3 world = getWorld(_screenToWorld, proj, depth); @@ -145,17 +145,17 @@ void main (void) { if(factor > 0.0) { // Material parameters - vec4 slice1 = texture(paramsMap, proj); - float rough = slice1.x; - float metal = slice1.z; - float spec = slice1.w; + vec4 paramsSlice = texture(paramsMap, proj); + float rough = paramsSlice.x; + float metal = paramsSlice.z; + float spec = paramsSlice.w; - vec4 slice2 = texture(diffuseMap, proj); - vec3 albedo = slice2.xyz; + vec4 diffuseSlice = texture(diffuseMap, proj); + vec3 albedo = diffuseSlice.xyz; // Vectors vec3 v = normalize(cameraPosition() - world); - vec3 n = normalize(slice0.xyz * 2.0 - 1.0); + vec3 n = normalize(normalsSlice.xyz * 2.0 - 1.0); vec3 r = -reflect(v, n); float cosTheta = clamp(dot(l, n), -0.999, 0.999); diff --git a/worldeditor/bin/engine/materials/DirectLight.shader b/worldeditor/bin/engine/materials/DirectLight.shader index 9e5aff0ca..442b87013 100644 --- a/worldeditor/bin/engine/materials/DirectLight.shader +++ b/worldeditor/bin/engine/materials/DirectLight.shader @@ -69,22 +69,22 @@ void main(void) { proj.y = 1.0 - proj.y; #endif - vec4 slice0 = texture(normalsMap, proj); + vec4 normalsSlice = texture(normalsMap, proj); // Light model LIT - if(slice0.w > 0.0) { + if(normalsSlice.w > 0.0) { float depth = texture(depthMap, proj).x; vec3 world = getWorld(_screenToWorld, proj, depth); - vec3 n = normalize(slice0.xyz * 2.0 - 1.0); + vec3 n = normalize(normalsSlice.xyz * 2.0 - 1.0); - vec4 params = texture(paramsMap, proj); - float rough = params.x; - float metal = params.z; - float spec = params.w; + vec4 paramsSlice = texture(paramsMap, proj); + float rough = paramsSlice.x; + float metal = paramsSlice.z; + float spec = paramsSlice.w; - vec4 slice2 = texture(diffuseMap, proj); - vec3 albedo = slice2.xyz; + vec4 diffuseSlice = texture(diffuseMap, proj); + vec3 albedo = diffuseSlice.xyz; vec3 v = normalize(cameraPosition() - world); vec3 h = normalize(direction.xyz + v); diff --git a/worldeditor/bin/engine/materials/PointLight.shader b/worldeditor/bin/engine/materials/PointLight.shader index 4b267c533..905d87eec 100644 --- a/worldeditor/bin/engine/materials/PointLight.shader +++ b/worldeditor/bin/engine/materials/PointLight.shader @@ -77,10 +77,10 @@ void main (void) { proj.y = 1.0 - proj.y; #endif - vec4 slice0 = texture(normalsMap, proj); + vec4 normalsSlice = texture(normalsMap, proj); // Light model LIT - if(slice0.w > 0.0) { + if(normalsSlice.w > 0.0) { float depth = texture(depthMap, proj).x; vec3 world = getWorld(_screenToWorld, proj, depth); @@ -98,17 +98,17 @@ void main (void) { } if(factor > 0.0) { // Material parameters - vec4 params = texture(paramsMap, proj); - float rough = params.x; - float metal = params.z; - float spec = params.w; + vec4 paramsSlice = texture(paramsMap, proj); + float rough = paramsSlice.x; + float metal = paramsSlice.z; + float spec = paramsSlice.w; - vec4 slice2 = texture(diffuseMap, proj); - vec3 albedo = slice2.xyz; + vec4 diffuseSlice = texture(diffuseMap, proj); + vec3 albedo = diffuseSlice.xyz; // Vectors vec3 v = normalize(cameraPosition() - world); - vec3 n = normalize(slice0.xyz * 2.0 - 1.0); + vec3 n = normalize(normalsSlice.xyz * 2.0 - 1.0); vec3 r = -reflect(v, n); float radius = params.y; diff --git a/worldeditor/bin/engine/materials/SpotLight.shader b/worldeditor/bin/engine/materials/SpotLight.shader index bcf1f353b..0f8c53ad6 100644 --- a/worldeditor/bin/engine/materials/SpotLight.shader +++ b/worldeditor/bin/engine/materials/SpotLight.shader @@ -67,14 +67,14 @@ void main (void) { // params = x - brightness, y - radius/width, z - length/height, w - cutoff - vec4 slice0 = texture(normalsMap, proj); + vec4 normalsSlice = texture(normalsMap, proj); // Light model LIT - if(slice0.w > 0.0) { + if(normalsSlice.w > 0.0) { float depth = texture(depthMap, proj).x; vec3 world = getWorld(_screenToWorld, proj, depth); - vec3 n = normalize(slice0.xyz * 2.0 - 1.0); + vec3 n = normalize(normalsSlice.xyz * 2.0 - 1.0); vec3 dir = position.xyz - world; vec3 l = normalize(dir); @@ -87,13 +87,13 @@ void main (void) { fall = getAttenuation(dist, params.y) * params.x * fall; } - vec4 slice1 = texture(paramsMap, proj); - float rough = slice1.x; - float metal = slice1.z; - float spec = slice1.w; + vec4 paramsSlice = texture(paramsMap, proj); + float rough = paramsSlice.x; + float metal = paramsSlice.z; + float spec = paramsSlice.w; - vec4 slice2 = texture(diffuseMap, proj); - vec3 albedo = slice2.xyz; + vec4 diffuseSlice = texture(diffuseMap, proj); + vec3 albedo = diffuseSlice.xyz; vec3 v = normalize(cameraPosition() - world); vec3 h = normalize(l + v);