Sprite Distortion (Ghosting While Moving and Artifacts when Mirroring to External Display)

I am working on my first MonoGame project. I love the framework so far!

I have implemented my own letterbox/pillarboxing to scale my native resolution by the maximum integer scale allowable on my display. Basically, I determine the maximum integer scale, set my PreferredBackBuffer to the screen resolution, create a Viewport that is my native resolution * maximum scale, and then set my SpriteBatch to draw everything at Matrix.CreateScale(max_scale).

This works much better than rendering to a texture that has my native resolution and then scaling it up. (Scaling using a Matrix in SpriteBatch, as opposed to just rendering to a texture and then scaling it up, allows you to fake “subpixel rendering” to some extent).

That said, I am facing two issues.

  1. When my sprite moves, there is very subtle “ghosting” happening. The sprite is subtly blurry and there’s a faint ghostly trail behind it.

  2. When I mirror to an external monitor, there is less ghosting, but there is ugly artifacting on the outside of sprite when stationary. See below.

enter image description here

Rounding my player’s position to integers in the Draw() command doesn’t help for either problem.

Does anyone have any thoughts about how to fix these issues?

Here is my game class:

using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input;  namespace MyMonoGame {     public class MyGame : Game     {         // declare variables         GraphicsDeviceManager graphics;         SpriteBatch sprite_batch;          // resolution management         int native_width;         int native_height;         int screen_width;         int screen_height;         int max_scale;         int horizontal_margin;         int vertical_margin;          // objects         Player player;          public MyGame()         {             // create GraphicsDeviceManager instance             graphics = new GraphicsDeviceManager(this);             // specify root directory             Content.RootDirectory = "Content";         }          protected override void Initialize()         {             // set window title             this.Window.Title = "My Game";              // create SpriteBatch instance, which can be used to draw textures.             sprite_batch = new SpriteBatch(GraphicsDevice);              // initialize some variables             native_width = 160;             native_height = 144;              // resolution management             // get screen size             screen_width = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;             screen_height = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;             // get max_scale, the maximum integer scale that will fit on the screen             // note: must be integer to prevent pixel distortion             int width_divisor = (int) Math.Floor((float)screen_width/(float)native_width);             int height_divisor = (int) Math.Floor((float)screen_height/(float)native_height);             max_scale = Math.Min(width_divisor, height_divisor);             // get margins for letterboxing and pillarboxing             int max_width = native_width * max_scale;             int max_height = native_height * max_scale;             horizontal_margin = (int)((screen_width - max_width)/2f);             vertical_margin = (int)((screen_height - max_height)/2f);              // toggle fullscreen             graphics.PreferredBackBufferWidth = screen_width;             graphics.PreferredBackBufferHeight = screen_height;             graphics.ToggleFullScreen();             GraphicsDevice.Viewport = new Viewport(horizontal_margin, vertical_margin, native_width * max_scale, native_height * max_scale);             graphics.ApplyChanges();              // objects             player = new Player(this);         }          protected override void LoadContent()         {         }          protected override void UnloadContent()         {         }          protected override void Update(GameTime gameTime)         {             if (Keyboard.GetState().IsKeyDown(Keys.Escape))                 Exit();              // update objects             player.Update(gameTime);         }          protected override void Draw(GameTime gameTime)         {             // clear window & fill with solid color             GraphicsDevice.Clear(Color.DarkRed);              // draw objects             var transform_matrix = Matrix.CreateScale(max_scale);             sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, transformMatrix: transform_matrix);             player.Draw(sprite_batch);             sprite_batch.End();         }     } } 

How to tell pair of RAID1 drives is successfully mirroring?

This is not an urgent problem, but I would like to know if I am currently making use of both of my hard drives (and/or if I can fix that).

Essentially, I purchased this computer without an OS and I have successfully installed Ubuntu Server on it.

The computer comes with 2 3TB hard drives.

My understanding is that I can either have a RAID0 configuration to have 6 TB of storage space, or a RAID1 configuration where 1 3 TB drive mirrors the other 3 TB drive.

Given that I have started to run analysis on the server, I am OK with mirroring the hard drive (RAID1).

However, I don’t think I have successfully done that. For example, if I check my /proc/mdstat file, this is what it says:

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md126 : active raid1 sda[1] sdb[0]       2930264064 blocks super external:/md127/0 [2/2] [UU]  md127 : inactive sda[1](S) sdb[0](S)       5040 blocks super external:imsm  unused devices: <none> 

Likewise, this how those drives are recognized using lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT

NAME         SIZE FSTYPE          TYPE  MOUNTPOINT sda          2.7T isw_raid_member disk └─md126      2.7T                 raid1   ├─md126p1  512M vfat            md    /boot/efi   └─md126p2  2.7T ext4            md    / sdb          2.7T isw_raid_member disk └─md126      2.7T                 raid1   ├─md126p1  512M vfat            md    /boot/efi   └─md126p2  2.7T ext4            md    / sr0         1024M                 rom 

However, this is the available space that I have using df:

Filesystem      1K-blocks      Used  Available Use% Mounted on udev             16370772         0   16370772   0% /dev tmpfs             3280440       940    3279500   1% /run /dev/md126p2   2882700496 223265236 2512931992   9% / tmpfs            16402180         0   16402180   0% /dev/shm tmpfs                5120         0       5120   0% /run/lock tmpfs            16402180         0   16402180   0% /sys/fs/cgroup /dev/md126p1       523248      6152     517096   2% /boot/efi tmpfs             3280436         0    3280436   0% /run/user/1000 

So, my questions are as follows:

  1. Am I actually mirroring my hard drive with a RAID1 configuration?
    If so, how can I recover my hard drive is something goes wrong?

    From the /proc/mdstat file, it looks like there is some sort of the link between the drives (since md126 is listed with super external:/md127/0, on the 2nd line)

  2. If both hard drives are not currently being used (for RAID1 mirroring), what do I need to change? Can I start mirroring my first hard drive without erasing everything currently on the first drive?

How can I mirroring multiple Ubuntu/Debian’s apt repo in one server by apt-mirror?

There are some server and PC in my studio running Ubuntu or Debian. Include Ubuntu 16.04/18.04, Debian 8/9. And there isalready have a Ubuntu 16.04 apt repo on a server, sync from a internet mirror everyday. Now, I need deploy the others release’s apt repo in this server. How can I do it? I configured /etc/apt/mirror.list like below and run sudo apt-mirror.

############# config ################## # # set base_path    /var/spool/apt-mirror # # set mirror_path  $  base_path/mirror # set skel_path    $  base_path/skel # set var_path     $  base_path/var # set cleanscript $  var_path/clean.sh set defaultarch  amd64 # set postmirror_script $  var_path/postmirror.sh # set run_postmirror 0 set nthreads     20 set _tilde 0 # ############# end config ##############  deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse  clean https://mirrors.tuna.tsinghua.edu.cn/ubuntu  deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free  clean https://mirrors.tuna.tsinghua.edu.cn/debian 

But it shows alots of errors like this:

Failed to open Release file from https://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-backports/Release at /usr/bin/apt-mirror line 507, <STREAM> line 5070. Failed to open Release file from https://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-backports/Release at /usr/bin/apt-mirror line 507, <STREAM> line 5070. Failed to open Release file from https://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-backports/Release at /usr/bin/apt-mirror line 507, <STREAM> line 5070. Processing translation indexes: [TTTTTTTT] Processing indexes: [PPPPPapt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-updates/main/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. apt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-updates/contrib/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. apt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-updates/non-free/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. apt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-backports/main/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. apt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-backports/contrib/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. apt-mirror: can't open index mirrors.tuna.tsinghua.edu.cn/debian///dists/jessie-backports/non-free/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800. 

Can anyone give some advice? Thank you!

sony xz premium Screen mirroring with pc – HDCP error

im trying to connect my sony xz premium with my pc , it first connected with no error but when i open any application it gives me this error

Mirroring error
Your output device does not support HDCP. Cannot mirror. You still can mirror some apps and unprotected content to the device.

I see some fixes to edit -> wfdconfig.xml by changing the value ContentProtection -> Valid from 1 to 0
This solution applies on rooted devices but i need solution without rooting my device

Having trouble mirroring my iphone to my mac bookwith Quick Time Player 7 Pro

I have an iphone 7S and would like to mirror what I am doing on the phone apps onto my macbook pro OSX. I followed the same instructions that everyone is giving by hooking up the phone with the charging cord to the computer. Went to quick time and clicked on file and chose new recording. It took me to a window with two options: to click and get more info that took me to a page that could not be found; or I had the option to buy something.. When I clicked on that it took me to the same page that was not found. I want to keep this simple with the cord and not wifi since it is not always available where I teach. any suggestions

Sharepoint 2013 updating failure due to health usage log in mirroring mode

I have our environment setup where we aren’t using health data logging however I continue to get messages that state that the health data database is in secondary mode when attempting to update. I get all the way through 9 of 10 processes in PSConfig but it refuses to finish the updates and apply them to my farm because its trying to modify the health data database.

This question is 2 parts:

1) How does PSConfig know where the health database is located? Essentially, how is the connection string generated?

2) Do we even need to worry about this database being available in the HA system? The database wouldn’t be located on the secondary server (because its not recommended to be in HA, so when we’re on the secondary server, the database won’t be able to be found…) so will this be a problem if we have it disabled in the central administration? What happens if we don’t include it in the HA, force it to go directly to a single server, then that server is down, how will we be able to use it if we ever enable it again?

Error: An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: The operation cannot be performed on database “SP2013_USAGE_HEALTH” because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group. ALTER DATABASE statement failed.

Everywhere I’ve seen just says “take it out of mirroring mode”, which is fine, but help me understand why it is this database is trying to be altered in the first place and why we shouldn’t have it in the HA system and why we don’t need to have it backed up or available in secondary mode or Disaster Recovery situation. If we don’t need it, why does it exist at all then?