LineRenderer2D icon indicating copy to clipboard operation
LineRenderer2D copied to clipboard

Compilation error fix.

Open johste93 opened this issue 2 years ago • 3 comments

To make this work in Unity 2021.3 I had to replace all instances of

if (_IsUnlit == 0.0f)
{
    // Lighting
    finalColor = CombinedShapeLightShared(finalColor, maskColor, i.screenPos);
}

with:

if (_IsUnlit == 0.0f)
{
    // Lighting
    SurfaceData2D surfaceData;
    InputData2D inputData;
    surfaceData.albedo = finalColor.rgb;
    surfaceData.alpha = 1;
    surfaceData.mask = maskColor;
    inputData.uv = i.screenPos;
    finalColor = half4(CombinedShapeLightShared(surfaceData, inputData).rgb, finalColor.a);
}

johste93 avatar Oct 02 '22 22:10 johste93

Shader error in 'Game/S_BresenhamMultiLineRenderer2D': variable 'inputData' used without having been completely initialized at line 156 (on d3d11)

GabrielBigardi avatar Oct 15 '22 00:10 GabrielBigardi

Not sure if this fixes it, but I used ZERO_INITIALIZE(InputData2D, inputData); before inputData.uv = i.screenPos;

StinkySteak avatar May 14 '23 03:05 StinkySteak

just added a new fork & pull request for anyone required to use unity 2021.3

StinkySteak avatar May 14 '23 03:05 StinkySteak