示例#1
0
        private void Init()
        {
            _WorldVar = GetVariableByName("g_World").AsMatrix();
            _WorldInverseTransposeVar = GetVariableByName("g_WorldInverseTranspose").AsMatrix();
            _WorldViewProjectionVar   = GetVariableByName("g_WorldViewProjection").AsMatrix();

            _ViewInverseVar = GetVariableByName("m_ViewInverse").AsMatrix();

            _EyePositionVar       = GetVariableByName("m_EyePosition").AsVector();
            _DirectionalLight0Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light0"));
            _DirectionalLight1Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light1"));
            _DirectionalLight2Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light2"));

            _DiffuseColorVar  = GetVariableByName("m_DiffuseColor").AsVector();
            _EmissiveColorVar = GetVariableByName("m_EmissiveColor").AsVector();
            _AmbientColorVar  = GetVariableByName("m_AmbientColor").AsVector();
            _SpecularColorVar = GetVariableByName("m_SpecularColor").AsVector();
            _SpecularPowerVar = GetVariableByName("m_SpecularPower").AsScalar();

            SetDefaults();
        }
        private void Init()
        {
            _WorldVar = GetVariableByName("g_World").AsMatrix();
            _WorldInverseTransposeVar = GetVariableByName("g_WorldInverseTranspose").AsMatrix();
            _WorldViewProjectionVar = GetVariableByName("g_WorldViewProjection").AsMatrix();

            _ViewInverseVar = GetVariableByName("m_ViewInverse").AsMatrix();

            _EyePositionVar = GetVariableByName("m_EyePosition").AsVector();
            _DirectionalLight0Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light0"));
            _DirectionalLight1Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light1"));
            _DirectionalLight2Var = new EffectDirectionalLightVariable(GetVariableByName("m_Light2"));

            _DiffuseColorVar = GetVariableByName("m_DiffuseColor").AsVector();
            _EmissiveColorVar = GetVariableByName("m_EmissiveColor").AsVector();
            _AmbientColorVar = GetVariableByName("m_AmbientColor").AsVector();
            _SpecularColorVar = GetVariableByName("m_SpecularColor").AsVector();
            _SpecularPowerVar = GetVariableByName("m_SpecularPower").AsScalar();

            SetDefaults();
        }