Hello
I am trying to use mobile deferred in Unreal 5.3.
On mobile, the default setting doesn’t decode GBuffer.ShadingModelID properly, so it comes out differently than the value when encoding (I’ve modified the source code to add Shading Model).
So I want to enable MOBILE_EXTENDED_GBUFFER.
I looked in the code and found that in ShaderComplier.cpp there is a line that says
Input.Environment.SetDefine(TEXT(“MOBILE_EXTENDED_GBUFFER”), MobileUsesExtendedGBuffer((EShaderPlatform)Target.Platform) ? 1 : 0);
and then it says
// Whether to support more than 4 color attachments for GBuffer
RENDERCORE_API bool MobileUsesExtenedGBuffer(FStaticShaderPlatform ShaderPlatform)
{
// Android GLES: uses PLS for deferred shading and limited to 128 bits
// Vulkan requires:
// maxDescriptorSetInputAttachments > 4
// maxColorAttachments > 4
// iOS: A8+
return (ShaderPlatform != SP_OPENGL_ES3_1_ANDROID) && false;
}
Here’s what it looks like: a function that returns false unconditionally.
I tried to remove the “&& false” part and it works fine for me.
However, I’m still not sure what problems this will cause.
Do you have any idea why they’ve implemented the function to return false for some reason? I’ve been losing sleep over this for days and it’s shortening my lifespan.
I would really appreciate an answer.
Thanks in advance.