2D in 3D Texture Woe using C#

2D in 3D Texture Woe using C#

Post by Balaa » Sun, 11 Dec 2005 15:51:51

I've come across a texture problem in my 2D tile game in 3D.

I know about the texel pixel issues when trying to create a 2D game
using 3D quads described here:

Basically I can render my tiles perfectly but when I move the camera,
(by transforming the view matrix) sometimes a border line of my tiles
textures will stretch to two pixels or vanish completely.

I've taken the code out and put it into a very simple program to
demonstrate my problem easily.

Heres the source code: http://www.yqcomputer.com/

Someone suggested I clamp the textures - I did this and it removed pink
lines I was getting but the lines expanding and disspearing remained.

Here's a screen shot of what it looks like at the start:


And after moving the camera down a bit:


My wild guess is that's it something to do with the random manner in
which I've set the camera up. Can some one set me straight, please!

1. Regular 2D texture vs 3D volume texture

2. 2D texture and 3D texture volume rendering

Hi, I am relatively new to opengl. I am trying to use 2D texture and
3D texture for volume rendering. that is, I have a volumetric image,
for example, 500 slices, each slice has 400 by 320 pixels. I want to
do the direct 3D volume rendering using opengl 2D texture or/and 3D
texture. can some one show me some sample codes how to do it?

are there any other ways for rendering the volume?

Zhengrong Ying

3. 2D/3D Model & Textures 3D CDs, updated 31/October/2006

4. 2D/3D Model & Textures 3D CDs, updated 25/June/2006

5. How to manipulate matrix dimension (2D->3D and 3D->2D)?

6. cnvdgn just 3D->2D and not 2D->3D

7. How does a single GLSL shader use a texture unit that can be 2D and 3D ?

8. Effect files: query structure for 2d or 3d texture coordinates

9. array of (2d) samplers = 3d texture/cube ! ;)

10. 2d to 3d texture map problem

11. Can I get native code add-ins when I development the add-ins using C#?

12. array of (2d) samplers = 3d texture/cube ! ;)

13. 2d Texture mapped to a 2d Quadrangle.

14. Creating and Using Texture for 2d in DirectX3D

15. 2D or 3D mesh to 2D polygon outline