Jump to content
  • Advertisement
Sign in to follow this  
reallycoolme

Texture Detailing

This topic is 4321 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 need to have various levels of detail for my textures because blocks of land faraway dont need the high texture detail, but when I go close to them, I need the high detail to appear. So my question is should I draw multiple textures in photoshop with various levels of detail, or is there a way in the game to "tone down" the detail on the fly? I need this for efficiency mainly.

Share this post


Link to post
Share on other sites
Advertisement
I've totally never heard of that. Most games worry about polygon level of detail. Is texture detail a real issue in terms of game speed? This may also be related to mipmaps. "MIP mapping features multiple images of a single texture map at different resolutions", but I don't know that it is really related to speed. I also remember reading that the image format DDS is the most effective because it has some system that is pre calculated.

Share this post


Link to post
Share on other sites
If I understand your question correctly, I think you are talking about mipmaps. Which API are you using, Directx or Opengl? I know Opengl has the function gluBuild2DMipmaps and I assume Directx has something similar.

Share this post


Link to post
Share on other sites
Im using directx 9. Im using blocks of land 64verts by 64 verts, maybe thats the problem? The way Im doing it right now is what I saw in a tutorial. I have a .raw for the heightmappings of the terrain,and then I have a .jpg for the texture. The .jpg's are 512 x 512. In a normal view during the game, about 6-8 blocks of land are rendered (meaning in view) and im culling everything outside the frustrum before they even get a chance to try rendering themselves. When 4 blocks of land are in view, the fps is about 30, but once i get more, the fps drops dramatically to about 10-20. I will go look into mipmaps and DDS(im not sure what they are, but Ill go look at the tutorials and such for that).

Share this post


Link to post
Share on other sites
Do you know of any good mipmap tutorials? I tried searching, but i didnt find anything satisfying. But yes, mipmaps are exactly what i mean now that i see what mipmaps are.

Share this post


Link to post
Share on other sites
Save your textures in the .DDS format, it autmoatically creates mipmaps. I'm not sure how to implement them in the code though.

Share this post


Link to post
Share on other sites
After a while of browsing around, i found "D3DXCreateTextureFromFileEx". It has a param for how many mipmap lvls, and a bunch of other params. so, once i load the texture with a certain amount of mipmap lvls, how do i specify which lvl to render as? iow, what texturestates or texturestages or other settings do i have to set during rendertime to tell the card which level of mipmaps i want to use?

Share this post


Link to post
Share on other sites
You can't really specify which mip-level to use without writing your own shader or seriously bullying the API into using specific texture surfaces. However, unless you have a very specialist application, there is no need to specify the mip-level:

The default pixel shader in the fixed pipeline will automatically determine, from the homogeneous w coordinate, which mip level to use to give the closest pixel-texel mapping. All you need to do is to create the texture with one or more mipmap levels and use the texture it creates as you normally would.

Unless you have very strict memory requirements, pass 0 as MipLevels to D3DXCreateTextureFromFileEx to create a full mipmap chain. It costs only 33% extra video memory to create a full chain, but the benefits are dramatic.

Also, be sure to set texture filtering to trilinear so that the boundaries between mipmap levels don't appear as radial artifacts in your render.

Regards
Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!