Sign in to follow this  

Texture Detailing

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

This topic is 4109 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this