Exemplo n.º 1
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            ClearFlags = stream.ReadUInt32();
            BackGroundColor.Read(stream);
            if (IsReadProjectionMatrixMode(stream.Version))
            {
                ProjectionMatrixMode = (ProjectionMatrixMode)stream.ReadInt32();
                SensorSize.Read(stream);
                LensShift.Read(stream);
                FocalLength = stream.ReadSingle();
            }
            NormalizedViewPortRect.Read(stream);
            NearClipPlane = stream.ReadSingle();
            FarClipPlane  = stream.ReadSingle();
            FieldOfView   = stream.ReadSingle();
            Orthographic  = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);

            OrthographicSize = stream.ReadSingle();
            Depth            = stream.ReadSingle();
            CullingMask.Read(stream);
            if (IsReadRenderingPath(stream.Version))
            {
                RenderingPath = (RenderingPath)stream.ReadInt32();
            }
            TargetTexture.Read(stream);
            if (IsReadTargetDisplay(stream.Version))
            {
                TargetDisplay = stream.ReadInt32();
            }
            if (IsReadTargetEye(stream.Version))
            {
                TargetEye = (StereoTargetEyeMask)stream.ReadInt32();
            }
            if (IsReadHDR(stream.Version))
            {
                HDR = stream.ReadBoolean();
            }
            if (IsReadAllowMSAA(stream.Version))
            {
                AllowMSAA = stream.ReadBoolean();
            }
            if (IsReadAllowDynamicResolution(stream.Version))
            {
                AllowDynamicResolution = stream.ReadBoolean();
            }
            if (IsReadForceIntoRT(stream.Version))
            {
                ForceIntoRT = stream.ReadBoolean();
            }
            if (IsReadOcclusionCulling(stream.Version))
            {
                OcclusionCulling = stream.ReadBoolean();
            }
            if (IsAlign(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }
            if (IsReadStereoConvergence(stream.Version))
            {
                StereoConvergence = stream.ReadSingle();
                StereoSeparation  = stream.ReadSingle();
            }
            if (IsReadStereoMirrorMode(stream.Version))
            {
                StereoMirrorMode = stream.ReadBoolean();
            }
        }
Exemplo n.º 2
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            ClearFlags = reader.ReadUInt32();
            BackGroundColor.Read(reader);
            if (HasProjectionMatrixMode(reader.Version))
            {
                ProjectionMatrixMode = (ProjectionMatrixMode)reader.ReadInt32();
            }
            if (HasGateFitMode(reader.Version))
            {
                if (HasGateFitModeFirst(reader.Version))
                {
                    GateFitMode = (GateFitMode)reader.ReadInt32();
                }
            }
#if UNIVERSAL
            if (HasFOVAxisMode(reader.Version, reader.Flags))
            {
                FOVAxisMode = (FieldOfViewAxis)reader.ReadInt32();
            }
#endif
            if (IsAlign1(reader.Version))
            {
                reader.AlignStream();
            }
            if (HasSensorSize(reader.Version))
            {
                SensorSize.Read(reader);
                LensShift.Read(reader);
            }
            if (HasGateFitMode(reader.Version))
            {
                if (!HasGateFitModeFirst(reader.Version))
                {
                    GateFitMode = (GateFitMode)reader.ReadInt32();
                }
            }
            if (HasFocalLength(reader.Version))
            {
                FocalLength = reader.ReadSingle();
            }

            NormalizedViewPortRect.Read(reader);
            NearClipPlane = reader.ReadSingle();
            FarClipPlane  = reader.ReadSingle();
            FieldOfView   = reader.ReadSingle();
            Orthographic  = reader.ReadBoolean();
            reader.AlignStream();

            OrthographicSize = reader.ReadSingle();
            Depth            = reader.ReadSingle();
            CullingMask.Read(reader);
            if (HasRenderingPath(reader.Version))
            {
                RenderingPath = (RenderingPath)reader.ReadInt32();
            }
            TargetTexture.Read(reader);
            if (HasTargetDisplay(reader.Version))
            {
                TargetDisplay = reader.ReadInt32();
            }
            if (HasTargetEye(reader.Version))
            {
                TargetEye = (StereoTargetEyeMask)reader.ReadInt32();
            }
            if (HasHDR(reader.Version))
            {
                HDR = reader.ReadBoolean();
            }
            if (HasAllowMSAA(reader.Version))
            {
                AllowMSAA = reader.ReadBoolean();
            }
            if (HasAllowDynamicResolution(reader.Version))
            {
                AllowDynamicResolution = reader.ReadBoolean();
            }
            if (HasForceIntoRT(reader.Version))
            {
                ForceIntoRT = reader.ReadBoolean();
            }
            if (HasOcclusionCulling(reader.Version))
            {
                OcclusionCulling = reader.ReadBoolean();
            }
            if (IsAlign2(reader.Version))
            {
                reader.AlignStream();
            }
            if (HasStereoConvergence(reader.Version))
            {
                StereoConvergence = reader.ReadSingle();
                StereoSeparation  = reader.ReadSingle();
            }
            if (HasStereoMirrorMode(reader.Version))
            {
                StereoMirrorMode = reader.ReadBoolean();
            }
        }