render a portion of a texture (upscaled) with out affecting the border with SDL2?

render a portion of a texture (upscaled) with out affecting the border with SDL2?

[ad_1]

I observed that render a portion of the feel, upscaling it, it impacts is border values with the proximity of the surface remaining elements of the feel (when not utilizing Neareast neighbour interpolation)

This can be a drawback when these 2 parts are 2 completely different frames: principally it’s interpolating the border with the surface of the feel when want rescaling.

This causes body/sprite artifacts.

Take into account a texture atlas with a number of frames subsequent to one another. Copying one body is ensuing having the border interpolated with one other body and this most probably is creating an artifact.

Is there any strategy to strictly render a portion of texture making SDL Renderer ignoring no matter else is exterior the rect?

Merely copy and rescale solely the rect given?

e.g:
The two frames:
enter image description here

1st body on the underside is altered by the values of the 2nd body
enter image description here

2nd body on the highest is altered by the values of the first body
enter image description here

This difficulty would not occur if including 1 pixel pad among the many 2 frames or utilizing 1 texture per body. I’m questioning is there any SDL2 settings to keep away from this undesirable (subpixels?) interpolation?

Please additionally be aware that each one the operations are carried out with actual integers, so do not perceive actually from the place that “noise” might come from.
May it’s from some Video drivers settings?

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply