Ejemplo n.º 1
0
 public FDistanceFieldVolumeData(FArchive Ar)
 {
     if (Ar.Game >= EGame.GAME_UE4_16)
     {
         CompressedDistanceFieldVolume = Ar.ReadArray <byte>();
         Size                = Ar.Read <FIntVector>();
         LocalBoundingBox    = Ar.Read <FBox>();
         DistanceMinMax      = Ar.Read <FVector2D>();
         bMeshWasClosed      = Ar.ReadBoolean();
         bBuiltAsIfTwoSided  = Ar.ReadBoolean();
         bMeshWasPlane       = Ar.ReadBoolean();
         DistanceFieldVolume = new ushort[0];
     }
     else
     {
         DistanceFieldVolume = Ar.ReadArray <ushort>();
         Size                          = Ar.Read <FIntVector>();
         LocalBoundingBox              = Ar.Read <FBox>();
         bMeshWasClosed                = Ar.ReadBoolean();
         bBuiltAsIfTwoSided            = Ar.Ver >= EUnrealEngineObjectUE4Version.RENAME_CROUCHMOVESCHARACTERDOWN && Ar.ReadBoolean();
         bMeshWasPlane                 = Ar.Ver >= EUnrealEngineObjectUE4Version.DEPRECATE_UMG_STYLE_ASSETS && Ar.ReadBoolean();
         CompressedDistanceFieldVolume = new byte[0];
         DistanceMinMax                = new FVector2D(0f, 0f);
     }
 }
Ejemplo n.º 2
0
        public FPrecomputedVolumetricLightmapData(FArchive Ar)
        {
            Bounds = Ar.Read <FBox>();
            IndirectionTextureDimensions = Ar.Read <FIntVector>();
            IndirectionTexture           = new FVolumetricLightmapDataLayer(Ar);

            BrickSize           = Ar.Read <int>();
            BrickDataDimensions = Ar.Read <FIntVector>();

            BrickData = new FVolumetricLightmapBrickLayer
            {
                AmbientVector  = new FVolumetricLightmapDataLayer(Ar),
                SHCoefficients = new FVolumetricLightmapDataLayer[6]
            };

            for (var i = 0; i < BrickData.SHCoefficients.Length; i++)
            {
                BrickData.SHCoefficients[i] = new FVolumetricLightmapDataLayer(Ar);
            }

            BrickData.SkyBentNormal             = new FVolumetricLightmapDataLayer(Ar);
            BrickData.DirectionalLightShadowing = new FVolumetricLightmapDataLayer(Ar);

            if (FMobileObjectVersion.Get(Ar) >= FMobileObjectVersion.Type.LQVolumetricLightmapLayers)
            {
                BrickData.LQLightColor     = new FVolumetricLightmapDataLayer(Ar);
                BrickData.LQLightDirection = new FVolumetricLightmapDataLayer(Ar);
            }

            if (FRenderingObjectVersion.Get(Ar) >= FRenderingObjectVersion.Type.VolumetricLightmapStreaming)
            {
                SubLevelBrickPositions           = Ar.ReadArray <FIntVector>();
                IndirectionTextureOriginalValues = Ar.ReadArray <FColor>();
            }
        }