diff --git a/Shaders/blur_bilat_blend_pass/blur_bilat_blend_pass.frag.glsl b/Shaders/blur_bilat_blend_pass/blur_bilat_blend_pass.frag.glsl index 2aedba70..21092144 100644 --- a/Shaders/blur_bilat_blend_pass/blur_bilat_blend_pass.frag.glsl +++ b/Shaders/blur_bilat_blend_pass/blur_bilat_blend_pass.frag.glsl @@ -39,8 +39,8 @@ void main() { sumfactor += factor; res += factor * col; - col = textureLod(tex, texCoord - s).r; - factor = normpdf3(col - colf, 1.0, 0.0) * fw; + col = textureLod(tex, texCoord - s, 0.0).r; + factor = normpdf3(col - colf, 1.0) * fw; sumfactor += factor; res += factor * col; } diff --git a/Shaders/volumetric_light_quad/volumetric_light_quad.frag.glsl b/Shaders/volumetric_light_quad/volumetric_light_quad.frag.glsl index 9e04ecf0..7a473cca 100644 --- a/Shaders/volumetric_light_quad/volumetric_light_quad.frag.glsl +++ b/Shaders/volumetric_light_quad/volumetric_light_quad.frag.glsl @@ -3,12 +3,9 @@ #include "compiled.inc" #include "std/gbuffer.glsl" -#include "std/shadows.glsl" uniform sampler2D gbufferD; -#ifndef _NoShadows -uniform sampler2D shadowMap; -#endif +uniform sampler2DShadow shadowMap; uniform sampler2D snoise; #ifdef _CSM @@ -17,14 +14,10 @@ uniform sampler2D snoise; uniform mat4 LWVP; #endif uniform float shadowsBias; -// uniform vec3 lightPos; uniform vec3 lightColor; uniform vec3 eye; uniform vec3 eyeLook; uniform vec2 cameraProj; -// uniform float lightRadius; -// uniform int lightShadow; -// uniform vec2 lightPlane; in vec2 texCoord; in vec3 viewRay; @@ -35,20 +28,11 @@ const float tAbs = 0.0; const float tExt = tScat + tAbs; const float stepLen = 1.0 / volumSteps; const float lighting = 0.4; -// float lighting(vec3 p) { - // vec3 L = lightPos.xyz - p.xyz; - // float Ldist = length(lightPos.xyz - p.xyz); - // vec3 Lnorm = L / Ldist; - - // float linearAtenuation = min(1.0, max(0.0, (lightRadius - Ldist) / lightRadius)); - // return linearAtenuation; //* min(1.0, 1.0 / (Ldist * Ldist)); -// } void rayStep(inout vec3 curPos, inout float curOpticalDepth, inout float scatteredLightAmount, float stepLenWorld, vec3 viewVecNorm) { curPos += stepLenWorld * viewVecNorm; const float density = 1.0; - // float l1 = lighting(curPos) * stepLenWorld * tScat * density; float l1 = lighting * stepLenWorld * tScat * density; curOpticalDepth *= exp(-tExt * stepLenWorld * density); @@ -59,7 +43,7 @@ void rayStep(inout vec3 curPos, inout float curOpticalDepth, inout float scatter vec4 lightPosition = LWVP * vec4(curPos, 1.0); if (lightPosition.w > 0.0) { lightPosition.xyz /= lightPosition.w; - visibility = float(texture(shadowMap, lightPosition.xy).r > lightPosition.z - shadowsBias); + visibility = texture(shadowMap, vec3(lightPosition.xy, lightPosition.z - shadowsBias)); } scatteredLightAmount += curOpticalDepth * l1 * visibility; diff --git a/Shaders/volumetric_light_quad/volumetric_light_quad.json b/Shaders/volumetric_light_quad/volumetric_light_quad.json index 17f872cb..3e5f28cc 100755 --- a/Shaders/volumetric_light_quad/volumetric_light_quad.json +++ b/Shaders/volumetric_light_quad/volumetric_light_quad.json @@ -19,30 +19,10 @@ "name": "shadowsBias", "link": "_lightShadowsBias" }, - { - "name": "lightPos", - "link": "_lightPosition", - "ifdef": ["_Disabled"] - }, - { - "name": "lightRadius", - "link": "_lightRadius", - "ifdef": ["_Disabled"] - }, { "name": "snoise", "link": "_blueNoise64" }, - { - "name": "lightPlane", - "link": "_lightPlane", - "ifdef": ["_Disabled"] - }, - { - "name": "lightShadow", - "link": "_lightCastShadow", - "ifdef": ["_Disabled"] - }, { "name": "eye", "link": "_cameraPosition" @@ -89,35 +69,10 @@ "name": "shadowsBias", "link": "_lightShadowsBias" }, - { - "name": "lightPos", - "link": "_lightPosition", - "ifdef": ["_Disabled"] - }, - { - "name": "lightRadius", - "link": "_lightRadius", - "ifdef": ["_Disabled"] - }, { "name": "lightColor", "link": "_lightColor" }, - { - "name": "snoise", - "link": "_noise8", - "ifdef": ["_Disabled"] - }, - { - "name": "lightPlane", - "link": "_lightPlane", - "ifdef": ["_Disabled"] - }, - { - "name": "lightShadow", - "link": "_lightCastShadow", - "ifdef": ["_Disabled"] - }, { "name": "eye", "link": "_cameraPosition" diff --git a/blender/arm/props_renderpath.py b/blender/arm/props_renderpath.py index bb3ed24a..5bf1e323 100644 --- a/blender/arm/props_renderpath.py +++ b/blender/arm/props_renderpath.py @@ -301,7 +301,7 @@ class ArmRPListItem(bpy.types.PropertyGroup): ('FXAA', 'FXAA', 'FXAA'), ('SMAA', 'SMAA', 'SMAA'), ('TAA', 'TAA', 'TAA')], - name="Anti Aliasing", description="Post-process anti aliasing technique", default='FXAA', update=update_renderpath) + name="Anti Aliasing", description="Post-process anti aliasing technique", default='SMAA', update=update_renderpath) rp_volumetriclight: BoolProperty(name="Volumetric Light", description="Use volumetric lighting", default=False, update=update_renderpath) rp_ssr: BoolProperty(name="SSR", description="Screen space reflections", default=False, update=update_renderpath) rp_ssgi: EnumProperty(