Exemple #1
0
 public bool Prepare(IDeviceContextHolder contextHolder, SpecialRenderMode mode)
 {
     if (!mode.HasFlag(SpecialRenderMode.Simple))
     {
         return(false);
     }
     contextHolder.DeviceContext.InputAssembler.InputLayout = _effect.LayoutPNTG;
     return(true);
 }
 public override bool Prepare(IDeviceContextHolder contextHolder, SpecialRenderMode mode)
 {
     if (!AllowedFlags.HasFlag(mode))
     {
         return(false);
     }
     Effect.FxMaterial.Set(Material);
     Effect.FxDiffuseMap.SetResource(TxDiffuse);
     PrepareStates(contextHolder, mode);
     return(true);
 }
Exemple #3
0
        public override bool Prepare(IDeviceContextHolder contextHolder, SpecialRenderMode mode)
        {
            if (!AllowedFlags.HasFlag(mode))
            {
                return(false);
            }

            if (Effect?.FxMaterial == null)
            {
                throw new NullReferenceException(Effect == null ? "Effect is null" : "Effect.FxMaterial is null");
            }

            if (Effect.FxDiffuseMap == null)
            {
                throw new NullReferenceException("Effect.FxDiffuseMap is null");
            }

            Effect.FxMaterial.Set(_material);
            Effect.FxDiffuseMap.SetResource(_txDiffuse);

            PrepareStates(contextHolder, mode);
            return(true);
        }
 public bool Prepare(DeviceContextHolder contextHolder, SpecialRenderMode mode) {
     if (!mode.HasFlag(SpecialRenderMode.Simple)) return false;
     contextHolder.DeviceContext.InputAssembler.InputLayout = _effect.LayoutPNTG;
     return true;
 }