Exemplo n.º 1
0
        private BlendState LoadBlendState(IAetherReader reader)
        {
            BlendState blendState = new BlendState();
            string     str; Int64 i64; Color col;

            reader.ReadString("Name", out str); blendState.Name           = str;
            reader.ReadString("BlendStateName", out str); blendState.Name = str;
            reader.ReadInt64("AlphaBlendFunction", out i64); blendState.AlphaBlendFunction       = (BlendFunction)i64;
            reader.ReadInt64("AlphaDestinationBlend", out i64); blendState.AlphaDestinationBlend = (Blend)i64;
            reader.ReadInt64("AlphaSourceBlend", out i64); blendState.AlphaSourceBlend           = (Blend)i64;
            reader.ReadColor("BlendFactor", out col); blendState.BlendFactor = col;
            reader.ReadInt64("ColorBlendFunction", out i64); blendState.ColorBlendFunction       = (BlendFunction)i64;
            reader.ReadInt64("ColorDestinationBlend", out i64); blendState.ColorDestinationBlend = (Blend)i64;
            reader.ReadInt64("ColorSourceBlend", out i64); blendState.ColorSourceBlend           = (Blend)i64;
            reader.ReadInt64("ColorWriteChannels", out i64); blendState.ColorWriteChannels       = (ColorWriteChannels)i64;
            reader.ReadInt64("ColorWriteChannels1", out i64); blendState.ColorWriteChannels1     = (ColorWriteChannels)i64;
            reader.ReadInt64("ColorWriteChannels2", out i64); blendState.ColorWriteChannels2     = (ColorWriteChannels)i64;
            reader.ReadInt64("ColorWriteChannels3", out i64); blendState.ColorWriteChannels3     = (ColorWriteChannels)i64;
            reader.ReadInt64("MultiSampleMask", out i64); blendState.MultiSampleMask             = (int)i64;
            return(blendState);
        }
Exemplo n.º 2
0
        private RasterizerState LoadRasterizerState(IAetherReader reader)
        {
            RasterizerState rasterizerState = new RasterizerState();
            string          str; Int64 i64; float flt; bool bl;

            reader.ReadString("Name", out str); rasterizerState.Name          = str;
            reader.ReadInt64("CullMode", out i64); rasterizerState.CullMode   = (CullMode)i64;
            reader.ReadFloat("DepthBias", out flt); rasterizerState.DepthBias = flt;
            reader.ReadInt64("FillMode", out i64); rasterizerState.FillMode   = (FillMode)i64;
            reader.ReadBoolean("MultiSampleAntiAlias", out bl); rasterizerState.MultiSampleAntiAlias = bl;
            reader.ReadBoolean("ScissorTestEnable", out bl); rasterizerState.ScissorTestEnable       = bl;
            reader.ReadFloat("SlopeScaleDepthBias", out flt); rasterizerState.SlopeScaleDepthBias    = flt;
            return(rasterizerState);
        }
Exemplo n.º 3
0
        private void LoadSamplerStates(IAetherReader reader, SamplerState[] samplerStates)
        {
            int samplerStateCount;

            reader.ReadInt32("SamplerStateCount", out samplerStateCount);
            for (int i = 0; i < samplerStateCount; i++)
            {
                SamplerState samplerState = new SamplerState();
                string       str; Int64 i64; float flt;
                reader.ReadString("Name", out str); samplerState.Name                  = str;
                reader.ReadInt64("AddressU", out i64); samplerState.AddressU           = (TextureAddressMode)i64;
                reader.ReadInt64("AddressV", out i64); samplerState.AddressV           = (TextureAddressMode)i64;
                reader.ReadInt64("AddressW", out i64); samplerState.AddressW           = (TextureAddressMode)i64;
                reader.ReadInt64("Filter", out i64); samplerState.Filter               = (TextureFilter)i64;
                reader.ReadInt64("MaxAnisotropy", out i64); samplerState.MaxAnisotropy = (int)i64;
                reader.ReadInt64("MaxMipLevel", out i64); samplerState.MaxMipLevel     = (int)i64;
                reader.ReadFloat("MipMapLevelOfDetailBias", out flt); samplerState.MipMapLevelOfDetailBias = flt;
                samplerStates[i] = samplerState;
            }
        }
Exemplo n.º 4
0
        private DepthStencilState LoadDepthStencilState(IAetherReader reader)
        {
            DepthStencilState depthStencilState = new DepthStencilState();
            string            str; Int64 i64; bool bl;

            reader.ReadString("Name", out str); depthStencilState.Name = str;
            reader.ReadInt64("CounterClockwiseStencilDepthBufferFail", out i64); depthStencilState.CounterClockwiseStencilDepthBufferFail = (StencilOperation)i64;
            reader.ReadInt64("CounterClockwiseStencilFail", out i64); depthStencilState.CounterClockwiseStencilFail         = (StencilOperation)i64;
            reader.ReadInt64("CounterClockwiseStencilFunction", out i64); depthStencilState.CounterClockwiseStencilFunction = (CompareFunction)i64;
            reader.ReadInt64("CounterClockwiseStencilPass", out i64); depthStencilState.CounterClockwiseStencilPass         = (StencilOperation)i64;
            reader.ReadBoolean("DepthBufferEnable", out bl); depthStencilState.DepthBufferEnable           = bl;
            reader.ReadInt64("DepthBufferFunction", out i64); depthStencilState.DepthBufferFunction        = (CompareFunction)i64;
            reader.ReadBoolean("DepthBufferWriteEnable", out bl); depthStencilState.DepthBufferWriteEnable = bl;
            reader.ReadInt64("ReferenceStencil", out i64); depthStencilState.ReferenceStencil             = (int)i64;
            reader.ReadInt64("StencilDepthBufferFail", out i64); depthStencilState.StencilDepthBufferFail = (StencilOperation)i64;
            reader.ReadBoolean("StencilEnable", out bl); depthStencilState.StencilEnable             = bl;
            reader.ReadInt64("StencilFail", out i64); depthStencilState.StencilFail                  = (StencilOperation)i64;
            reader.ReadInt64("StencilFunction", out i64); depthStencilState.StencilFunction          = (CompareFunction)i64;
            reader.ReadInt64("StencilMask", out i64); depthStencilState.StencilMask                  = (int)i64;
            reader.ReadInt64("StencilPass", out i64); depthStencilState.StencilPass                  = (StencilOperation)i64;
            reader.ReadInt64("StencilWriteMask", out i64); depthStencilState.StencilWriteMask        = (int)i64;
            reader.ReadBoolean("TwoSidedStencilMode", out bl); depthStencilState.TwoSidedStencilMode = bl;
            return(depthStencilState);
        }