Search Unity

Bug (SRP)unexpected result rendering point light shadow with texture array

Discussion in 'General Graphics' started by cyberjoys, Aug 20, 2021.

  1. cyberjoys

    cyberjoys

    Joined:
    Dec 1, 2020
    Posts:
    66
    hi guys
    my srp point light shadow is rendering correctly with GLcore and vulkan api, but when i switch to DX11 api, it is not rendering as expected/correctly
    Vulkan_000.png

    OpenGL_000.png

    DX11_000.png


    with DX 11 api, only the positive-X did write to RT, all other faces does have object rendering going on(looking at the frame debugger), but it does not got writen to the respective RT slice (i tested sampling different slice, confirm only 0(positiveX side) has something), or maybe i should say, all other RT slices have no shadow map result in it
    DX11_001.png


    my srp setup like :
    using texture array set up for point light rendering, textureFormat use ShadowMap, and used samplerCompareState to do direct compare. and setRenderTarget 6 times from 0 - 5 cast as cubeMap face.
    Code (CSharp):
    1. cmdBuff.SetRenderTarget(_sId_TbRpOtherShadowMap, mipLevel: 0, cubemapFace: cubeMapFace, depthSlice: othersIndex);
    since all my directionals, spots and points shadow are working correctly in GL, vulkan(editor), and even on mobile(tested gles3.0 and vulkan)

    question :
    is this unexpected result on DX11 api a bug ? or there is something i need do specifically for DX platform?