Perspective correct texturing without d3d

Filed under: Game Maker

persp-correct texturing
I whipped this up after someone posted on the GMC asking about it. Mark’s naiive approach to drawing in version 6 and above resulted in it having a d3d and normal mode when both are esentially the same thing. Enabling d3d makes a number of things impossible. Mainly, surfaces. Not having d3d makes other things impossible like zbuffer and perspective correct texturing.

If you ever try to draw a skewed or distorted polygon with textures, you’ll see that there’s a weird artifact. Unfortunely only Mark can fix this, but we can approximate a solution by subdividing our polygon into several segments and interpolating the texture coordinates for them. By providing properly calculated UVs to each segment, we reduce the error the renderer produces by giving it more clues as to what the UV values should actually be.

Perspective Correct Texturing

Related posts

Tags: ,

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Permalink Comments (4) GearGOD Oct 2, 2007

4 Responses to “Perspective correct texturing without d3d”

  1. sandrarsandrar Says:

    Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  2. awfulawful Says:

    Do you think we should submit this as a bug to be fixed in GM 8?

  3.  Bicubic Says:

    You can try.
    My solution to Game Maker’s problem is Aziel =)

  4. NeatWolfNeatWolf Says:

    Thanks for your post The Master, I needed a simple perspective corrected polygon to simulate flowing water in a 2d game (GM8.1), and I think I’ll adopt your solution :)


Leave a Reply