'LightLoop': cannot convert output parameter from 'struct LightLoopOutput' to 'float3'

It is my custom shader. made in amplify shader.
Unity3d 2020.2

Any idea ?

Shader error in ‘HDRP/Custom/LitAlphaCutoutFromNoiseDoubleSided’: ‘LightLoop’: cannot convert output parameter from ‘struct LightLoopOutput’ to ‘float3’ at line 4209 (on d3d11)

Compiling Fragment program with USE_FPTL_LIGHTLIST DECALS_OFF SHADOW_LOW
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
Disabled keywords: _SURFACE_TYPE_TRANSPARENT DEBUG_DISPLAY LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON SHADOWS_SHADOWMASK DECALS_3RT DECALS_4RT USE_CLUSTERED_LIGHTLIST SHADOW_MEDIUM SHADOW_HIGH INSTANCING_ON _DOUBLESIDED_ON _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY _ENABLE_FOG_ON_TRANSPARENT _ALPHATEST_ON UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

1 Like

https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.1/manual/Upgrading-from-2020.1-to-2020.2.html?q=LightLoop

Usually that piece of ASE shader code looks like:

float3 diffuseLighting;
float3 specularLighting;

LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, diffuseLighting, specularLighting);

diffuseLighting *= GetCurrentExposureMultiplier();
specularLighting *= GetCurrentExposureMultiplier();

Change it to:

float3 diffuseLighting;
float3 specularLighting;
LightLoopOutput lightLoopOutput;

LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput);

diffuseLighting = lightLoopOutput.diffuseLighting;
specularLighting = lightLoopOutput.specularLighting;

diffuseLighting *= GetCurrentExposureMultiplier();
specularLighting *= GetCurrentExposureMultiplier();
4 Likes

Hi koirat,

Try to remove the Amplify Shader Editor Package (delete) and then re-import it again and re-compile the specific shader. It should work. It worked for me.

Sorry for the late answer I had the same issue and I figured out.

1 Like