Hello, I'm trying to get ChatGPT to write a shader for me lol,
The shade is supposed to apply the smart blur effect: "Smart blur is a type of image filtering or blurring technique that is used to reduce noise or blur specific parts of an image while keeping other parts sharp."
But it is not going so well. Just to be clear I don't know anything about coding.
Getting this compiler error X3004: undeclared identifier 'ReShade::BackBufferTextureSize'
// Smart Blur effect using Reshade FX language
// By ChatGPT
#include "ReShade.fxh"
float4 SmartBlurPass(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
float blurRadius = 5.0f;
float3 result = float3(0.0f, 0.0f, 0.0f);
float totalWeight = 0.0f;
float2 pixelSize = 1.0f / ReShade::BackBufferTextureSize;
[loop]
for (float i = -blurRadius; i <= blurRadius; i++)
{
for (float j = -blurRadius; j <= blurRadius; j++)
{
float2 offset = float2(i, j) * pixelSize;
float4 color = tex2D(ReShade::BackBuffer, texcoord + offset);
float weight = exp(-dot(offset, offset) * 100.0f);
result += color.rgb * weight;
totalWeight += weight;
}
}
result /= totalWeight;
return float4(result, 1.0f);
}
technique SmartBlur
{
pass
{
PixelShader = SmartBlurPass;
}
}
So I guess humans are still superior, would you guys have any ideas of how to fix this?