Re: stop texture from interpolating

From: Daniel Yankowsky (dyankowsky_at_verizon.net)
Date: 07/15/04


Date: Thu, 15 Jul 2004 01:59:22 GMT

I think that the problem that you are having is related to filtering. You
probably want to set your device's sampler state to use point filtering
instead of linear filtering.

dev.SamplerState.MagFilter = TextureFilter.Point;
dev.SamplerState.MinFilter = TextureFilter.Point;
dev.SamplerState.MipFilter = TextureFilter.Point;

"Jakob NIelsen" <a@b.c> wrote in message
news:ehfMXeNZEHA.3688@TK2MSFTNGP12.phx.gbl...
> I am rendering a "terrain" with a large number of triangles. The triangles
> are drawn as indexed primitives, with one vertex for each grid position in
> the landscape.
> They are also given a texture coorinate based on some force value at each
> grid position.
> The problem is that if an edge in a triangle connects two vertices with
> difrent texture coordinates, then the edge is painted with a texture value
> which is between the two real values.
>
> imagine that a force of 1 is blue. 5 is yellow and 10 is green
> An edge connects force 1 and 10. The edge is now drawn mostly yellow.
> When even more colors exist between the two real ones, they are all drawn
> along the line.
>
> How do I get one color all the way? No interpolation. If the first vertex
in
> the triangle is blue, then all of the triangle is blue.
> This interpolation gives a very false image, which cant really be used to
> much.
>
> An example is shown here. www.greenleaf.dk/texture.jpg
> The colors should be dark and light green - certainly not yellow, white
and
> blue.
>
>



Relevant Pages

  • Re: stop texture from interpolating
    ... different or different color) if you don't want continuity. ... > difrent texture coordinates, then the edge is painted with a texture value ... No interpolation. ... > the triangle is blue, then all of the triangle is blue. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Texture 3D interpolation between layers
    ... I think that the best method to see how it does interpolation is to ... apply a 3d texture to a vertical line:) (or a vertical triangle like ... becomes an triangle edge, ... but withouth changes with the original polygon. ...
    (comp.graphics.api.opengl)
  • Re: Tiling large bitmap, what size tile is best?
    ... > This is a scientific application that allows users to zoom in and pan ... optimize for speed over quality. ... > dependent-read texture. ... Another common thing you'll want to watch for is texture filtering and texel ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: About implementing 2D Sprites
    ... The filter flags you apply when loading the texture from a file do not ... When ID3DXSprite renders with this texture, ... On the other hand, if a filtering method is provided, it will be used to ... of the original image size to the power-of-2 texture size, the sprite ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Texture bilinear filtering (hardware vs. pixel shader)
    ... My app uses bilinear filtering on a V16U16 texture and looks up the result ... It looks like the hardware filtering is done in low ...
    (microsoft.public.win32.programmer.directx.graphics)