protected RenderToTextureCommandBase(IServiceRegistry services, Texture2DDescription textureDescription = default(Texture2DDescription), OutputRule outputRule = OutputRule.NewRenderTarget) : base(services, CommandType.PostProcessing) { IDirectXDeviceSettings deviceSettings = services.GetService <IDirectXDeviceSettings>(); viewport = new Viewport(0, 0, deviceSettings.PreferredBackBufferWidth, deviceSettings.PreferredBackBufferHeight); this.outputRule = outputRule; inputs = new List <Texture>(); if (outputRule == OutputRule.NewRenderTarget) { if (textureDescription.Width == 0 || textureDescription.Height == 0) { this.textureDescription = PostProcessor.GetTextureDescription(deviceSettings.PreferredBackBufferWidth, deviceSettings.PreferredBackBufferHeight); } else { this.textureDescription = textureDescription; } } }