protected override void InitializeCore()
        {
            base.InitializeCore();

            if (SceneCameraRenderer == null)
            {
                return;
            }

            var forwardMode = SceneCameraRenderer.Mode;
            var effectName =  forwardMode.ModelEffect;
            if (effectName == null)
            {
                throw new InvalidOperationException("ModelEffect cannot be null");
            }

            isPickingRendering = Context.IsPicking();
            if (isPickingRendering)
            {
                effectName += ".Picking";
                Context.Parameters.Set(ParadoxEffectBaseKeys.ExtensionPostVertexStageShader, PickingEffect);
            }

            modelRenderer.EffectName = effectName;
            modelRenderer = ToLoadAndUnload(modelRenderer);

            // Setup the ModelComponentRenderer as the main renderer for the scene Camera Renderer
            // This is used by the LightComponentForwardRenderer
            // TODO: Check if we could discover declared renderers in a better way than just hacking the tags of a component
            ModelComponentRenderer.Attach(SceneCameraRenderer, modelRenderer);
        }
        protected override void InitializeCore()
        {
            base.InitializeCore();

            if (SceneCameraRenderer == null)
            {
                return;
            }

            var forwardMode = SceneCameraRenderer.Mode;
            var effectName  = forwardMode.ModelEffect;

            if (effectName == null)
            {
                throw new InvalidOperationException("ModelEffect cannot be null");
            }

            isPickingRendering = Context.IsPicking();
            if (isPickingRendering)
            {
                effectName += ".Picking";
                Context.Parameters.Set(ParadoxEffectBaseKeys.ExtensionPostVertexStageShader, PickingEffect);
            }

            modelRenderer.EffectName = effectName;
            modelRenderer            = ToLoadAndUnload(modelRenderer);

            // Setup the ModelComponentRenderer as the main renderer for the scene Camera Renderer
            // This is used by the LightComponentForwardRenderer
            // TODO: Check if we could discover declared renderers in a better way than just hacking the tags of a component
            ModelComponentRenderer.Attach(SceneCameraRenderer, modelRenderer);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Attaches a <see cref="ModelComponentRenderer"/> to the specified component.
 /// </summary>
 /// <param name="component">The component.</param>
 /// <param name="renderer">The renderer.</param>
 /// <exception cref="System.ArgumentNullException">component</exception>
 public static void Attach(ComponentBase component, ModelComponentRenderer renderer)
 {
     if (component == null)
     {
         throw new ArgumentNullException("component");
     }
     component.Tags.Set(Current, renderer);
 }
 public ModelComponentAndPickingRenderer()
 {
     modelRenderer = new ModelComponentRenderer();
 }
Ejemplo n.º 5
0
 internal SafeDelegateList(ModelComponentRenderer renderer)
     : base(Constraint, true, ExceptionError)
 {
     this.renderer = renderer;
 }
 public ModelComponentAndPickingRenderer()
 {
     modelRenderer = new ModelComponentRenderer();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Attaches a <see cref="ModelComponentRenderer"/> to the specified component.
 /// </summary>
 /// <param name="component">The component.</param>
 /// <param name="renderer">The renderer.</param>
 /// <exception cref="System.ArgumentNullException">component</exception>
 public static void Attach(ComponentBase component, ModelComponentRenderer renderer)
 {
     if (component == null) throw new ArgumentNullException("component");
     component.Tags.Set(Current, renderer);
 }