Re: Rotating texture with even dimensions by 90 degree

David Olofson <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <CAAcqxQoe2GcceXPF-HEQto498Lbx2NSkrHsBO6i=ycJBgBo2fg@mail.gmail.com>
My guess is that you're pretty much the only one using that feature
with a pixel precision requirement at this point. (I'm not using it in
Kobo Redux, for example, because rotating sprites and tiles breaks any
any directional lighting the art may have.)

It may also be that the problem only occurs on certain platforms or drivers.

Anyway, when dealing with a 3D API, you typically have to take the
size of pixels and texels in account, and more specifically, make sure
your texel filters hit the center of pixels, rather than one of the
corners. With filtering (biliniar or similar), it's not all that
critical, but with "nearest", even the slightest rounding error in the
wrong direction means you get the wrong texel. A "2D" API built over a
3D API, like the SDL one, is supposed to take care of this internally,
as it's generally not accessible through such an API.

So, I suspect it's a rounding error in the transform, and either SDL
isn't taking that in account, or it only happens in certain
environments. Have you tried using other SDL renderers (OpenGL, D3D,
software...), or running it on a different OS, or just another
computer, to see if the problem is still there?

On Mon, Aug 1, 2016 at 2:28 AM, stewambo <[email protected]> wrote:
> Still no answers? I thought there were even some devs of SDL here?
> In the meantime i used a dirtly hack that just shifted the rotated textures
> back by one pixel, but when combining the rotation witn a scaling operation
> the problem is even worse, so help is still highly appreciated...
>
> _______________________________________________
> SDL mailing list
> [email protected]
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



-- 
//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|   http://consulting.olofson.net          http://olofsonarcade.com   |
'---------------------------------------------------------------------'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.