PCSX2 - The Playstation 2 emulator - Developer Blog PCSX2 a Playstation 2 emulator for Windows, Linux and Mac https://pcsx2.net/developer-blog.feed 2018-02-21T01:06:14+02:00 PCSX2 team admin@pcsx2.net Joomla! - Open Source Content Management Q & A - picking our noes 2017-02-14T01:06:23+02:00 2017-02-14T01:06:23+02:00 https://pcsx2.net/developer-blog/282-q-a-picking-our-noes.html Gregory admin@pcsx2.net <p style="text-align: center;"><span style="text-align: center; font-weight: bold;">Quality Assurance</span> <span>&nbsp;</span></p> <p><span style="text-align: justify;">Quality &amp; assurance is a full time job and it is a complex topic. Quality always comes with a trade-off of time vs cost. By definition, open source projects make a false start here. Spending $100,000 on a formal analysis tool isn't possible. Neither is dedicating the only dev to full-time testing. Fortunately, some tools are free (even open source) such as Valgrind or Clang-Tidy and some services are free to use, such as Coverity. We currently don't have a high number of committers, but we have lots of dedicated testers and users.&nbsp;Big thanks to all of them, because without them nothing would have been possible. So quality is possible. Maybe we can't reach the 100% perfect quality state but we can reach a decent level.</span></p> <p style="text-align: center;"><span style="text-align: center; font-weight: bold;">Quality Assurance</span> <span>&nbsp;</span></p> <p><span style="text-align: justify;">Quality &amp; assurance is a full time job and it is a complex topic. Quality always comes with a trade-off of time vs cost. By definition, open source projects make a false start here. Spending $100,000 on a formal analysis tool isn't possible. Neither is dedicating the only dev to full-time testing. Fortunately, some tools are free (even open source) such as Valgrind or Clang-Tidy and some services are free to use, such as Coverity. We currently don't have a high number of committers, but we have lots of dedicated testers and users.&nbsp;Big thanks to all of them, because without them nothing would have been possible. So quality is possible. Maybe we can't reach the 100% perfect quality state but we can reach a decent level.</span></p> Alpha Testing in the GS world 2016-09-25T17:25:38+03:00 2016-09-25T17:25:38+03:00 https://pcsx2.net/developer-blog/279-alpha-testing-gs-world.html Gregory admin@pcsx2.net <p>Today, we will discuss the alpha testing feature of the GS. The feature is very basic but awful to emulate. Yet again, GS capability is 10 miles ahead of current GPUs.<br /> <br /> Let's first look at the graphics pipeline to understand what alpha testing is. The main purpose of the graphic rendering pipeline is to compute the&nbsp;color of a pixel. But the color isn't enough if you want to render a 3D scene. Standard renderers use a Z-buffer, also called a depth buffer. They are based on a pixel test (note: they ought to be called fragment tests). It is really easy; If the test fails (pixel is rendered behind the current one), you discard the color depth value. If the test passes (pixel is rendered above the current one), you update both, color and depth values.</p> <p>Today, we will discuss the alpha testing feature of the GS. The feature is very basic but awful to emulate. Yet again, GS capability is 10 miles ahead of current GPUs.<br /> <br /> Let's first look at the graphics pipeline to understand what alpha testing is. The main purpose of the graphic rendering pipeline is to compute the&nbsp;color of a pixel. But the color isn't enough if you want to render a 3D scene. Standard renderers use a Z-buffer, also called a depth buffer. They are based on a pixel test (note: they ought to be called fragment tests). It is really easy; If the test fails (pixel is rendered behind the current one), you discard the color depth value. If the test passes (pixel is rendered above the current one), you update both, color and depth values.</p> Channel Shuffle Effect 2016-08-03T14:04:38+03:00 2016-08-03T14:04:38+03:00 https://pcsx2.net/developer-blog/277-channel-shuffle-effect.html Gregory admin@pcsx2.net <div>&nbsp;</div> <div style="text-align: center;"><span style="font-weight: bold;"><span style="font-size: x-large;">I) Introduction</span></span></div> <p style="text-align: justify;"><br /> Dear PCSX2 users,<br /> <br /> GSdx got various improvements recently, issues were fixed on games such as Metal Gear Solid 3, Gran Turismo 4, Tekken 5, Tales of Legendia and Urban Chaos. All of those games use a certain effect that I have nicknamed as the <span style="font-weight: bold;">"Channel Shuffle Effect"</span>. All games use a variation of this effect but each time the effect proved to be memory expensive and it was very slow, even with the best computers. The effect is very interesting because it explains the rendering/GPU architecture evolution from a fixed unit to a processor. So I decided to take this opportunity to explain it the best I can.</p> <p>&nbsp;</p> <div>&nbsp;</div> <div style="text-align: center;"><span style="font-weight: bold;"><span style="font-size: x-large;">I) Introduction</span></span></div> <p style="text-align: justify;"><br /> Dear PCSX2 users,<br /> <br /> GSdx got various improvements recently, issues were fixed on games such as Metal Gear Solid 3, Gran Turismo 4, Tekken 5, Tales of Legendia and Urban Chaos. All of those games use a certain effect that I have nicknamed as the <span style="font-weight: bold;">"Channel Shuffle Effect"</span>. All games use a variation of this effect but each time the effect proved to be memory expensive and it was very slow, even with the best computers. The effect is very interesting because it explains the rendering/GPU architecture evolution from a fixed unit to a processor. So I decided to take this opportunity to explain it the best I can.</p> <p>&nbsp;</p> Explanation of impossible blend 2015-06-08T00:08:28+03:00 2015-06-08T00:08:28+03:00 https://pcsx2.net/developer-blog/268-explanation-impossible-blend.html Gregory admin@pcsx2.net <p>The goal of blending is to combine two colors. The general equation on a modern GPU is:</p> <p>&nbsp;</p> <div class="title">Code:</div> <p><code>coefficient1 * color1 +/- coefficient2 * color2</code><br /><br /></p> <p>Color1/Color 2 are either the source color or the destination color.<br />Coefficient1/Coefficient2 are either the alpha value (transparency) of source/source2/destination, 1 - alpha, or a constant. The GPU will clamp the coefficients to [0;1]</p> <p>The general equation on the PS2 however is:</p> <p>&nbsp;</p> <div class="title">Code:</div> <p><code>(Color1 - Color2) * Coefficient + Color3</code><br /><br />Color1/Color2/Color3 are either the source or destination color or zero.</p> <p>Coefficient is the alpha value (transparency) of the source or destination, or a constant.</p> <p>The goal of blending is to combine two colors. The general equation on a modern GPU is:</p> <p>&nbsp;</p> <div class="title">Code:</div> <p><code>coefficient1 * color1 +/- coefficient2 * color2</code><br /><br /></p> <p>Color1/Color 2 are either the source color or the destination color.<br />Coefficient1/Coefficient2 are either the alpha value (transparency) of source/source2/destination, 1 - alpha, or a constant. The GPU will clamp the coefficients to [0;1]</p> <p>The general equation on the PS2 however is:</p> <p>&nbsp;</p> <div class="title">Code:</div> <p><code>(Color1 - Color2) * Coefficient + Color3</code><br /><br />Color1/Color2/Color3 are either the source or destination color or zero.</p> <p>Coefficient is the alpha value (transparency) of the source or destination, or a constant.</p> Explanation of why hacks are needed to fix upscaling related glitches 2015-06-08T00:07:40+03:00 2015-06-08T00:07:40+03:00 https://pcsx2.net/developer-blog/267-explanation-hacks-needed-for-upscaling-glitches.html Gregory admin@pcsx2.net <p>First, let's explain aliasing and why people are so keen on removing it with anti-aliasing. Let's start with some math :)</p> <p>In the real world, signals are often "continuous." If you take two points A and B and A is very close to B then F(A) is very close to F(B). But a screen is not continuous. If you take two pixels side by side, one can be white while the other is black.</p> <p>First, let's explain aliasing and why people are so keen on removing it with anti-aliasing. Let's start with some math :)</p> <p>In the real world, signals are often "continuous." If you take two points A and B and A is very close to B then F(A) is very close to F(B). But a screen is not continuous. If you take two pixels side by side, one can be white while the other is black.</p> MMU mini-series part 2 of 4 2015-02-02T12:22:52+02:00 2015-02-02T12:22:52+02:00 https://pcsx2.net/developer-blog/265-mmu-mini-series-part2-4.html Gregory admin@pcsx2.net <p>Hello PCSX2 followers,<br /> <br /> After a long delay, this is the second part of the MMU mini-presentation. In the previous chapter we saw that MMU allows giving a virtual address space to a process. Besides, I told you MMU controls the cache behavior (cacheable/uncached accelerated/uncached). First, let me quickly explain the different cache accesses. Then I will introduce the default memory mapping of the PS2.</p> <p>Hello PCSX2 followers,<br /> <br /> After a long delay, this is the second part of the MMU mini-presentation. In the previous chapter we saw that MMU allows giving a virtual address space to a process. Besides, I told you MMU controls the cache behavior (cacheable/uncached accelerated/uncached). First, let me quickly explain the different cache accesses. Then I will introduce the default memory mapping of the PS2.</p> MMU mini-series 2014-11-23T15:03:13+02:00 2014-11-23T15:03:13+02:00 https://pcsx2.net/developer-blog/263-mmu-mini-series.html Gregory admin@pcsx2.net <p>Hello PCSX2 followers,<br /><br />It's been a while since the last developer blog entry. I would like to resume this old tradition.<br /><br />I will present you a mini series on the MMU (memory management unit) and virtual memory. Jake and ZeroFrog already wrote some posts relating to this topic:<br />* <a href="https://pcsx2.net/developer-blog/218-so-maybe-it-s-about-time-we-explained-vtlb.html" target="_blank">http://pcsx2.net/developer-blog/218-so-maybe-it-s-about-time-we-explained-vtlb.html</a><br />* <a href="https://pcsx2.net/developer-blog/231-virtual-memory.html" target="_blank">http://pcsx2.net/developer-blog/231-virtual-memory.html</a><br /><br />This time, I will explain the goal of MMU and why it is mandatory for modern systems. The MMU is a cornerstone for stability and security. I will also explain why it could be costly for the performance on the native system.<br /><br />On the next article, I will present you the PS2 address space and how the MMU is really used.</p> <p>Hello PCSX2 followers,<br /><br />It's been a while since the last developer blog entry. I would like to resume this old tradition.<br /><br />I will present you a mini series on the MMU (memory management unit) and virtual memory. Jake and ZeroFrog already wrote some posts relating to this topic:<br />* <a href="https://pcsx2.net/developer-blog/218-so-maybe-it-s-about-time-we-explained-vtlb.html" target="_blank">http://pcsx2.net/developer-blog/218-so-maybe-it-s-about-time-we-explained-vtlb.html</a><br />* <a href="https://pcsx2.net/developer-blog/231-virtual-memory.html" target="_blank">http://pcsx2.net/developer-blog/231-virtual-memory.html</a><br /><br />This time, I will explain the goal of MMU and why it is mandatory for modern systems. The MMU is a cornerstone for stability and security. I will also explain why it could be costly for the performance on the native system.<br /><br />On the next article, I will present you the PS2 address space and how the MMU is really used.</p>