<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Single-pixel precision issues with GTX 500 series</title>
		<link>http://www.allegro.cc/forums/view/617633</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 23 Nov 2018 04:37:05 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m noticing that there are single-pixel misalignments in both primitives and texture coords when running my game on my desktop&#39;s GTX card. My laptop&#39;s Intel graphics (and other Geforce cards I&#39;ve tried) seem absolutely fine, though I&#39;ve only run it on Linux thus far. All are capable of multisampling, and I have it turned on in all cases.</p><p>In the screenshot below, you&#39;ll note the stars in the background look to be &#39;between pixels&#39;, and the orb sprite (which is rotated) is displaying an edge from something else on the spritesheet. These artifacts aren&#39;t there on other cards.</p><p>Any ideas?</p><p><span class="remote-thumbnail"><span class="json">{"name":"611768","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/b\/9bae262f6badaf078a5bb31e10b6d9f6.png","w":606,"h":402,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/b\/9bae262f6badaf078a5bb31e10b6d9f6"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/9/b/9bae262f6badaf078a5bb31e10b6d9f6-240.jpg" alt="611768" width="240" height="159" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Wed, 21 Nov 2018 23:27:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you using correct pixel coordinates?</p><p><a href="https://www.allegro.cc/manual/5/primitives.html">https://www.allegro.cc/manual/5/primitives.html</a></p><p>[edit] And the same/newest version of Allegro on each system?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Thu, 22 Nov 2018 02:01:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes to both - as I said, the graphics seem fine on other cards.</p><p>Even if I wasn&#39;t offsetting the graphics&#39; positions by 0.5, surely this wouldn&#39;t explain why the misalignment we&#39;re seeing is (in the majority) only vertical and not horizontal?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Thu, 22 Nov 2018 04:47:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To be clear:</p><p> 1 - I am trying to help.</p><p> 2 - Those questions I asked may actually provide clues.</p><p>Can you post a minimal code example and I&#39;ll run it?</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617633/1040165#target">dthompson</a> said:</div><div class="quote"><p>
Even if I wasn&#39;t offsetting the graphics&#39; positions by 0.5, surely this wouldn&#39;t explain why the misalignment we&#39;re seeing is (in the majority) only vertical and not horizontal?
</p></div></div><p>
When you use wrong coordinates, it does whatever the driver wants to do. It may simply be &quot;undefined&quot; and you&#39;ve got different drivers choosing a different fix. </p><p>What systems are you trying on? 3 Linux boxes? One intel, one geforce, and one geforce 560? All running the same Linux and driver versions? (Note: Linux supports both open-source and nVidia drivers for GeForce cards.)</p><p> - You&#39;re not stretching the bitmap or window, right? (all bases covered)</p><p> - Are you using any Allegro or OpenGL transformations?</p><p> - Have you made sure mip-mapping is off?</p><p> - What Allegro version? Is it the newest?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Thu, 22 Nov 2018 08:17:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry - wasn&#39;t trying to come off as resentful <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> of course, I appreciate the help.</p><p>The most minimal example I can think of would be:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;allegro5/allegro5.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro_primitives.h&gt;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</span>  <a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>  <a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a><span class="k2">(</span>ALLEGRO_SAMPLE_BUFFERS, <span class="n">1</span>, ALLEGRO_SUGGEST<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>  <a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a><span class="k2">(</span>ALLEGRO_SAMPLES, <span class="n">8</span>, ALLEGRO_SUGGEST<span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a><span class="k3">*</span> disp <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">100</span>, <span class="n">100</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>
<span class="number"> 11</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT_QUEUE"><span class="a">ALLEGRO_EVENT_QUEUE</span></a><span class="k3">*</span> queue <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_event_queue"><span class="a">al_create_event_queue</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>
<span class="number"> 13</span>  <a href="http://www.allegro.cc/manual/al_init_primitives_addon"><span class="a">al_init_primitives_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>
<span class="number"> 15</span>  <span class="c">// draw code:</span>
<span class="number"> 16</span>  <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_map_rgb_f"><span class="a">al_map_rgb_f</span></a><span class="k2">(</span><span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 17</span>  <a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span><span class="n">0</span>.<span class="n">5</span>, <span class="n">0</span>.<span class="n">5</span>, <span class="n">0</span>.<span class="n">5</span>, <span class="n">3</span>.<span class="n">5</span>, <a href="http://www.allegro.cc/manual/al_map_rgb_f"><span class="a">al_map_rgb_f</span></a><span class="k2">(</span><span class="n">1</span>,<span class="n">1</span>,<span class="n">1</span><span class="k2">)</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>  <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>
<span class="number"> 20</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT"><span class="a">ALLEGRO_EVENT</span></a> e<span class="k2">;</span>
<span class="number"> 21</span>  <span class="k1">do</span>
<span class="number"> 22</span>  <span class="k2">{</span>
<span class="number"> 23</span>    <a href="http://www.allegro.cc/manual/al_wait_for_event"><span class="a">al_wait_for_event</span></a><span class="k2">(</span>queue, <span class="k3">&amp;</span>e<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span>  <span class="k2">}</span> <span class="k1">while</span><span class="k2">(</span>e.type <span class="k3">!</span><span class="k3">=</span> ALLEGRO_EVENT_KEY_DOWN<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span>
<span class="number"> 26</span>  <a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a><span class="k2">(</span>disp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 27</span>  <a href="http://www.allegro.cc/manual/al_destroy_event_queue"><span class="a">al_destroy_event_queue</span></a><span class="k2">(</span>queue<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 28</span>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 29</span><span class="k2">}</span>
</div></div><p>

On other cards, this draws a solid line from (0,0) to (0,2). On the GTX, this results in blurs:</p><p><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/e/fe5074db6cd235539b274be517bbc8c1.png" alt="611769" width="179" height="147" /></p><p>In answer to your questions-</p><ul><li><p>Yes, the three Linux boxes I&#39;ve tried are Intel, (some newer) Geforce M card, and my desktop&#39;s GTX 560. All used their latest stable proprietary drivers (390.77 for Geforce)</p></li><li><p>Nope, no stretching or scaling in their window managers</p></li><li><p>My original code used various transforms, but the above doesn&#39;t</p></li><li><p>Mipmapping was on in my original code; do you reckon this is causing the texture issues? (if so, why card-specific?)</p></li><li><p>Every example I ran used Allegro 5.2.4</p></li></ul><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Thu, 22 Nov 2018 17:58:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Use 0.5/0.0 to 0.5/3.0 of you want your line to cover just the three pixels.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Fri, 23 Nov 2018 04:37:05 +0000</pubDate>
	</item>
</rss>
