Re: 2D in a 3D world

Matt J <[email protected]> Sat, 7 Aug 2010 21:42:52 -0400
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
Does your orthographic projection matrix account for the aspect ratio?

Matthew



> IIRC you're not guaranteed that the hardware won't filter even when you are
> at a perfect 1:1.  You may need to add some higher-level logic to manage
> your filtering states.  I could be wrong about this, but looking at our
> code, we're set to point-sampling for all HUD, UI overlays, etc.
>
> And you likely will need the 1/2 pixel adjustment.
>
> Double check to be sure you don't have anything strange going on with the
> mip range adjustments, etc.  Build your textures without mips just to be
> sure.
>
> Matt
>
>
> On Sat, Aug 7, 2010 at 4:20 PM, Jason Hughes <[email protected]>wrote:
>
>> I've been trying to resolve an issue where full screen textures being
>> drawn through the 3D system appear blurry.  I feel like I'm probably not
>> considering something.  Any ideas would be welcome!
>>
>> - I'm using an orthographic projection matrix along Z, a view matrix
>> that is pretty much identity except for some negations on various axes
>> to correct for LH/RH differences in the engine.
>> - The quad is mapped to the full screen both for vertex positions and
>> UVs (0,0,1) to (1,1,1), since the ortho matrix is 0..1, not in screen
>> pixels.
>> - The texture has the exactly the same number of pixels in both
>> directions as the back buffer.
>> - Back buffer and window match resolution exactly.
>> - Resolution is 1024x600 (but problem exists in other resolutions)
>> - Texture sampling is bilinear or anisotropic (shouldn't matter).  Both
>> show the problem.  Sometimes my 2D stuff needs to cleanly scale, so I
>> can't force point sampling globally.  Texture matrix is disabled.
>>
>> Steps I've taken to debug:
>> - I made a simple texture with regions that are alternating white and
>> black columns and rows that are 1, 2, and 4 pixels wide, so I could see
>> what was happening with texture sampling.  The result is an even gray in
>> the 1-pixel wide areas, but can be made brighter and darker depending on
>> the offset I put into the matrices.  Half-pixel adjustment didn't fix
>> it.  I never get white or black lines.
>> - I checked to make sure that the test image wasn't being munged by the
>> texture processing tools and it's perfectly clean (no GIGO).
>>
>> I can understand not getting perfect rasterization vertically due to the
>> height being a non-power-of-two, but I expected columns to be cleanly
>> mapped.  What else should I be looking for?
>>
>> Most appreciated,
>> JH
>>
>> Jason Hughes
>> President
>> Steel Penny Games
>> Austin, TX
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by
>>
>> Make an app they can't live without
>> Enter the BlackBerry Developer Challenge
>> http://p.sf.net/sfu/RIM-dev2dev
>> _______________________________________________
>> GDAlgorithms-list mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
>> Archives:
>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
>>
>>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> GDAlgorithms-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
>
Hi Jason:



-- 
-----
Matt Johnson
http://otowngraphics.blogspot.com

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list