public ResolutionRelativeRenderLayer(string fullName
                                             , GlobalLayerScaleType layerScaleType
                                             , UniformLayerScaleType uniformScaleType)
            : base(fullName)
        {
            rp = ArtemisEngine.RenderPipeline; // for convenience

            LayerScaleType   = layerScaleType;
            UniformScaleType = uniformScaleType;
            RecalculateTargetTransform();
        }
        public ResolutionRelativeRenderLayer( string fullName
                                            , GlobalLayerScaleType layerScaleType 
                                            , UniformLayerScaleType uniformScaleType )
            : base(fullName)
        {
            rp = ArtemisEngine.RenderPipeline; // for convenience

            LayerScaleType = layerScaleType;
            UniformScaleType = uniformScaleType;
            RecalculateTargetTransform();
        }
Exemple #3
0
        public WorldRenderLayer(string fullName
                                , AbstractCamera camera
                                , GlobalLayerScaleType layerScaleType    = GlobalLayerScaleType.Dynamic
                                , UniformLayerScaleType uniformScaleType = UniformLayerScaleType.Stretch
                                , World world = null)
            : base(UriUtilities.GetLastPart(fullName), layerScaleType, uniformScaleType)
        {
            rp = ArtemisEngine.RenderPipeline; // for convenience

            Camera       = camera;
            camera.Layer = this;

            _world = world;
        }
        /// <summary>
        /// Called after everything is rendered (also after RenderLayerTarget is called).
        /// </summary>
        protected override void PostRender()
        {
            if (RequiresTargetTransformRecalc)
            {
                if (_newLayerScaleType.HasValue)
                {
                    _layerScaleType = _newLayerScaleType.Value;
                }
                if (_newUniformScaleType.HasValue)
                {
                    _uniformScaleType = _newUniformScaleType.Value;
                }

                _newLayerScaleType   = null;
                _newUniformScaleType = null;

                RecalculateTargetTransform(); // sets _requiresTargetTransformRecalc to false.
            }
        }
        /// <summary>
        /// Called after everything is rendered (also after RenderLayerTarget is called).
        /// </summary>
        protected override void PostRender()
        {
            if (RequiresTargetTransformRecalc)
            {
                if (_newLayerScaleType.HasValue)
                    _layerScaleType = _newLayerScaleType.Value;
                if (_newUniformScaleType.HasValue)
                    _uniformScaleType = _newUniformScaleType.Value;

                _newLayerScaleType = null;
                _newUniformScaleType = null;

                RecalculateTargetTransform(); // sets _requiresTargetTransformRecalc to false.
            }
        }