diff --git a/examples/31-reflectiveshadowmap/fs_rsm_combine.sc b/examples/31-reflectiveshadowmap/fs_rsm_combine.sc index cf144c07f..af4f5fc23 100644 --- a/examples/31-reflectiveshadowmap/fs_rsm_combine.sc +++ b/examples/31-reflectiveshadowmap/fs_rsm_combine.sc @@ -22,7 +22,7 @@ uniform vec4 u_rsmAmount; float hardShadow(sampler2DShadow _sampler, vec4 _shadowCoord, float _bias) { - vec2 texCoord = _shadowCoord.xy; + vec2 texCoord = _shadowCoord.xy; return shadow2D(_sampler, vec3(texCoord.xy, _shadowCoord.z-_bias) ); } @@ -31,8 +31,8 @@ float PCF(sampler2DShadow _sampler, vec4 _shadowCoord, float _bias, vec2 _texelS vec2 texCoord = _shadowCoord.xy; bool outside = any(greaterThan(texCoord, vec2_splat(1.0))) - || any(lessThan (texCoord, vec2_splat(0.0))) - ; + || any(lessThan (texCoord, vec2_splat(0.0))) + ; if (outside) { @@ -69,63 +69,63 @@ float PCF(sampler2DShadow _sampler, vec4 _shadowCoord, float _bias, vec2 _texelS float toClipSpaceDepth(float _depthTextureZ) { #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - return _depthTextureZ; + return _depthTextureZ; #else - return _depthTextureZ * 2.0 - 1.0; + return _depthTextureZ * 2.0 - 1.0; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL } vec3 clipToWorld(mat4 _invViewProj, vec3 _clipPos) { - vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); - return wpos.xyz / wpos.w; + vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); + return wpos.xyz / wpos.w; } void main() { vec3 n = texture2D(s_normal, v_texcoord0).xyz; - // Expand out normal - n = n*2.0+-1.0; - vec3 l = u_lightDir.xyz;//normalize(vec3(-0.8,0.75,-1.0)); - float dirLightIntensity = 1.0; - float dirLight = max(0.0,dot(n,l)) * dirLightIntensity; + // Expand out normal + n = n*2.0+-1.0; + vec3 l = u_lightDir.xyz;//normalize(vec3(-0.8,0.75,-1.0)); + float dirLightIntensity = 1.0; + float dirLight = max(0.0,dot(n,l)) * dirLightIntensity; - // Apply shadow map - - // Get world position so we can transform it into light space, to look into shadow map - vec2 texCoord = v_texcoord0.xy; - float deviceDepth = texture2D(s_depth, texCoord).x; - float depth = toClipSpaceDepth(deviceDepth); - vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); + // Apply shadow map + + // Get world position so we can transform it into light space, to look into shadow map + vec2 texCoord = v_texcoord0.xy; + float deviceDepth = texture2D(s_depth, texCoord).x; + float depth = toClipSpaceDepth(deviceDepth); + vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - clip.y = -clip.y; + clip.y = -clip.y; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - vec3 wpos = clipToWorld(u_invMvp, clip); + vec3 wpos = clipToWorld(u_invMvp, clip); - const float shadowMapOffset = 0.003; - vec3 posOffset = wpos + n.xyz * shadowMapOffset; - vec4 shadowCoord = mul(u_lightMtx, vec4(posOffset, 1.0) ); + const float shadowMapOffset = 0.003; + vec3 posOffset = wpos + n.xyz * shadowMapOffset; + vec4 shadowCoord = mul(u_lightMtx, vec4(posOffset, 1.0) ); #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - shadowCoord.y *= -1.0; + shadowCoord.y *= -1.0; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - - float shadowMapBias = 0.001; - vec2 texelSize = vec2_splat(u_shadowDimsInv.x); - shadowCoord.xy /= shadowCoord.w; - shadowCoord.xy = shadowCoord.xy*0.5+0.5; + float shadowMapBias = 0.001; + vec2 texelSize = vec2_splat(u_shadowDimsInv.x); - float visibility = PCF(s_shadowMap, shadowCoord, shadowMapBias, texelSize); + shadowCoord.xy /= shadowCoord.w; + shadowCoord.xy = shadowCoord.xy*0.5+0.5; - dirLight *= visibility; - - // Light from light buffer - vec3 albedo = texture2D(s_color, v_texcoord0).xyz; - vec3 lightBuffer = texture2D(s_light, v_texcoord0).xyz; + float visibility = PCF(s_shadowMap, shadowCoord, shadowMapBias, texelSize); - gl_FragColor.xyz = mix(dirLight * albedo, lightBuffer * albedo, u_rsmAmount.x); + dirLight *= visibility; - gl_FragColor.w = 1.0; + // Light from light buffer + vec3 albedo = texture2D(s_color, v_texcoord0).xyz; + vec3 lightBuffer = texture2D(s_light, v_texcoord0).xyz; + + gl_FragColor.xyz = mix(dirLight * albedo, lightBuffer * albedo, u_rsmAmount.x); + + gl_FragColor.w = 1.0; } diff --git a/examples/31-reflectiveshadowmap/fs_rsm_gbuffer.sc b/examples/31-reflectiveshadowmap/fs_rsm_gbuffer.sc index a3d3af8a9..a220ecf9d 100644 --- a/examples/31-reflectiveshadowmap/fs_rsm_gbuffer.sc +++ b/examples/31-reflectiveshadowmap/fs_rsm_gbuffer.sc @@ -11,12 +11,12 @@ uniform vec4 u_tint; void main() { - vec3 normalWorldSpace = v_normal; + vec3 normalWorldSpace = v_normal; - // Write normal - gl_FragData[0].xyz = normalWorldSpace.xyz; // Normal is already compressed to [0,1] so can fit in gbuffer - gl_FragData[0].w = 0.0; + // Write normal + gl_FragData[0].xyz = normalWorldSpace.xyz; // Normal is already compressed to [0,1] so can fit in gbuffer + gl_FragData[0].w = 0.0; - // Write color - gl_FragData[1] = u_tint; + // Write color + gl_FragData[1] = u_tint; } diff --git a/examples/31-reflectiveshadowmap/fs_rsm_lbuffer.sc b/examples/31-reflectiveshadowmap/fs_rsm_lbuffer.sc index a5554752e..259c850a3 100644 --- a/examples/31-reflectiveshadowmap/fs_rsm_lbuffer.sc +++ b/examples/31-reflectiveshadowmap/fs_rsm_lbuffer.sc @@ -15,53 +15,53 @@ uniform mat4 u_invMvp; float toClipSpaceDepth(float _depthTextureZ) { #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - return _depthTextureZ; + return _depthTextureZ; #else - return _depthTextureZ * 2.0 - 1.0; + return _depthTextureZ * 2.0 - 1.0; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL } vec3 clipToWorld(mat4 _invViewProj, vec3 _clipPos) { - vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); - return wpos.xyz / wpos.w; + vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); + return wpos.xyz / wpos.w; } void main() { #if BGFX_SHADER_LANGUAGE_HLSL && (BGFX_SHADER_LANGUAGE_HLSL < 4) - vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5); + vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5); #else - vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy; + vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy; #endif - // Get world position - float deviceDepth = texture2D(s_depth, texCoord).x; - float depth = toClipSpaceDepth(deviceDepth); + // Get world position + float deviceDepth = texture2D(s_depth, texCoord).x; + float depth = toClipSpaceDepth(deviceDepth); - vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); + vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - clip.y = -clip.y; + clip.y = -clip.y; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - vec3 wpos = clipToWorld(u_invMvp, clip); - - // Get normal from its map, and decompress - vec3 n = texture2D(s_normal, texCoord).xyz*2.0-1.0; - - // Do lighting - vec3 pointToLight = v_lightCenterScale.xyz-wpos; - float lightLen = sqrt(dot(pointToLight, pointToLight)); + vec3 wpos = clipToWorld(u_invMvp, clip); - float lightFalloff; + // Get normal from its map, and decompress + vec3 n = texture2D(s_normal, texCoord).xyz*2.0-1.0; - if (lightLen > v_lightCenterScale.w) - lightFalloff = 0.0; - else - lightFalloff = 1.0-(lightLen/v_lightCenterScale.w); // Linear falloff for light (could use dist sq if you want) + // Do lighting + vec3 pointToLight = v_lightCenterScale.xyz-wpos; + float lightLen = sqrt(dot(pointToLight, pointToLight)); - vec3 l = normalize(pointToLight)*lightFalloff; - - gl_FragColor.xyz = v_color0.xyz * max(0.0, dot(n,l)); + float lightFalloff; - gl_FragColor.w = 1.0; + if (lightLen > v_lightCenterScale.w) + lightFalloff = 0.0; + else + lightFalloff = 1.0-(lightLen/v_lightCenterScale.w); // Linear falloff for light (could use dist sq if you want) + + vec3 l = normalize(pointToLight)*lightFalloff; + + gl_FragColor.xyz = v_color0.xyz * max(0.0, dot(n,l)); + + gl_FragColor.w = 1.0; } diff --git a/examples/31-reflectiveshadowmap/fs_rsm_shadow.sc b/examples/31-reflectiveshadowmap/fs_rsm_shadow.sc index 25f71c4a4..56026da16 100644 --- a/examples/31-reflectiveshadowmap/fs_rsm_shadow.sc +++ b/examples/31-reflectiveshadowmap/fs_rsm_shadow.sc @@ -12,11 +12,11 @@ uniform vec4 u_tint; void main() { #if BGFX_SHADER_LANGUAGE_HLSL && (BGFX_SHADER_LANGUAGE_HLSL < 4) - vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5); + vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5); #else - vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy; + vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy; #endif - gl_FragData[0].xyz = u_tint.xyz; // Color of light sphere - gl_FragData[0].w = -v_normal.z; // Radius of light sphere + gl_FragData[0].xyz = u_tint.xyz; // Color of light sphere + gl_FragData[0].w = -v_normal.z; // Radius of light sphere } diff --git a/examples/31-reflectiveshadowmap/vs_rsm_gbuffer.sc b/examples/31-reflectiveshadowmap/vs_rsm_gbuffer.sc index ae37125a8..123e4fbf4 100644 --- a/examples/31-reflectiveshadowmap/vs_rsm_gbuffer.sc +++ b/examples/31-reflectiveshadowmap/vs_rsm_gbuffer.sc @@ -2,9 +2,9 @@ $input a_position, a_normal $output v_normal /* -* Copyright 2016 Joseph Cherlin. All rights reserved. -* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause -*/ + * Copyright 2016 Joseph Cherlin. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + */ #include "../common/common.sh" @@ -13,15 +13,15 @@ uniform vec4 u_tint; void main() { - // Calculate vertex position + // Calculate vertex position vec3 pos = a_position; - gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) ); + gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) ); - // Calculate normal. Note that compressed normal is stored in the vertices + // Calculate normal. Note that compressed normal is stored in the vertices vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. - - // Transform normal into world space. - vec3 normalWorldSpace = mul(u_model[0], vec4(normalObjectSpace, 0.0) ).xyz; - // Normalize to remove (uniform...) scaling, however, recompress - v_normal.xyz = normalize(normalWorldSpace)*0.5+0.5; + + // Transform normal into world space. + vec3 normalWorldSpace = mul(u_model[0], vec4(normalObjectSpace, 0.0) ).xyz; + // Normalize to remove (uniform...) scaling, however, recompress + v_normal.xyz = normalize(normalWorldSpace)*0.5+0.5; } diff --git a/examples/31-reflectiveshadowmap/vs_rsm_lbuffer.sc b/examples/31-reflectiveshadowmap/vs_rsm_lbuffer.sc index 1178faf8a..357b38ec3 100644 --- a/examples/31-reflectiveshadowmap/vs_rsm_lbuffer.sc +++ b/examples/31-reflectiveshadowmap/vs_rsm_lbuffer.sc @@ -19,42 +19,42 @@ SAMPLER2D(s_rsm, 3); // Reflective shadow map, used to scale/color light float toClipSpaceDepth(float _depthTextureZ) { #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - return _depthTextureZ; + return _depthTextureZ; #else - return _depthTextureZ * 2.0 - 1.0; + return _depthTextureZ * 2.0 - 1.0; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL } vec3 clipToWorld(mat4 _invViewProj, vec3 _clipPos) { - vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); - return wpos.xyz / wpos.w; + vec4 wpos = mul(_invViewProj, vec4(_clipPos, 1.0) ); + return wpos.xyz / wpos.w; } void main() { - // Calculate vertex position + // Calculate vertex position vec3 objectSpacePos = a_position; - vec2 texCoord = u_sphereInfo.xy; + vec2 texCoord = u_sphereInfo.xy; - // Get world position using the shadow map - float deviceDepth = texture2DLod(s_shadowMap, texCoord, 0).x; - float depth = toClipSpaceDepth(deviceDepth); - vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); + // Get world position using the shadow map + float deviceDepth = texture2DLod(s_shadowMap, texCoord, 0).x; + float depth = toClipSpaceDepth(deviceDepth); + vec3 clip = vec3(texCoord * 2.0 - 1.0, depth); #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - clip.y = -clip.y; + clip.y = -clip.y; #endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_METAL - vec3 wPos = clipToWorld(u_invMvpShadow, clip); - wPos.y -= 0.001; // Would be much better to perturb in normal direction, but I didn't do that. + vec3 wPos = clipToWorld(u_invMvpShadow, clip); + wPos.y -= 0.001; // Would be much better to perturb in normal direction, but I didn't do that. - // Scale and color are already in the rsm - vec4 rsm = texture2DLod(s_rsm, texCoord, 0).xyzw; - float radScale = u_sphereInfo.z; - float rad = rsm.w * radScale; + // Scale and color are already in the rsm + vec4 rsm = texture2DLod(s_rsm, texCoord, 0).xyzw; + float radScale = u_sphereInfo.z; + float rad = rsm.w * radScale; - gl_Position = mul(u_viewProj, vec4(wPos+objectSpacePos*rad, 1.0) ); - - v_lightCenterScale.xyz = wPos.xyz; - v_lightCenterScale.w = rad; - v_color0.xyz = rsm.xyz; + gl_Position = mul(u_viewProj, vec4(wPos+objectSpacePos*rad, 1.0) ); + + v_lightCenterScale.xyz = wPos.xyz; + v_lightCenterScale.w = rad; + v_color0.xyz = rsm.xyz; } diff --git a/examples/31-reflectiveshadowmap/vs_rsm_shadow.sc b/examples/31-reflectiveshadowmap/vs_rsm_shadow.sc index f2f96b385..41bf8ab11 100644 --- a/examples/31-reflectiveshadowmap/vs_rsm_shadow.sc +++ b/examples/31-reflectiveshadowmap/vs_rsm_shadow.sc @@ -13,12 +13,12 @@ uniform vec4 u_tint; void main() { gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) ); - - // Calculate normal. Note that compressed normal is stored in the vertices - vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. - - // Transform normal into view space. - v_normal = mul(u_modelView, vec4(normalObjectSpace, 0.0) ).xyz; - // Normalize to remove (uniform...) scaling - v_normal = normalize(v_normal); + + // Calculate normal. Note that compressed normal is stored in the vertices + vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. + + // Transform normal into view space. + v_normal = mul(u_modelView, vec4(normalObjectSpace, 0.0) ).xyz; + // Normalize to remove (uniform...) scaling + v_normal = normalize(v_normal); } diff --git a/examples/runtime/shaders/dx11/fs_rsm_combine.bin b/examples/runtime/shaders/dx11/fs_rsm_combine.bin new file mode 100644 index 000000000..5c6337344 Binary files /dev/null and b/examples/runtime/shaders/dx11/fs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/dx11/fs_rsm_gbuffer.bin b/examples/runtime/shaders/dx11/fs_rsm_gbuffer.bin new file mode 100644 index 000000000..71c20d5bf Binary files /dev/null and b/examples/runtime/shaders/dx11/fs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/dx11/fs_rsm_lbuffer.bin b/examples/runtime/shaders/dx11/fs_rsm_lbuffer.bin new file mode 100644 index 000000000..ae81827f8 Binary files /dev/null and b/examples/runtime/shaders/dx11/fs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/dx11/fs_rsm_shadow.bin b/examples/runtime/shaders/dx11/fs_rsm_shadow.bin new file mode 100644 index 000000000..faf21f024 Binary files /dev/null and b/examples/runtime/shaders/dx11/fs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/dx11/vs_rsm_combine.bin b/examples/runtime/shaders/dx11/vs_rsm_combine.bin new file mode 100644 index 000000000..2278290e5 Binary files /dev/null and b/examples/runtime/shaders/dx11/vs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/dx11/vs_rsm_gbuffer.bin b/examples/runtime/shaders/dx11/vs_rsm_gbuffer.bin new file mode 100644 index 000000000..40a542fac Binary files /dev/null and b/examples/runtime/shaders/dx11/vs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/dx11/vs_rsm_lbuffer.bin b/examples/runtime/shaders/dx11/vs_rsm_lbuffer.bin new file mode 100644 index 000000000..be1624f77 Binary files /dev/null and b/examples/runtime/shaders/dx11/vs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/dx11/vs_rsm_shadow.bin b/examples/runtime/shaders/dx11/vs_rsm_shadow.bin new file mode 100644 index 000000000..1a351d8cd Binary files /dev/null and b/examples/runtime/shaders/dx11/vs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/dx9/fs_rsm_combine.bin b/examples/runtime/shaders/dx9/fs_rsm_combine.bin new file mode 100644 index 000000000..28d904d89 Binary files /dev/null and b/examples/runtime/shaders/dx9/fs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin b/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin new file mode 100644 index 000000000..7facc87fc Binary files /dev/null and b/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin b/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin new file mode 100644 index 000000000..5f9e5c023 Binary files /dev/null and b/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/dx9/fs_rsm_shadow.bin b/examples/runtime/shaders/dx9/fs_rsm_shadow.bin new file mode 100644 index 000000000..d93441c2f Binary files /dev/null and b/examples/runtime/shaders/dx9/fs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/dx9/vs_rsm_combine.bin b/examples/runtime/shaders/dx9/vs_rsm_combine.bin new file mode 100644 index 000000000..fe8592c13 Binary files /dev/null and b/examples/runtime/shaders/dx9/vs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin b/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin new file mode 100644 index 000000000..3cc1c15e9 Binary files /dev/null and b/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin b/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin new file mode 100644 index 000000000..12579db14 Binary files /dev/null and b/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/dx9/vs_rsm_shadow.bin b/examples/runtime/shaders/dx9/vs_rsm_shadow.bin new file mode 100644 index 000000000..2d9ef91e8 Binary files /dev/null and b/examples/runtime/shaders/dx9/vs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/gles/fs_rsm_combine.bin b/examples/runtime/shaders/gles/fs_rsm_combine.bin new file mode 100644 index 000000000..23364eb50 Binary files /dev/null and b/examples/runtime/shaders/gles/fs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/gles/fs_rsm_gbuffer.bin b/examples/runtime/shaders/gles/fs_rsm_gbuffer.bin new file mode 100644 index 000000000..911c8ff6f Binary files /dev/null and b/examples/runtime/shaders/gles/fs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/gles/fs_rsm_lbuffer.bin b/examples/runtime/shaders/gles/fs_rsm_lbuffer.bin new file mode 100644 index 000000000..207c88361 Binary files /dev/null and b/examples/runtime/shaders/gles/fs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/gles/fs_rsm_shadow.bin b/examples/runtime/shaders/gles/fs_rsm_shadow.bin new file mode 100644 index 000000000..6c9adff2d Binary files /dev/null and b/examples/runtime/shaders/gles/fs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/gles/vs_rsm_combine.bin b/examples/runtime/shaders/gles/vs_rsm_combine.bin new file mode 100644 index 000000000..3368689b8 Binary files /dev/null and b/examples/runtime/shaders/gles/vs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/gles/vs_rsm_gbuffer.bin b/examples/runtime/shaders/gles/vs_rsm_gbuffer.bin new file mode 100644 index 000000000..e86a13cbb Binary files /dev/null and b/examples/runtime/shaders/gles/vs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/gles/vs_rsm_lbuffer.bin b/examples/runtime/shaders/gles/vs_rsm_lbuffer.bin new file mode 100644 index 000000000..68d4a7674 Binary files /dev/null and b/examples/runtime/shaders/gles/vs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/gles/vs_rsm_shadow.bin b/examples/runtime/shaders/gles/vs_rsm_shadow.bin new file mode 100644 index 000000000..cd0a5da26 Binary files /dev/null and b/examples/runtime/shaders/gles/vs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/glsl/fs_rsm_combine.bin b/examples/runtime/shaders/glsl/fs_rsm_combine.bin new file mode 100644 index 000000000..fd9c2e5cf Binary files /dev/null and b/examples/runtime/shaders/glsl/fs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/glsl/fs_rsm_gbuffer.bin b/examples/runtime/shaders/glsl/fs_rsm_gbuffer.bin new file mode 100644 index 000000000..1dcf49ce0 Binary files /dev/null and b/examples/runtime/shaders/glsl/fs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/glsl/fs_rsm_lbuffer.bin b/examples/runtime/shaders/glsl/fs_rsm_lbuffer.bin new file mode 100644 index 000000000..b12772844 Binary files /dev/null and b/examples/runtime/shaders/glsl/fs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/glsl/fs_rsm_shadow.bin b/examples/runtime/shaders/glsl/fs_rsm_shadow.bin new file mode 100644 index 000000000..c8b88b15b Binary files /dev/null and b/examples/runtime/shaders/glsl/fs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/glsl/vs_rsm_combine.bin b/examples/runtime/shaders/glsl/vs_rsm_combine.bin new file mode 100644 index 000000000..c75e2e66e Binary files /dev/null and b/examples/runtime/shaders/glsl/vs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/glsl/vs_rsm_gbuffer.bin b/examples/runtime/shaders/glsl/vs_rsm_gbuffer.bin new file mode 100644 index 000000000..3bf03fd85 Binary files /dev/null and b/examples/runtime/shaders/glsl/vs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/glsl/vs_rsm_lbuffer.bin b/examples/runtime/shaders/glsl/vs_rsm_lbuffer.bin new file mode 100644 index 000000000..8553e1738 Binary files /dev/null and b/examples/runtime/shaders/glsl/vs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/glsl/vs_rsm_shadow.bin b/examples/runtime/shaders/glsl/vs_rsm_shadow.bin new file mode 100644 index 000000000..a5d351de0 Binary files /dev/null and b/examples/runtime/shaders/glsl/vs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/metal/fs_rsm_combine.bin b/examples/runtime/shaders/metal/fs_rsm_combine.bin new file mode 100644 index 000000000..ef8a8cf21 Binary files /dev/null and b/examples/runtime/shaders/metal/fs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin b/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin new file mode 100644 index 000000000..fdd2b8657 Binary files /dev/null and b/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin b/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin new file mode 100644 index 000000000..6eb32d939 Binary files /dev/null and b/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/metal/fs_rsm_shadow.bin b/examples/runtime/shaders/metal/fs_rsm_shadow.bin new file mode 100644 index 000000000..c88531c9d Binary files /dev/null and b/examples/runtime/shaders/metal/fs_rsm_shadow.bin differ diff --git a/examples/runtime/shaders/metal/vs_rsm_combine.bin b/examples/runtime/shaders/metal/vs_rsm_combine.bin new file mode 100644 index 000000000..10fb2d926 Binary files /dev/null and b/examples/runtime/shaders/metal/vs_rsm_combine.bin differ diff --git a/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin b/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin new file mode 100644 index 000000000..83a9b4342 Binary files /dev/null and b/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin differ diff --git a/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin b/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin new file mode 100644 index 000000000..1050eb976 Binary files /dev/null and b/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin differ diff --git a/examples/runtime/shaders/metal/vs_rsm_shadow.bin b/examples/runtime/shaders/metal/vs_rsm_shadow.bin new file mode 100644 index 000000000..c0b666b77 Binary files /dev/null and b/examples/runtime/shaders/metal/vs_rsm_shadow.bin differ