• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

dantas

textured bitmap distortion

20 posts in this topic

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.
0

Share this post


Link to post
Share on other sites
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
0

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
0

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.
0

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
0

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.
0

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
0

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
0

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
0

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.
0

Share this post


Link to post
Share on other sites
YOu should not have to recompile any display lists or change the projecttion matrix every frame. Only change the projection matrix once, when you resize 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
0

Share this post


Link to post
Share on other sites
Yes, I agree, but it happens when the viewport is not changed also, just by moving the eye position as the user flies thru the model. It seems anything that changes the relationship of the eye to the texture can cause the warping of the texture, but only in a small number of relationships. And I cant seem to figure out what to do to fix it. I''ve tried recreating everything and regenerating the display lists, but keeping that relationship keeps it distorted. I thought of hacking it so that I move the eye just slightly, but I''m sure I would find a new position that was just as bad and gain nothing.

I''ve got access to my companies ftp server finally, so here is a picture of good vs wrong.

ftp://al.al.autometric.com/pub/incoming/Texture_Warp_Problem.gif
0

Share this post


Link to post
Share on other sites
I tried to look at it but there appears to not be any files in that directory. Are you sure someone outside your firewall can look at it?

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
0

Share this post


Link to post
Share on other sites
Yeah, I had it tried on Friday and it worked, but it doesnt now. We had our intranet converted over the weekend to link up with our new parent compnay and now even I cant get to the file.

I can email it to you if you want, let me know.
0

Share this post


Link to post
Share on other sites
THat is just fine with me. If you want to send the offending code that is just fine also. Don''t need everything just the graphics code.

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
0

Share this post


Link to post
Share on other sites
I know it''s only treating the symptom, and not the problem, but have you tried GL_CLAMP_TO_EDGE (0x812F)? It''s a part of the 1.2 implementation. If you''re headers don''t have it defined, through the above in as a define and see if it works. Most implementations are 1.2, though most headers are 1.1.

Thank you for your bandwidth.
-- Succinct
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


0

Share this post


Link to post
Share on other sites
It looks like the circle and the text is rotated on the yaxis. I would need to see the rest of your code, especially the perspective calls and your display lists building to help more. The code you sent looked fine. I thought maybe there was some kind of rounding error in gluProject that was shifting the screen coordinates but that should not be a problem.

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
0

Share this post


Link to post
Share on other sites
I have come across the fix. It seems that textures that are less than 32x32 get distorted at the edge if using any of the CLAMP values for WRAP_S/T. Once I forced the texture minimum to be 32x32 (the bitmap I was using was 16x16), everything looked fine. This was true of the text too (since in some cases the texture was 2x16).
0

Share this post


Link to post
Share on other sites
Make me wonder if there is a bit shifting problem in the driver/hardware.

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
0

Share this post


Link to post
Share on other sites
I tried it on a few cards and drivers (what I had access to, all nVidia) and they all did the same thing. I would think that something like this would already have been found and fixed if it was a card problem. Perhaps someone on this forum from nVidia will look into it.
0

Share this post


Link to post
Share on other sites