But he or she might cross into another chunk. The first step is to define a way to draw only terrain that is needed and throwing out unused chunks is the easiest way. Actually making it workĮven for a naive renderer, this will be impossible to render in one go.įirst, you have chunks. One channel per texture and the resulting RGBA value is then actually used to blend the textures together in the fragment shader (pixel shader in 3D3 which also tells you what it does.
Then pick 4 textures for your macro chunk and draw one additional texture per micro chunk that defines how the textures should be blend together. Which you can then use to generate new vertices with a dynamic height from the texture map. You can easily get 8k*8k textures going so this would mean that on a one unit line you have 8 pixels from your height map. Now we end up with 98304 / (32 * 32) = 96 macro chunks per side.Each 1024x1024 units. And a macro chunk is 32x32 micro chunks (in World of Warcraft, it's actually 16 both times but that was back when you didn't have a programmable pipeline). That's 32768 metres and that's 98304 units. Textures should be power of two in size and you'll need a lot of textures so lets go for 32*1024 metres. So, we're going for a square continent that's 32x32 km in size.ģ2 km are 32000 metres and that's 96000 units. So maybe subdivide your chunks as well! That way, you can define textures on a micro chunk basis and define structure on a macro chunk basis. You don't want to have textures change only on a 1/3 of a metre basis. Of course you want to do other things with the terrain than render it unit per unit. So, the Americans on here can simply think of a unit as a foot and have a better mental image. Since a metre is 0.91 yards and 3 feet are a yard, we're going to go with one unit being 1/3 of a metre or a bit less than a foot (roughly 0.3 yards, in fact). Looking at WoW, it seems almost like having a quarter or a third of a meter is a good size for "one unit". I don't either" but OpenGL and D3D also don't know what a mile is. Now, what are your units? OpenGL and D3D don't know what a god damn metre is. I'm not sure what I found when I did research but after doing research about the size of World of Warcraft continents, I determined that 32km is a good distance top to bottom for a continent of the scale of WoW continents (the old ones. Let's try to implement a very naive, large scale terrain renderer.Īt first, you need to think about the size of your world and how you want to split it up. That way, you can define one square, generate more primitives and read the y value of those new vertices from the height map. Tessellating is basically splitting a primitive (square, line, triangle) into multiple smaller primitives. Instead, you'd use the tessellation shader. If you do it very naively, you just define a mash of how many pixels you have and read the Y (we're using OpenGL here where +Y moves goes "up") from the texture. A value of 255 (white) is the highest point. A value of 0 (black) is the ground level. It's a gray scale image of the height of your terrain. This is vital to modern terrain rendering. I assume every modern GPU has a tessellation shader. I actually wrote my bachelor thesis about terrain rendering so I'm gonna get a bit into detail. Feedback Friday Screenshot Saturday Soundtrack Sunday Marketing Monday WIP Wednesday Daily Discussion Quarterly Showcase Related communities 1 For questions, get in touch with mods, we're happy to help you.
Free assets OK, be sure to specify license. If you need to use screenshots, that's ok so long as is illustrates your issues.ĭo not solicit employment. Use discord, /r/indiegames, /r/playmygame or /r/gamedevscreens.īe specific about your question. Feedback, praise, WIP, screenshots, kickstarters, blogs, memes, "play my game", twitch streams.