Пример #1
0
 public void ApplyDynamicParameters(Renderer rendererContext)
 {
     foreach (SharedParameter p in dynamicParameters.Values)
     {
         VerboseEvent.DynamicParameterSetting.Log(rendererContext.GetType().Name.ToString(), p.Type.ToString());
         p.Apply(rendererContext);
     }
 }
Пример #2
0
 public RenderCommand(Renderer renderer, IMaterial material, RenderableCollection sceneNodeCollection)
     : base(CommandType.Render)
 {
     Contract.Requires<NullReferenceException>(renderer != null);
     Contract.Requires<NullReferenceException>(material != null);
     CommandAttributes |= CommandAttributes.MonoRendering;
     Renderer = renderer;
     Items = sceneNodeCollection;
     Material = material;
     Technique = Material.EffectDescription.Technique;
     Pass = Technique.GetPassByIndex(Material.EffectDescription.Pass);
     InputLayout = new InputLayout(Game.Context.Device, Pass.Description.Signature, Items.Description.InputElements);
 }
 public UserInterfaceRenderCommand(Renderer renderer, Hud hud, RenderableNode rNode)
     : base(renderer, new UIMaterial(),
         new RenderableCollection(UIMaterial.ItemsDescription, new [] {rNode}))
 {
     CommandType = CommandType.UserInterfaceRenderCommand;
     CommandAttributes |= Graphics.CommandAttributes.MonoRendering;
     this.hud = hud;
     textMaterial = new TextMaterial();
     this.rNode = rNode;
     this.rNode.RenderableObject.Material = Material;
     tNode = (TransformNode)rNode.Parent;
     UpdateSprites(hud.SpriteControls);
     textTechnique = textMaterial.EffectDescription.Technique;
     textPass = textTechnique.GetPassByIndex(textMaterial.EffectDescription.Pass);
     textLayout = new InputLayout(Game.Context.Device, textPass.Description.Signature,
         TextItems.Description.InputElements);
 }
Пример #4
0
        public void AddToScene(Renderer renderer, SceneManager scene)
        {
            UIMaterial uiMaterial = new UIMaterial();

            RenderableNode rNode = new RenderableNode(InterfaceMesh);
            CameraOverlayNode caNode = new CameraOverlayNode(renderer.Camera);

            caNode.AppendChild(rNode);

            uiRCommand = new UserInterfaceRenderCommand(renderer, this, rNode);

            uiUCommand = new UserInterfaceUpdateCommand(this, uiRCommand);

            scene.Tree.RootNode.AppendChild(caNode);
            scene.CommandManager.AddUpdateCommand(uiUCommand);
            scene.CommandManager.AddBaseCommands(uiMaterial.PreRenderStates);
            scene.CommandManager.AddRenderCommand(uiRCommand);
            scene.CommandManager.AddBaseCommands(uiMaterial.PostRenderStates);
        }
Пример #5
0
 public void Apply(Renderer rendererContext)
 {
     update(this,rendererContext);
 }
Пример #6
0
 public void ApplyStaticParameters(Renderer rendererContext)
 {
     foreach (SharedParameter p in staticParameters.Values)
         p.Apply(rendererContext);
 }
Пример #7
0
 public static void ChangeRenderer(Renderer renderer)
 {
     CurrentRenderer = renderer;
     renderer.BeginInit();
     renderer.EndInit();
 }
Пример #8
0
        /// <summary>
        /// Initializes this shader's parameters.
        /// </summary>
        public void InitParameters(Renderer rendererContext)
        {
            //HandleLights();
            OnStaticParametersInit();
            OnDynamicParametersInit();
            OnInstanceParametersInit();

            //ChooseTechnique();
            ApplyStaticParameters(rendererContext);
        }
Пример #9
0
 public virtual void ApplyStaticParameters(Renderer rendererContext)
 {
     EffectDescription.ApplyStaticParameters(rendererContext);
 }
Пример #10
0
 public void Apply(Renderer rendererContext)
 {
     ApplyDynamicParameters(rendererContext);
 }