Results 1 to 8 of 8
  1. #1
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174

    Texture perspective correction

    I'm trying to figure out how to implement texture perspective correction in a software renderer. Anyone can explain me how is it supposed to work ?



    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    Currently, i'm interpolating u/w, v/w and w and i multiply the interpolated values by w to find the texture coordinates of each points.
    It seems to work most of the time but not always. The problem seems to be the clipped triangles especially when w is around 0... I don't know how to change texture coordinates when i clip to w~=0

  3. #3
    Master of the Emulation Flame MasterPhW's Avatar
    Join Date
    May 2004
    Location
    come-to-hell
    Posts
    1,978
    Why are you not asking the type of the hq2-4x filters.
    The objects he is filtering seems that there is a texture perspective correction used.
    You know the website? http://www.hiend3d.com/smartflt.html
    It's just a try. Hope it helps (or it's the right thing I'm thinking... )
    The Future of Emulation: Emulate a High End Computer on a Low End System
    Main: Intel Core i7 (Lynnfiled) 860 (@3.802Ghz) | 8 GB DDR3-1333 | ATI XFX HD 5750 PCI-E | ATI High Definition Audio Device | 256 GB SSD + 3 TB Internal SATA2 + 4 TB external | Windows 7 Professional X64 SP1 MSDNAA
    Netbook: Asus EeePC 1015PEM | Intel Atom Dual Core N550 (1,5GHz) | 2GB DDR3-1066 | Intel GMA 3150 | 250GB HDD | Win 7 Starter
    Old One: AMD Athlon 64 X2 4200+ (2x2.5Ghz; S939) | MSI KbT Neo2-F V2.0 | 2x1GB Corsair Value VS1GBKIT400 | Radeon HD 3850 512 MB/AGP8x | Creative SB Audigy LS | 2TB (4x500GB SATA2 HDDs Raid0) | Windows 7 Business X64 SP1 MSDNAA



  4. #4
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    Perspective correction is different than texture filtering. Without perspective correction, textures look like what you get on a PSX... Nowadays, perspective correction is achived automatically by all 3d hardware. But here's i'm trying to do a software renderer. A software renderer is fun to implement but you have to face a lot of problems that have been eradicated for ages by various api or hardware.

    I'm pretty sure now, that i've implemented it correctly except for triangles that are clipped at w=0.

  5. #5
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    Well, i've finally found a solution, it's probably mathematically incorect but at least, it's not visible

  6. #6
    Emu Author
    Join Date
    Apr 2003
    Posts
    248
    The reason you are having trouble is that you're supposed to clip your triangles in 3D space to the frustum planes, way before worrying about interpolating u/w and stuff
    If you do that there will be no problems like this whatsoever.

  7. #7
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    yea... would have been easier to do it this way but.... it's in a n64 gfx plugin and i was trying to code it like the original ucode. And this ucode is transforming each vertex with the modelview and projection matrix before defining the triangles and clipping them, so i was supposing there was a way to clip after the projection....

  8. #8
    Emu Author
    Join Date
    Apr 2003
    Posts
    248
    ah ok, makes sense.

Similar Threads

  1. TPL texture unpacker/converter
    By Nemesis in forum Dolphin
    Replies: 10
    Last Post: June 27th, 2009, 08:44
  2. a texture viewer and supercross2k
    By olivieryuyu in forum Programming
    Replies: 0
    Last Post: September 13th, 2004, 08:39
  3. texture junctions
    By hizoka10 in forum Project64
    Replies: 0
    Last Post: March 15th, 2004, 16:40
  4. YUV 16 texture format?
    By Rice in forum Programming
    Replies: 8
    Last Post: June 7th, 2003, 16:04
  5. Replies: 3
    Last Post: September 12th, 2002, 06:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •