#171  
Old 18th June 2013, 02:33 AM
GPDP GPDP is offline
Senior Member
 
Join Date: May 2013
Posts: 146
Default

Are you sure that's dithering? Obviously I haven't tested that particular ROM myself, but I did notice using SoftGraphic that on some games, with the "filtering" enabled, there was a "static" effect on black backgrounds and borders and such.



I posted this shot earlier in the thread. As you can notice, on the black borders around the image it looks like there is noise or artifacting. Disabling the filter gets rid of it. I was wondering what was up with that, but I don't think it's dithering as the "noise" or "static" moves around.
Reply With Quote
  #172  
Old 18th June 2013, 02:34 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

the mess rdp didn't apply dither if the pixel format of color frame buffer is 16 bits.

Code:
void n64_rdp::VideoUpdate(n64_periphs *n64, bitmap_rgb32 &bitmap)
{
   switch(n64->vi_control & 0x3)
   {
      case PIXEL_SIZE_16BIT:
         VideoUpdate16(n64, bitmap);
         break;

      case PIXEL_SIZE_32BIT:
         VideoUpdate32(n64, bitmap);
         break;

      default:
         //fatalerror("Unsupported framebuffer depth: m_fb_size=%d\n", MiscState.FBSize);
         break;
   }
}
Code:
void n64_rdp::VideoUpdate16(n64_periphs *n64, bitmap_rgb32 &bitmap)
{
   UINT16 *frame_buffer = (UINT16*)&rdram[(n64->vi_origin & 0xffffff) >> 2];

   INT32 hdiff = (n64->vi_hstart & 0x3ff) - ((n64->vi_hstart >> 16) & 0x3ff);
   float hcoeff = ((float)(n64->vi_xscale & 0xfff) / (1 << 10));
   UINT32 hres = ((float)hdiff * hcoeff);
   INT32 invisiblewidth = n64->vi_width - hres;

   INT32 vdiff = ((n64->vi_vstart & 0x3ff) - ((n64->vi_vstart >> 16) & 0x3ff)) >> 1;
   float vcoeff = ((float)(n64->vi_yscale & 0xfff) / (1 << 10));
   UINT32 vres = ((float)vdiff * vcoeff);

   if (vdiff <= 0 || hdiff <= 0)
   {
      return;
   }

   if (hres > 640) // Needed by Top Gear Overdrive (E)
   {
      invisiblewidth += (hres - 640);
      hres = 640;
   }

   if (vres > bitmap.height()) // makes Perfect Dark boot w/o crashing
   {
      vres = bitmap.height();
   }

   UINT32 pixels = 0;

   if (frame_buffer)
   {
      for(int j = 0; j < vres; j++)
      {
         UINT32 *d = &bitmap.pix32(j);

         for(int i = 0; i < hres; i++)
         {
            Color c;

            UINT16 pix = frame_buffer[pixels ^ WORD_ADDR_XOR];
            pixels++;

            d[i] = c.c >> 8;//(r << 16) | (g << 8) | b; // Fix me for endianness
         }
         pixels +=invisiblewidth;
      }
   }
}
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit
Reply With Quote
  #173  
Old 18th June 2013, 02:42 AM
mudlord_ mudlord_ is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Dec 2012
Posts: 381
Default

Quote:
Originally Posted by FatCat View Post
(Yes I know the right half of the emulated screen shot is slightly blurred; it's because I haven't figured out how to make it go away! But angrylion you said you're unable to reproduce the partially blurred screen on different video cards so I guess I'm missing some sort of DirectDraw build config parameter or something; we can figure that out later.)
Or you can use OpenGL, and have direct control over filtering of quads.
Reply With Quote
  #174  
Old 18th June 2013, 02:43 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by FatCat View Post
SoftGraphic rewrite by suanyuan is entirely closed-source and has no current intention of merging in angrylion's optimizations.
I released the modified source of angrylion rdp (ftp version), didn't I?

And I am trying to replace argrylion's rdp with MESS rdp, because the codes of MESS rdp are written with C++ class and are easy to understand and modify. I guess argrylion rewrote mess rdp, replaced c++ classes with c functions and plus some modifications.
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit

Last edited by shunyuan; 18th June 2013 at 03:42 AM.
Reply With Quote
  #175  
Old 18th June 2013, 03:06 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by GPDP View Post
Are you sure that's dithering? Obviously I haven't tested that particular ROM myself, but I did notice using SoftGraphic that on some games, with the "filtering" enabled, there was a "static" effect on black backgrounds and borders and such.

I posted this shot earlier in the thread. As you can notice, on the black borders around the image it looks like there is noise or artifacting. Disabling the filter gets rid of it. I was wondering what was up with that, but I don't think it's dithering as the "noise" or "static" moves around.
When filter is on, there are anti-ailas, gamma correction and color dither will apply to frame buffer.
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit
Reply With Quote
  #176  
Old 18th June 2013, 03:07 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Believe me, I have already tried porting this plugin back to use SDL, but it's so fixated on angrylion's DirectDraw code that I lack the experience to switch APIs to get rid of the blur issue we're having. I can only focus on optimizing the RDP and merging in the accuracy changes first and delay API-specific questions for last.

I am fine however with the (almost) pure C interface. C++ stuff never did make sense to me.
I don't think I will ever go back to the original MAME source code. You can have it. :P It's easy to build off my GitHub archive.
Reply With Quote
  #177  
Old 18th June 2013, 03:09 AM
GPDP GPDP is offline
Senior Member
 
Join Date: May 2013
Posts: 146
Default

Quote:
Originally Posted by suanyuan View Post
When filter is on, there are anti-ailas, gamma correction and color dither will apply to frame buffer.
I see that, but is that what is responsible for the static on black backgrounds?
Reply With Quote
  #178  
Old 18th June 2013, 03:23 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by GPDP View Post
I see that, but is that what is responsible for the static on black backgrounds?
I believe it is caused by dither or gamma dither code.
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit
Reply With Quote
  #179  
Old 18th June 2013, 03:52 AM
angrylion angrylion is offline
Member
 
Join Date: Oct 2008
Location: Moscow, Russia
Posts: 36
Default

I've improved the situation with dithering in r73. Absolute Crap #2 looks correct to me. If somebody thinks that Virtual Chess 64 is incorrect, please provide a screenshot taken with a capture card.

Quote:
Originally Posted by GPDP View Post
I posted this shot earlier in the thread. As you can notice, on the black borders around the image it looks like there is noise or artifacting. Disabling the filter gets rid of it. I was wondering what was up with that, but I don't think it's dithering as the "noise" or "static" moves around.
If you are talking about black spikes, they are present on the real console. There are literally dozens of youtube videos recorded from capture cards confirming this, just search youtube. For Star Fox 64, see this video /watch?v=_DNhvjWjQI0 (stupid forum doesn't allow me to post links), it is most evident at 1:05. For Snowboard Kids, see this video: /watch?v=6ru21VEK1IY , black spikes are abundant there.
Reply With Quote
  #180  
Old 18th June 2013, 04:00 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Thanks I will check r73 when I am able to finish merging it in.

[VirtualChess did the same thing as Absolute Crap; I just had dsx! capture Crap since that was more simple. According to him there is no dithering in the background for that game either but again I will check when I get teh chance.]

Quote:
Originally Posted by angrylion View Post
For Star Fox 64, see this video http://www.youtube.com/watch?v=_DNhvjWjQI0 (stupid forum doesn't allow me to post links), it is most evident at 1:05. For Snowboard Kids, see this video: http://www.youtube.com/watch?v=6ru21VEK1IY , black spikes are abundant there.
Yeah usually zilmar's been lax about approving some links, but when you reach 30 posts on the forum the restriction should go away and let you post them freely. (A security attempt to terminate auto-bot advertisements that used to roam on the forum.)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.