Jump to content
  • Advertisement

Archived

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

browny

When your textures flash

This topic is 5853 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

Everything is running perfectly except the damn textures . The problem is , when i look at some far away objects, say a far away wall, and move forward or backward the textures suddenly disappears and reveals whatever is behind the wall and again reappears as i move a little further. As a result , it seems some sorta wave is going along the wall as i continuously move forward or backward. Does it have anything to do with mipmaps ? Well.... i used gluBuild2DMipmaps() and everything but dint work . I even used GL_LINEAR_MIPMAP_NEAREST for the minification filter and GL_LINEAR for the magnification filter, still dint work.... Then i thought it had something to do with the perspective correction and used GL_NICEST for the perspecive correction hint..... STILL DINT WORK what do i do now ??

Share this post


Link to post
Share on other sites
Advertisement
Try the scene without the textures and see if you get the same visual result. If you do, it's probably Z buffer effects. That can be solved by increasing the bit depth of your Z buffer to 24 or 32. OR, if you upgrade to a way of storing your world such that you can render from back to front without depending on th Z buffer, that would also fix the problem.

If it isn't a Z buffer problem, then I have no idea what's going on


[edited by - Waverider on June 8, 2002 10:21:51 AM]

Share this post


Link to post
Share on other sites
Sounds like a rendering problem with your graphics card.

1) What card do you have?
2) Do you have the latest drivers?
3) Which release of OpenGL are you using?

If you using multitextures, have you checked that this is supported by your implementation?

Regards,
Mathematix.

Share this post


Link to post
Share on other sites
i dont think it has anything to do with Z-buffer or my card...
lemme explain why:

i am working on this game engine and i arealdy have a nice BSP loader, with a cool particle engine and other blah blah. I downloaded a tut on BSP loading and PVS from Gametutorial.com, which comes with a pre-comiled exe. All I did was; I read the tut and implemented almost the same thing in my engine. But my engine is giving this wierd texturing problem while the tut''s exe is running perfectly which eliminates the possibility of any problem with my 3D card. Moreover , the tut''s exe uses the same 16 bit Z buffer !

I know, its me whos making the mistake ( "somewhere" ). Now, all i need to know is , at what circumstances does this type of texturing problem arise ? This will help me to narrow down my ultimate quest for finding the problem. I''m calling it a quest because i have to dig this problem out from say 2000-3000 lines of codes.

someone with better idea ?

Share this post


Link to post
Share on other sites
Well, when I run into OGL problems, I just comment out each line of code until the problem is found.

It''s hard to say what is the problem without seeing your code.

Regards,
Mathematix.

Share this post


Link to post
Share on other sites
quote:
Original post by browny
Moreover , the tut''s exe uses the same 16 bit Z buffer !



Yes, but it may have different near/far plane values. What are yours ?

Share this post


Link to post
Share on other sites
er... why don''t you try not using mipmaps at all - just a regular, aliasing-prone texture. Then at least you will know if it''s that which is your problem.


Geocyte Has Committed Suicide.

Share this post


Link to post
Share on other sites
Maybe u guys are right. I think i''m having problem with my Z-buffer. I turned off all my textures ( let alone mipmaps ) and rendered the scene . But still no improvement. The geometry itself starts flashing as i go further back.

So, last night, i made a small trivial program using glut library just to see how Z-buffer actually works. All i did was, i drew two sphere, one inside another ( inscribed ).

// this is the blue sphere
glutSolidSphere(150,100,100);
// this is the red sphere
glutSolidSphere(100,100,100);

and then i moved my camera straight along the positive Z-Axis, with 10 units every frame. Interestingly, at around 500 units, i mean, when my camera is somewhere around ( 0,0,500) the the red sphere, which is supposed to be inside the blue one, showhow becomes visible and then again disappears as i go a lil further. As i go even further, the red one now becomes completely visible !

Now, 500 is definitely not a very big number that a 16-bit Z-buffer cannot hold. Plus, my near plane was 0.1 and the far plane was 10000. Which means, i used:

gluPerspective(70.0,(float)ScreenWidth/(float)ScreenHeight,0.1,10000);

Now tell me where i''m making the mistake ? I''ve almost written the whole code for you ( since it was so small ).

Share this post


Link to post
Share on other sites
Those values you have used for the near and far clipping planes are far too big. Even using a 24/32 bit Z-Buffer you would have problems.

Try to keep the values around 1 and 100 for the near and far planes...

Incidentally what are the values used in the demo tha you say works perfectly?

Share this post


Link to post
Share on other sites
16-bit Z buffers have the problem of accuracy at the far end.

Can you try rendering with a 24-bit or 32-bit Z buffer, and see if it improves?

It's kind of like a truncation problem, and making the Z buffer 24 or 32 bit is like adding a few more decimal places for greater accuracy.

EDIT: playworker beat me to it. I could be wrong!

[edited by - Waverider on June 10, 2002 11:08:02 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!