Re: Rotating texture with even dimensions by 90 degree

Sylvain Becker <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <CADsB45o=eoEv8Ok0da32WJ-iJqAKn_dPXGxh1c7o2=FjBFWz0w@mail.gmail.com>
Hi,

Maybe you are hitting this bug:
https://bugzilla.libsdl.org/show_bug.cgi?id=2421
I have just added a test-case for rotations 0 / 90 / 180 / 270.

It fails for the "software" renderer with sometimes: offset, or image
truncation.
But it works for opengl, opengles and opengles2 renderers.

I haven't tested it with windows direct3d ... If you're on windows, you may
want to try a patch including in this bug.

Hope it helps,
Sylvain








On 7 August 2016 at 13:48, David Olofson <[email protected]> wrote:

> 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   |
> '---------------------------------------------------------------------'
> _______________________________________________
> SDL mailing list
> [email protected]
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



-- 
Sylvain Becker

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
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.