ImageEffects.BlueOptimized stopped working (5.5.0f3)

I’m getting no more camera blur effect on iPhone6 now after updating to 5.5.0f3 from 5.3.6p8. It seems to work on iPad3, however, so did this shader drop support for Metal? It used to work. I reimported the Effects standard asset package when I updated to unity 5.5. Here’s the log output:

The shader Hidden/FastBlur (UnityEngine.Shader) on effect Game Camera (UnityStandardAssets.ImageEffects.BlurOptimized) is not supported on this platform!
UnityStandardAssets.ImageEffects.PostEffectsBase:CheckShaderAndCreateMaterial(Shader, Material)
UnityStandardAssets.ImageEffects.BlurOptimized:CheckResources()
UnityStandardAssets.ImageEffects.BlurOptimized:OnRenderImage(RenderTexture, RenderTexture)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

The image effect Game Camera (UnityStandardAssets.ImageEffects.BlurOptimized) has been disabled as it’s not supported on the current platform.
UnityStandardAssets.ImageEffects.BlurOptimized:CheckResources()
UnityStandardAssets.ImageEffects.BlurOptimized:OnRenderImage(RenderTexture, RenderTexture)

It looks like I could probably just revert the Hidden/FastBlur shader to the old one. The new one seems to have added a _Bloom property and now makes calls to UnityStereoScreenSpaceUVAdjust() Not sure why the shader wouldn’t be supported on an iPhone 6?

Huh, looks like there are a bunch of FastBlur shader compiler errors written out when I run the app, so there’s some kind of bug in the Metal conversion that doesn’t show up in OpenGL2.0

Initialize engine version: 5.5.0f3 (38b4efef76f0)
Compilation failed:

program_source:38:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:38:22: error: use of undeclared identifier ‘TEXCOORD1’; did you mean ‘Mtl_FragmentIn::TEXCOORD1’?
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~
Mtl_FragmentIn::TEXCOORD1
program_source:17:11: note: ‘Mtl_FragmentIn::TEXCOORD1’ declared here
half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;
^
program_source:38:22: error: invalid use of non-static data member ‘TEXCOORD1’
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~
program_source:39:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[1] = TEXCOORD2;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:39:22: error: use of undeclared identifier ‘TEXCOORD2’
phase0_Input1_2[1] = TEXCOORD2;
^
program_source:40:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[2] = TEXCOORD3;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:40:22: error: use of undeclared identifier ‘TEXCOORD3’
phase0_Input1_2[2] = TEXCOORD3;
^

#include <metal_stdlib>
#include <metal_texture>
using namespace metal;
constant float4 ImmCB_0_0_0[7] =
{
float4(0.0205000006, 0.0, 0.0, 0.0),
float4(0.0855000019, 0.0, 0.0, 0.0),
float4(0.231999993, 0.0, 0.0, 0.0),
float4(0.324000001, 0.0, 0.0, 1.0),
float4(0.231999993, 0.0, 0.0, 0.0),
float4(0.0855000019, 0.0, 0.0, 0.0),
float4(0.0205000006, 0.0, 0.0, 0.0)
};
struct Mtl_FragmentIn
{
half2 TEXCOORD0 [[ user(TEXCOORD0) ]] ;
half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;
};
struct Mtl_FragmentOut
{
half4 SV_Target0 [[ color(0) ]];
};
fragment Mtl_FragmentOut xlatMtlMain(
texture2d<half, access::sample > _MainTex [[ texture (0) ]] ,
sampler sampler_MainTex [[ sampler (0) ]] ,
Mtl_FragmentIn input [[ stage_in ]])
{
Mtl_FragmentOut output;
half4 u_xlat16_0;
half4 u_xlat16_1;
int u_xlati2;
half4 u_xlat16_3;
half4 u_xlat16_4;
bool u_xlatb7;
half4 phase0_Input0_2[3];
phase0_Input1_2[0] = TEXCOORD1;
phase0_Input1_2[1] = TEXCOORD2;
phase0_Input1_2[2] = TEXCOORD3;
u_xlat16_0 = _MainTex.sample(sampler_MainTex, float2(input.TEXCOORD0.xy));
u_xlat16_0 = half4(float4(u_xlat16_0) * float4(0.324000001, 0.324000001, 0.324000001, 1.0));
u_xlat16_1 = u_xlat16_0;
u_xlati2 = 0x0;
while(true){
u_xlatb7 = u_xlati2>=0x3;
if(u_xlatb7){break;}
u_xlat16_3 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].xy));
u_xlat16_4 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].zw));
u_xlat16_3 = half4(u_xlat16_3 + u_xlat16_4);
u_xlat16_1 = half4(float4(u_xlat16_3) * ImmCB_0_0_0[u_xlati2].xxxw + float4(u_xlat16_1));
u_xlati2 = u_xlati2 + 0x1;
}
output.SV_Target0 = u_xlat16_1;
return output;
}
Compilation failed:

program_source:38:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:38:22: error: use of undeclared identifier ‘TEXCOORD1’; did you mean ‘Mtl_FragmentIn::TEXCOORD1’?
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~
Mtl_FragmentIn::TEXCOORD1
program_source:17:11: note: ‘Mtl_FragmentIn::TEXCOORD1’ declared here
half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;
^
program_source:38:22: error: invalid use of non-static data member ‘TEXCOORD1’
phase0_Input1_2[0] = TEXCOORD1;
^~~~~~~~~
program_source:39:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[1] = TEXCOORD2;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:39:22: error: use of undeclared identifier ‘TEXCOORD2’
phase0_Input1_2[1] = TEXCOORD2;
^
program_source:40:1: error: use of undeclared identifier ‘phase0_Input1_2’; did you mean ‘phase0_Input0_2’?
phase0_Input1_2[2] = TEXCOORD3;
^~~~~~~~~~~~~~~
phase0_Input0_2
program_source:37:7: note: ‘phase0_Input0_2’ declared here
half4 phase0_Input0_2[3];
^
program_source:40:22: error: use of undeclared identifier ‘TEXCOORD3’
phase0_Input1_2[2] = TEXCOORD3;
^

#include <metal_stdlib>
#include <metal_texture>
using namespace metal;
constant float4 ImmCB_0_0_0[7] =
{
float4(0.0205000006, 0.0, 0.0, 0.0),
float4(0.0855000019, 0.0, 0.0, 0.0),
float4(0.231999993, 0.0, 0.0, 0.0),
float4(0.324000001, 0.0, 0.0, 1.0),
float4(0.231999993, 0.0, 0.0, 0.0),
float4(0.0855000019, 0.0, 0.0, 0.0),
float4(0.0205000006, 0.0, 0.0, 0.0)
};
struct Mtl_FragmentIn
{
half2 TEXCOORD0 [[ user(TEXCOORD0) ]] ;
half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;
};
struct Mtl_FragmentOut
{
half4 SV_Target0 [[ color(0) ]];
};
fragment Mtl_FragmentOut xlatMtlMain(
texture2d<half, access::sample > _MainTex [[ texture (0) ]] ,
sampler sampler_MainTex [[ sampler (0) ]] ,
Mtl_FragmentIn input [[ stage_in ]])
{
Mtl_FragmentOut output;
half4 u_xlat16_0;
half4 u_xlat16_1;
int u_xlati2;
half4 u_xlat16_3;
half4 u_xlat16_4;
bool u_xlatb7;
half4 phase0_Input0_2[3];
phase0_Input1_2[0] = TEXCOORD1;
phase0_Input1_2[1] = TEXCOORD2;
phase0_Input1_2[2] = TEXCOORD3;
u_xlat16_0 = _MainTex.sample(sampler_MainTex, float2(input.TEXCOORD0.xy));
u_xlat16_0 = half4(float4(u_xlat16_0) * float4(0.324000001, 0.324000001, 0.324000001, 1.0));
u_xlat16_1 = u_xlat16_0;
u_xlati2 = 0x0;
while(true){
u_xlatb7 = u_xlati2>=0x3;
if(u_xlatb7){break;}
u_xlat16_3 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].xy));
u_xlat16_4 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].zw));
u_xlat16_3 = half4(u_xlat16_3 + u_xlat16_4);
u_xlat16_1 = half4(float4(u_xlat16_3) * ImmCB_0_0_0[u_xlati2].xxxw + float4(u_xlat16_1));
u_xlati2 = u_xlati2 + 0x1;
}
output.SV_Target0 = u_xlat16_1;
return output;
}
WARNING: Shader Unsupported: ‘Hidden/FastBlur’ - Pass ‘’ has no fragment shader
WARNING: Shader Unsupported: ‘Hidden/FastBlur’ - Setting to default shader.

Hi. I ran into this also after upgrading to 5.5. Works fine when I tested it on 2 other platform devices (Android and Windows Store).

Does anyone know of a workaround?

Thanks.

FYI I submitted a bug report for this issue with a sample project to Unity. I received a response back yesterday morning that QA was able to reproduce the issue and forwarded it to the developers. So hopefully this gets included in the next patch!

1 Like

If anyone needs an immediate workaround you can just comment out the SGX variants and then make sure you’re using the standard gauss instead. It’s only having trouble with what’s inside of v2f_withBlurCoordsSGX, the standard passes are fine.

2886622–212088–MobileBlur_NoSGX.shader (5.67 KB)

2 Likes

A note for people having similar problems with FastBloom, just search SGX and delete every block of code containing it!

1 Like

Thank you! Been trying to find the problem for hours now!

I think I saw this has been fixed with 5.5.2 release.