Skip to main content
gamedev.net
🔒 Locked

texturing performance question

Started by Dragon_Strike 5 replies 900+ views
Original Post
Dragon_Strike
Dragon_Strike
ive made a textureing system but im not quite sure if it works as i think... ive got my terrain divided in chunks... i have 5 different textures with lowering resolutions (1024x1024, 512x512 etc..) and each one of them covers the entire terrain... when i render the terrain i first bind the first, most detailed texture (which covers the entire terrain) and render the chunks closest to the camera (first level) where the texture coordinates are x/terrainsize,z/terrainsize, NOT chunksize... then i keep on binding the lowersized textures and render the chunks further away... does this improve peformance vs just binding the most detailed texture and render the entire terrain... the reason im unsure is that i dont know if when you bind a texture the entire texture will be sent to the GPU or just the part within the texture coords...?
superpig
superpig
Quote:
Original post by Dragon_Strike
the reason im unsure is that i dont know if when you bind a texture the entire texture will be sent to the GPU or just the part within the texture coords...?


The entire texture will be sent. Binding a texture has nothing to do with texture coordinates.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Dragon_Strike
Dragon_Strike
just to make it clear since "Binding a texture has nothing to do with texture coordinates." this method im using wont result in better performance?

then if u divide the texture so that i just bind the texture thats needed for a certain chunk?

[Edited by - Dragon_Strike on September 10, 2006 3:03:07 PM]
crowley9
crowley9
Your method will give you better performance. Not because of what is sent as such, but because the smaller textures used for the "far away" bits will give you better cache coherency.

However -- why are you doing this? You are just mip-mapping manually. Generate mipmaps, and bind the mipmap texture and you have a completely automatic "optimal" solution.
Dragon_Strike
Dragon_Strike
soo if im using mipmaps parts of the texture will have lower res?

i always thought that mipmaps decreases the tex res for the entire texture at a time and not parts of it... ill have to do some more reading i guess
crowley9
crowley9
No, it's per pixel. That is why you can get that "line" artifact where mip levels transition, if you do not use trilinear filtering. I have seen several software engines that use per-triangle mip calculations (Migh and Magic VI comes to mind). This is inaccurate (LoD can change signficantly over a triangle), and causes really ugly artifacts, such as visible jagged lines (when adjacent triangles do not share the same mip level), and popping when triangles suddenly change mip levels all at once.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.