Re: stop texture from interpolating
From: Daniel Yankowsky (dyankowsky_at_verizon.net)
Date: 07/15/04
- Next message: ZMan: "Re: How can I draw a cylinder with curvatures?"
- Previous message: Daniel Yankowsky: "Re: Rendering Texture on Mesh.XXXX"
- In reply to: Jakob NIelsen: "stop texture from interpolating"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
- Next message: ZMan: "Re: How can I draw a cylinder with curvatures?"
- Previous message: Daniel Yankowsky: "Re: Rendering Texture on Mesh.XXXX"
- In reply to: Jakob NIelsen: "stop texture from interpolating"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|