Example #1
0
        public EffectShotTrackMap(Device device)
        {
            using (var bc = EffectUtils.Compile(Properties.Resources.EffectShotTrackMap, "ShotTrackMap")){
                E = new Effect(device, bc);
            }

            TechTrackMap = E.GetTechniqueByName("TrackMap");

            for (var i = 0; i < TechTrackMap.Description.PassCount && InputSignaturePT == null; i++)
            {
                InputSignaturePT = TechTrackMap.GetPassByIndex(i).Description.Signature;
            }
            if (InputSignaturePT == null)
            {
                throw new System.Exception("input signature (ShotTrackMap, PT, TrackMap) == null");
            }
            LayoutPT = new InputLayout(device, InputSignaturePT, VerticePT.InputElements);

            FxInputImage = E.GetVariableByName("gInputImage").AsResource();
        }
Example #2
0
        public EffectTest(Device device)
        {
            using (var bc = EffectUtils.Compile(Properties.Resources.EffectTest, "Test")){
                E = new Effect(device, bc);
            }

            TechCar    = E.GetTechniqueByName("Car");
            TechSimple = E.GetTechniqueByName("Simple");
            TechShadow = E.GetTechniqueByName("Shadow");

            for (var i = 0; i < TechCar.Description.PassCount && InputSignaturePNT == null; i++)
            {
                InputSignaturePNT = TechCar.GetPassByIndex(i).Description.Signature;
            }
            if (InputSignaturePNT == null)
            {
                throw new System.Exception("input signature (Test, PNT, Car) == null");
            }
            LayoutPNT = new InputLayout(device, InputSignaturePNT, VerticePNT.InputElements);
            for (var i = 0; i < TechSimple.Description.PassCount && InputSignaturePT == null; i++)
            {
                InputSignaturePT = TechSimple.GetPassByIndex(i).Description.Signature;
            }
            if (InputSignaturePT == null)
            {
                throw new System.Exception("input signature (Test, PT, Simple) == null");
            }
            LayoutPT = new InputLayout(device, InputSignaturePT, VerticePT.InputElements);

            FxWorld             = E.GetVariableByName("gWorld").AsMatrix();
            FxWorldInvTranspose = E.GetVariableByName("gWorldInvTranspose").AsMatrix();
            FxWorldViewProj     = E.GetVariableByName("gWorldViewProj").AsMatrix();
            FxDiffuseMap        = E.GetVariableByName("gDiffuseMap").AsResource();
            FxDetailsMap        = E.GetVariableByName("gDetailsMap").AsResource();
            FxNormalMap         = E.GetVariableByName("gNormalMap").AsResource();
            FxMapMap            = E.GetVariableByName("gMapMap").AsResource();
            FxCubeMap           = E.GetVariableByName("gCubeMap").AsResource();
            FxEyePosW           = E.GetVariableByName("gEyePosW").AsVector();
            FxMaterial          = E.GetVariableByName("gMaterial");
            FxDirLight          = E.GetVariableByName("gDirLight");
        }
Example #3
0
        public EffectShotBodyShadow(Device device)
        {
            using (var bc = EffectUtils.Compile(Properties.Resources.EffectShotBodyShadow, "ShotBodyShadow")){
                E = new Effect(device, bc);
            }

            TechCreateBodyShadow   = E.GetTechniqueByName("CreateBodyShadow");
            TechHorzBodyShadowBlur = E.GetTechniqueByName("HorzBodyShadowBlur");
            TechVertBodyShadowBlur = E.GetTechniqueByName("VertBodyShadowBlur");

            for (var i = 0; i < TechCreateBodyShadow.Description.PassCount && InputSignaturePT == null; i++)
            {
                InputSignaturePT = TechCreateBodyShadow.GetPassByIndex(i).Description.Signature;
            }
            if (InputSignaturePT == null)
            {
                throw new System.Exception("input signature (ShotBodyShadow, PT, CreateBodyShadow) == null");
            }
            LayoutPT = new InputLayout(device, InputSignaturePT, VerticePT.InputElements);

            FxInputImage = E.GetVariableByName("gInputImage").AsResource();
            FxTexel      = E.GetVariableByName("gTexel").AsVector();
        }