Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dantas

textured bitmap distortion

This topic is 6161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using a 16x16 bitmap of a circle as a texture placed in a 2D projection over a 3D model to indicate a site of interest to the user. He can also attach a textual label to the circle. Everything works fine most of the time, except on a few locations as I move the eye position around, the circle distorts by moving the right row of pixels to the left side (always right to left, never left to right). I have GL_CLAMP for the WRAP_S/T value, so it should not be wrapping the texture. It''s only an annoyance, but it''s distracting as you move thru the model. Anyone else see this or have any ideas on what is happening? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I guess no one has this problem. I have a picture, but my web site is down and have no where to post it.

As for more information, just changing the viewport size can cause the problem (where the circle is fine, but changing the aspect ration will distort it).

-dantas

Share this post


Link to post
Share on other sites
Are you using the texture in ortho mode on a 16x16 pixel quad?

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Yes I am. I''m not doing anything fancy, it just a simple texture marker with some text. That''s why I''m so stumped.

Share this post


Link to post
Share on other sites
Have you tried it on more than one video card? Maybe it is a small driver glitch.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Actually, I hadn''t thought of that because more than one of us has seen the problem. So I dug around here and found that almost all of us use the nVidia TNT2 board. I was able to find a couple of other boards to try it on (including a GEForce2) and the problem was still here.

Is it possible that the texture quad can be displayed other than perpendicular to the eye vector? Since I''m drawing using ortho projection, I didnt think so.

Share this post


Link to post
Share on other sites
Sure can. All the ortho does is get rid of perspective, it doesn''t eliminate z coordiantes. I also read your second post and was wondering if you are changing your perspective when you resize your viewport. That would cause the geometry to appear to stretched if you didn''t redo the aspect ration.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Well, at first I thought so too. I added code to first store the original z coord and then added random number z coord to the vertices for the quad. Any value of the z coord that was close to the origiinal value had the same problem. The random numbers caused the texture to not be drawn (as expected. GIGO!).

I have the depth buffer disabled, so the z coord should not matter and the texture should be drawn perpendicular to the eye vector. Or am I missing something?

As for the perspective when the viewport changes, no, it's not changed unless the user changes the model. The objects in the viewport are not changed, only the background grows or shrinks with the change in the viewport. The objects are not even recalculated, the display lists are just called.

Edited by - dantas on August 20, 2001 2:52:01 PM

Share this post


Link to post
Share on other sites
You probably need to change the projection matrix every time you change the size of the viewport.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
I thought about that and forced the display list to be regenerated each drawing cycle, but that didnt help. I went into the code and add an update to the projection matrix each drawing cycle to, just to see if it helped, but it didnt. The matrix changed very little as I moved the eye position because I have it very far out by default.

It has to be something due to the motion and angle of the textured quad relative to the eye vector, but I cant think of
anything else to try. And of course, it only happens at a very small percentage of the screen and it''s unrelated to were on the screen. I''m at a loss, so anything you can think might be causing it, no matter how obsecure, I''m willing to try it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!