Download

How to create custom shading model that allows controlling strength of reflection captures??

I was successfully able to modify the engine to use Blinn-Phong as the specular model instead of GGX (unreal’s default) by modifying the BRDF.ush file (located in the Engine\Shaders\Private folder of the Engine)

(Screenshot of the modified Engine with Blinn-Phong)

I also modified the engine so that it only uses specular highlights and no reflection captures AT ALL from skylight ( planar reflections still worked, which is good!), which lets me know that the engine does (on some level) treat the specular strength and strength of the reflection captures separately. I did this by deleting the #if ENABLE_SKY_LIGHT section of the ReflectionEnvironmentComposite.ush file (also located in the Engine\Shaders\Private folder of the Engine)

(code I deleted to get rid of skylight reflection captures in ReflectionEnvironmentComposite.ush)


#if ENABLE_SKY_LIGHT

    BRANCH  
    if (ReflectionStruct.SkyLightParameters.y > 0)
    {
        float SkyAverageBrightness = 1.0f;

        #if REFLECTION_COMPOSITE_SUPPORT_SKYLIGHT_BLEND
            float3 SkyLighting = GetSkyLightReflectionSupportingBlend(RayDirection, Roughness, SkyAverageBrightness);
        #else
            float3 SkyLighting = GetSkyLightReflection(RayDirection, Roughness, SkyAverageBrightness);
        #endif

        // Normalize for static skylight types which mix with lightmaps
        bool bNormalize = ReflectionStruct.SkyLightParameters.z < 1 && ALLOW_STATIC_LIGHTING;

        FLATTEN
        if (bNormalize)
        {
            ImageBasedReflections.rgb += ImageBasedReflections.a * SkyLighting * IndirectSpecularOcclusion;
            CompositedAverageBrightness.x += SkyAverageBrightness * CompositedAverageBrightness.y;
        }
        else
        {
            ExtraIndirectSpecular += SkyLighting * IndirectSpecularOcclusion;
        }
    }
#endif

But I still find in a lot of cases things are too glossy/reflective/wet looking would like for a way to be to be able to control the strength of the reflection captures independent of the specular amount, but I’m not sure how create a custom shading model that would allow me to do this? Please let me know where to get started or if you’re familiar with this?