Skip to main content
gamedev.net
🔒 Locked

Texturing terrain

Started by Pexi Apr 11, 2001 at 6:18 AM 2 replies 350+ views
Original Post
Pexi
Pexi
Problem is using large textures above 256*256. Currently i''m thinking of using one big bitmap and slicing it to 256*256 sections and the use them when rendering. That causes problems when using VertexBuffers. I have to use separate vb for every section of the terrain because I have to change the texture while rendering. If you dont''t get what I mean: LoadTexture(SliceWidth, SliceHeight, ''texture.bmp''); Render { FillVertexBuffer(); // Fill the vertex data from terrain SetTexture(); // This causes the problem //Because I have sliced the texture in pices. DrawPrimitive(); } Solution would be to render terrain in passes. 1. Fill vertexdata from section of terrain which has same texture 2. SetTextureForArea 3. Render() 4. Take the next pice of terrain and go back to 1. I can''t explain it better... Has anybody an solution to my problem...
Pekka Heikurapekka.heikura@mbnet.fi
Sly
Sly
Is there a real problem in breaking the terrain up into separate areas (vertex buffers)? Besides being slightly more difficult to render, are there any other isuues that would prevent you from taking this approach? I would imagine that the terrain would have been broken up into sections anyway for culling large sections that are outside the current viewport.

Steve ''Sly'' Williams  Code Monkey  Krome Studios
Sordith
Sordith
I did just that (broke my terrain into four sections for texturing) and I haven''t regretted it...
Pexi
Pexi
Maybe I was too hastily to post that question. I didn''t think that over before posting.

Still it good to know that somebody else has done it before and it has worked. Maybe I should do it too.

Pexi
Pekka Heikurapekka.heikura@mbnet.fi

Topic Locked

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

Sign in to reply to this topic.