Ejemplo n.º 1
0
        unsafe public static HDDirectionalShadowData UnPackedShadowDataToDirectionShadowData(PackedShadowData data)
        {
            HDDirectionalShadowData outData = default(HDDirectionalShadowData);

            outData.sphereCascades[4 * 0 + 0] = data.packedData1.x;
            outData.sphereCascades[4 * 0 + 1] = data.packedData1.y;
            outData.sphereCascades[4 * 0 + 2] = data.packedData1.z;
            outData.sphereCascades[4 * 0 + 3] = data.packedData1.w;

            outData.sphereCascades[4 * 1 + 0] = data.packedData2.x;
            outData.sphereCascades[4 * 1 + 1] = data.packedData2.y;
            outData.sphereCascades[4 * 1 + 2] = data.packedData2.z;
            outData.sphereCascades[4 * 1 + 3] = data.packedData2.w;


            outData.sphereCascades[4 * 2 + 0] = data.packedData3.x;
            outData.sphereCascades[4 * 2 + 1] = data.packedData3.y;
            outData.sphereCascades[4 * 2 + 2] = data.packedData3.z;
            outData.sphereCascades[4 * 2 + 3] = data.packedData3.w;

            outData.sphereCascades[4 * 3 + 0] = data.packedData4.x;
            outData.sphereCascades[4 * 3 + 1] = data.packedData4.y;
            outData.sphereCascades[4 * 3 + 2] = data.packedData4.z;
            outData.sphereCascades[4 * 3 + 3] = data.packedData4.w;

            outData.cascadeDirection = data.packedData5;

            outData.cascadeBorders[4 * 0 + 0] = data.packedData6.x;
            outData.cascadeBorders[4 * 0 + 1] = data.packedData6.y;
            outData.cascadeBorders[4 * 0 + 2] = data.packedData6.z;
            outData.cascadeBorders[4 * 0 + 3] = data.packedData6.w;

            return(outData);
        }
Ejemplo n.º 2
0
        unsafe public static PackedShadowData ToPackedShadowData(HDDirectionalShadowData data)
        {
            PackedShadowData outData = default(PackedShadowData);

            outData.packedData1 = new Vector4(
                data.sphereCascades[4 * 0 + 0],
                data.sphereCascades[4 * 0 + 1],
                data.sphereCascades[4 * 0 + 2],
                data.sphereCascades[4 * 0 + 3]);

            outData.packedData2 = new Vector4(
                data.sphereCascades[4 * 1 + 0],
                data.sphereCascades[4 * 1 + 1],
                data.sphereCascades[4 * 1 + 2],
                data.sphereCascades[4 * 1 + 3]);

            outData.packedData3 = new Vector4(
                data.sphereCascades[4 * 2 + 0],
                data.sphereCascades[4 * 2 + 1],
                data.sphereCascades[4 * 2 + 2],
                data.sphereCascades[4 * 2 + 3]);


            outData.packedData4 = new Vector4(
                data.sphereCascades[4 * 3 + 0],
                data.sphereCascades[4 * 3 + 1],
                data.sphereCascades[4 * 3 + 2],
                data.sphereCascades[4 * 3 + 3]);

            outData.packedData5 = data.cascadeDirection;

            outData.packedData6 = new Vector4(
                data.cascadeBorders[4 * 0 + 0],
                data.cascadeBorders[4 * 0 + 1],
                data.cascadeBorders[4 * 0 + 2],
                data.cascadeBorders[4 * 0 + 3]);

            return(outData);
        }