Larslloyd
(bowlasti)
April 13, 2023, 3:40pm
1
i am making a post procesing shader but get error [SM5] /Engine/Generated/Material.ush(2111,7-10): error X3000: syntax error: unexpected token ‘mean’
can anybody help
float3 mean[4] = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}
};
float3 sigma[4] = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}
};
float2 offsets[4] = {{-RADIUS, -RADIUS}, {-RADIUS,0}, {0,-RADIUS}, {0,0}};
float2 pos;
float3 col;
for(int i = 0; i < 4; i++)
{
for(int j = 0; j <= RADIUS; j++)
{
for(int k = 0; k <= RADIUS; k++)
{
pos = float2(j, k) + offsets[1];
float2 uvpos = UV + pos/VIEWSIZE;
col = SceneTextureLookup(uvpos, 14, false)
mean[i] += col;
sigma[i] += col * col;
}
}
}
float n = pow(RADIUS + 1, 2);
return mean[0] / n;
High500
(High500)
April 13, 2023, 7:09pm
2
Hi @Larslloyd
Is it possible (i maybe wrong) that float3 doesnt exist and it should be TVector<float,3> ?
Inalso believe that arrays use the TArray container rather than explicitly declaring them, but again i may be wrong
But if im right it could be the reason you Mean variable does not initilaise and throws that error
Larslloyd
(bowlasti)
April 15, 2023, 11:54am
3
the error is gone but now it says [SM5] /Engine/Generated/Material.ush(2082,1-7): error X3004: undeclared identifier ‘TVector’ have tryed to fix it but it dident do you know this one 2
High500
(High500)
April 15, 2023, 2:08pm
4
Sorry change it to FVector
It looks like you are just missing a semicolon on this line in your loop (causing the compiler to be confused about the subsequent line):
col = SceneTextureLookup(uvpos, 14, false);
Use of float3 etc should be fine.