Exemplo n.º 1
0
        /// <inheritdoc/>
        protected override void InitializeCore()
        {
            RenderModelObjectInfoKey = RootRenderFeature.RenderData.CreateObjectKey <RenderModelFrameInfo>();
            RenderModelViewInfoKey   = RootRenderFeature.RenderData.CreateViewObjectKey <RenderModelViewInfo>();

            time         = ((RootEffectRenderFeature)RootRenderFeature).CreateFrameCBufferOffsetSlot(GlobalKeys.Time.Name);
            view         = ((RootEffectRenderFeature)RootRenderFeature).CreateViewCBufferOffsetSlot(TransformationKeys.View.Name);
            camera       = ((RootEffectRenderFeature)RootRenderFeature).CreateViewCBufferOffsetSlot(CameraKeys.NearClipPlane.Name);
            world        = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationKeys.World.Name);
            worldInverse = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationKeys.WorldInverse.Name);
        }
        protected override void InitializeCore()
        {
            if (TransformRenderFeature == null)
            {
                TransformRenderFeature = ((MeshRenderFeature)RootRenderFeature).RenderFeatures.OfType <TransformRenderFeature>().FirstOrDefault();
                if (TransformRenderFeature == null)
                {
                    throw new ArgumentNullException(nameof(TransformRenderFeature));
                }
            }

            previousTransformationInfoKey     = RootRenderFeature.RenderData.CreateStaticObjectKey <StaticObjectInfo>();
            previousTransformationViewInfoKey = RootRenderFeature.RenderData.CreateViewObjectKey <PreviousObjectViewInfo>();
            renderModelObjectInfoKey          = TransformRenderFeature.RenderModelObjectInfoKey;

            previousWorldViewProjection = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(MeshVelocityKeys.PreviousWorldViewProjection.Name);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Change data multiplier (i.e. how many data entries per item there will be).
 /// </summary>
 public void ChangeDataMultiplier <T>(ViewObjectPropertyKey <T> key, int multiplier)
 {
     dataArrays[key.Index].Info.ChangeMutiplier(ref dataArrays.Items[key.Index].Array, multiplier);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Get data from its key.
 /// </summary>
 public ViewObjectPropertyData <T> GetData <T>(ViewObjectPropertyKey <T> key)
 {
     return(new ViewObjectPropertyData <T>((T[])dataArrays[key.Index].Array));
 }