Пример #1
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteFloat("InnerAngle", InnerAngle);
     writer.WriteFloat("OuterAngle", OuterAngle);
     writer.WriteVector3("Direction", Direction);
 }
Пример #2
0
 public virtual void Save(IAetherWriter writer)
 {
     writer.WriteVector3("Position", Position);
     writer.WriteVector3("LightSourceColor", LightSourceColor);
     writer.WriteFloat("Intensity", Intensity);
     writer.WriteFloat("MaximumRadius", MaximumRadius);
 }
Пример #3
0
        private void SaveSamplerStates(IAetherWriter writer, SamplerState[] samplerStates)
        {
            int samplerStateCount = samplerStates.Length;

            for (int i = 0; i < samplerStateCount; i++)
            {
                if (samplerStates[i] == null)
                {
                    samplerStateCount = i;
                    break;
                }
            }
            writer.WriteInt32("SamplerStateCount", samplerStateCount);
            for (int i = 0; i < samplerStateCount; i++)
            {
                SamplerState samplerState = samplerStates[i];
                writer.WriteString("Name", samplerState.Name);
                writer.WriteInt64("AddressU", (int)samplerState.AddressU);
                writer.WriteInt64("AddressV", (int)samplerState.AddressV);
                writer.WriteInt64("AddressW", (int)samplerState.AddressW);
                writer.WriteInt64("Filter", (int)samplerState.Filter);
                writer.WriteInt64("MaxAnisotropy", samplerState.MaxAnisotropy);
                writer.WriteInt64("MaxMipLevel", samplerState.MaxMipLevel);
                writer.WriteFloat("MipMapLevelOfDetailBias", samplerState.MipMapLevelOfDetailBias);
            }
        }
Пример #4
0
 private void WriteDirectionalLight(IAetherWriter writer, string name, DirectionalLightData directionalLight)
 {
     writer.WriteVector3(name + "DiffuseColor", directionalLight.DiffuseColor);
     writer.WriteVector3(name + "SpecularColor", directionalLight.SpecularColor);
     writer.WriteVector3(name + "Direction", directionalLight.Direction);
     writer.WriteBoolean(name + "Enabled", directionalLight.Enabled);
 }
Пример #5
0
 public virtual void Save(IAetherWriter writer)
 {
     writer.WriteInt64("PrimitiveType", (int)PrimitiveType);
     SaveBlendState(writer, this.BlendState);
     SaveDepthStencilState(writer, this.DepthStencilState);
     SaveRasterizerState(writer, this.RasterizerState);
     SaveSamplerStates(writer, this.SamplerStates);
 }
Пример #6
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteVector3("DiffuseColor", DiffuseColor);
     writer.WriteFloat("Alpha", Alpha);
     writer.WriteInt64("ReferenceAlpha", ReferenceAlpha);
     writer.WriteBoolean("VertexColorEnabled", VertexColorEnabled);
 }
Пример #7
0
 public void Save(IAetherWriter writer)
 {
     writer.WriteInt32("Version", 1);
     writer.WriteVector3("Position", this._position);
     writer.WriteQuaternion("Rotation", _rotation);
     writer.WriteVector3("Scale", _scale);
     writer.WriteParticle("Material", (IAether)Material);
 }
Пример #8
0
 public virtual void Save(IAetherWriter writer)
 {
     writer.WriteVector3("Position", _position);
     writer.WriteVector3("LookAt", _lookAt);
     writer.WriteVector3("Up", _up);
     writer.WriteFloat("NearPlane", _nearPlane);
     writer.WriteFloat("FarPlane", _farPlane);
 }
Пример #9
0
        public override void Save(IAetherWriter writer)
        {
            writer.WriteInt32("Version", 1);

            base.Save(writer);
            // TODO: add IAetherWriter.WriteParticles(string, new ISet<T>)
            writer.WriteParticles("VisibleParticles", new List <IPhotonNode>(_visibleParticles));
        }
Пример #10
0
        public virtual void Save(IAetherWriter writer)
        {
            writer.Write("EngineData", (IAetherSerialization)EngineData);

            //write particles
            writer.WriteParticles("Particles", particles);
            //write managers
            writer.WriteParticleManagers("Managers", Managers);
        }
Пример #11
0
        public override void Save(IAetherWriter writer)
        {
            base.Save(writer);

            //write root
            if (Root is IAetherSerialization)
            {
                writer.Write("Root", (IAetherSerialization)Root);
            }
        }
Пример #12
0
 private void SaveRasterizerState(IAetherWriter writer, RasterizerState rasterizerState)
 {
     writer.WriteString("Name", rasterizerState.Name);
     writer.WriteInt64("CullMode", (int)rasterizerState.CullMode);
     writer.WriteFloat("DepthBias", rasterizerState.DepthBias);
     writer.WriteInt64("FillMode", (int)rasterizerState.FillMode);
     writer.WriteBoolean("MultiSampleAntiAlias", rasterizerState.MultiSampleAntiAlias);
     writer.WriteBoolean("ScissorTestEnable", rasterizerState.ScissorTestEnable);
     writer.WriteFloat("SlopeScaleDepthBias", rasterizerState.SlopeScaleDepthBias);
 }
Пример #13
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteVector3("DiffuseColor", DiffuseColor);
     writer.WriteVector3("AmbientLightColor", AmbientLightColor);
     writer.WriteVector3("EmissiveColor", EmissiveColor);
     WriteDirectionalLight(writer, "DirectionalLight0", DirectionalLight0);
     WriteDirectionalLight(writer, "DirectionalLight1", DirectionalLight1);
     WriteDirectionalLight(writer, "DirectionalLight2", DirectionalLight2);
     writer.WriteFloat("Alpha", Alpha);
     writer.WriteInt64("LightingEnabled", WeightsPerVertex);
 }
Пример #14
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteVector3("DiffuseColor", DiffuseColor);
     writer.WriteVector3("AmbientLightColor", AmbientLightColor);
     writer.WriteVector3("EmissiveColor", EmissiveColor);
     WriteDirectionalLight(writer, "DirectionalLight0", DirectionalLight0);
     WriteDirectionalLight(writer, "DirectionalLight1", DirectionalLight1);
     WriteDirectionalLight(writer, "DirectionalLight2", DirectionalLight2);
     writer.WriteFloat("Alpha", Alpha);
     writer.WriteFloat("EnvironmentMapAmount", EnvironmentMapAmount);
     writer.WriteVector3("EnvironmentMapSpecular", EnvironmentMapSpecular);
     writer.WriteFloat("FresnelFactor", FresnelFactor);
 }
Пример #15
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteVector3("DiffuseColor", DiffuseColor);
     writer.WriteVector3("AmbientLightColor", AmbientLightColor);
     writer.WriteVector3("EmissiveColor", EmissiveColor);
     WriteDirectionalLight(writer, "DirectionalLight0", DirectionalLight0);
     WriteDirectionalLight(writer, "DirectionalLight1", DirectionalLight1);
     WriteDirectionalLight(writer, "DirectionalLight2", DirectionalLight2);
     writer.WriteFloat("Alpha", Alpha);
     writer.WriteBoolean("TextureEnabled", TextureEnabled);
     writer.WriteBoolean("VertexColorEnabled", VertexColorEnabled);
     writer.WriteBoolean("LightingEnabled", LightingEnabled);
 }
Пример #16
0
 private void SaveBlendState(IAetherWriter writer, BlendState blendState)
 {
     writer.WriteString("Name", blendState.Name);
     writer.WriteString("BlendStateName", blendState.Name);
     writer.WriteInt64("AlphaBlendFunction", (int)blendState.AlphaBlendFunction);
     writer.WriteInt64("AlphaDestinationBlend", (int)blendState.AlphaDestinationBlend);
     writer.WriteInt64("AlphaSourceBlend", (int)blendState.AlphaSourceBlend);
     writer.WriteColor("BlendFactor", blendState.BlendFactor);
     writer.WriteInt64("ColorBlendFunction", (int)blendState.ColorBlendFunction);
     writer.WriteInt64("ColorDestinationBlend", (int)blendState.ColorDestinationBlend);
     writer.WriteInt64("ColorSourceBlend", (int)blendState.ColorSourceBlend);
     writer.WriteInt64("ColorWriteChannels", (int)blendState.ColorWriteChannels);
     writer.WriteInt64("ColorWriteChannels1", (int)blendState.ColorWriteChannels1);
     writer.WriteInt64("ColorWriteChannels2", (int)blendState.ColorWriteChannels2);
     writer.WriteInt64("ColorWriteChannels3", (int)blendState.ColorWriteChannels3);
     writer.WriteInt64("MultiSampleMask", (int)blendState.MultiSampleMask);
 }
Пример #17
0
 private void SaveDepthStencilState(IAetherWriter writer, DepthStencilState depthStencilState)
 {
     writer.WriteString("Name", depthStencilState.Name);
     writer.WriteInt64("CounterClockwiseStencilDepthBufferFail", (int)depthStencilState.CounterClockwiseStencilDepthBufferFail);
     writer.WriteInt64("CounterClockwiseStencilFail", (int)depthStencilState.CounterClockwiseStencilFail);
     writer.WriteInt64("CounterClockwiseStencilFunction", (int)depthStencilState.CounterClockwiseStencilFunction);
     writer.WriteInt64("CounterClockwiseStencilPass", (int)depthStencilState.CounterClockwiseStencilPass);
     writer.WriteBoolean("DepthBufferEnable", depthStencilState.DepthBufferEnable);
     writer.WriteInt64("DepthBufferFunction", (int)depthStencilState.DepthBufferFunction);
     writer.WriteBoolean("DepthBufferWriteEnable", depthStencilState.DepthBufferWriteEnable);
     writer.WriteInt64("ReferenceStencil", depthStencilState.ReferenceStencil);
     writer.WriteInt64("StencilDepthBufferFail", (int)depthStencilState.StencilDepthBufferFail);
     writer.WriteBoolean("StencilEnable", depthStencilState.StencilEnable);
     writer.WriteInt64("StencilFail", (int)depthStencilState.StencilFail);
     writer.WriteInt64("StencilFunction", (int)depthStencilState.StencilFunction);
     writer.WriteInt64("StencilMask", depthStencilState.StencilMask);
     writer.WriteInt64("StencilPass", (int)depthStencilState.StencilPass);
     writer.WriteInt64("StencilWriteMask", depthStencilState.StencilWriteMask);
     writer.WriteBoolean("TwoSidedStencilMode", depthStencilState.TwoSidedStencilMode);
 }
Пример #18
0
        public virtual void Save(IAetherWriter writer)
        {
            writer.WriteInt32("Version", 1);

            writer.WriteParticles("Particles", this);
        }
Пример #19
0
 public void Save(IAetherWriter writer)
 {
     writer.WriteUInt64("UniqueIdCounter", UniqueIdCounter);
     writer.Write("NextUniqueId", NextUniqueID);
     writer.WriteDouble("TotalTime", TotalTime);
 }
Пример #20
0
 public virtual void Save(IAetherWriter writer)
 {
     //write particles
     writer.WriteParticles("Particles", particles);
 }
Пример #21
0
        public override void Save(IAetherWriter writer)
        {
            writer.WriteInt32("Version", 1);

            base.Save(writer);
        }
Пример #22
0
 public override void Save(IAetherWriter writer)
 {
     base.Save(writer);
     writer.WriteFloat("FieldOfView", _fieldOfView);
 }
Пример #23
0
 public void Save(IAetherWriter writer)
 {
     writer.WriteGuid(uid);
 }
 public void Save(IAetherWriter writer)
 {
     writer.WriteInt32("Version", 1);
     writer.WriteVector3("Position", this._position);
     writer.WriteQuaternion("Rotation", _rotation);
     writer.WriteVector3("Scale", _scale);
     writer.WriteParticle("Material", (IAether)Material);
 }