Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Texturing : "on one seam, a half row of pixels from the other seam of the plain is visible" problem

Author
Message
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 17th Sep 2010 11:22
Uh i don't know if i managed to capture the problem in this title

Anyway, more details on the subject:

Let's make a standard built in plain with DBP. Let's texture it with a completely black image. Then let's change this image a bit, for example put some white pixels on it's very left side.

We will notice that the white has a half row of pixels from the black other side of the plain, and that other side also has a half row of the white pixels.

It is only a problem when the filtering is on. This problem has been there for ages, and i also saw it in many commercial games too.

There is nothing i can do about this? (except for streching the UV data... which gives a little distorted result...)
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Sep 2010 11:32
Hi Quel,

Direct3D uses the center of a pixel to interpolate the displayed color. However, UV coordinates of (0.0, 0.0) is actually the top-left of that top-left pixel, and not the middle. Therefore Direct3D interpolates the left pixel, with the most right pixel (as its repeated).

You can make an object clamp (uses pixel on the edge when out of the image), or flip/mirror the texture (both will probably give better results) using

SET OBJECT TEXTURE Object Number, Texturing Mode, Mipmap Flag

and setting Texturing Mode to 1 (flip/mirror texture) or 2 (clamp).

Cheers!
Sven B

Login to post a reply

Server time is: 2026-07-22 11:01:27
Your offset time is: 2026-07-22 11:01:27