Futurecraft Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Futurecraft Forums

A forum dedicated to communication and innovation!
 
HomeLatest imagesSearchRegisterLog in
Welcome, one and all, to the Futurecraft Forums!

 

 Super Long Draw Distance

Go down 
+3
xanex21
Laibach
fr0stbyte124
7 posters
AuthorMessage
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 2:21 pm

I think I may have come across a solution for cranking up the draw distance to the planet scale. Unfortunately, it's going to involve at the very minimum GLSL shaders, so you laptop folks out there are out of luck. I'll probably be able to do something for you guys, but it's not going to be as nice as this. Also keep in mind this is just something I've been reading about in-between learning two new .NET languages and trying to get concurrent worlds implemented. Suffice to say my hands are full at the moment, so this is strictly speculation for the time being.

First some background. Voxel games use to be a lot more common than they are now (though Minecraft has renewed some interest in that field). Back in the day, it was a good way to render complex terrain relatively cheaply in software in lieu of dedicated graphics hardware. Nowadays polygons are the standard for video games due to their optimality on GPUs and neat stuff like mesh deformation which allows for easier animation. Voxels engines still exist, but it is predominately for uses in the medical and visual effects industries. That said, Minecraft is not a true voxel game. Blocks are stored as voxels, true, but the graphics engine constructs everything with polygons like a traditional game. This ends up being a problem due to the sheer magnitude of geometry being displayed. Modern games avoid high geometry counts with techniques like lowering the level of detail (LOD) for distant terrain and objects, and using shaders to create the illusion of additional detail on things for things where it is not actually present. Also, more recently, tessellation, which procedurally subdivides polygons on-board the GPU almost for free. Minecraft does none of this, which is why it is so difficult to run despite looking so simple.

I've already done work on occlusion culling to reduce the massive amounts of hidden geometry, with mixed results. It helps, but even were 100% efficient it would only alleviate the problem. There's still too much geometry just from what is actually visible. I've looked at tons of different techniques for generalizing the terrain geometry, but few work on the voxel-style cube terrain, and even those that do work do so by smoothing and hiding the blockyness, which is iconic to Minecraft. In other words, polygons are a dead end.

With that in mind I started looking at voxel engines. The first one I found was Voxlap. If you are familiar with Ace of Spades, that's the engine it runs on. Despite it being a bit on the ugly side, the engine is really quite powerful compared to minecraft. It also runs entirely on the CPU, which is impressive. However, to get that performance, it is intensely optimized, parts of it even being written in assembly code to utilize the parallel processing registers found in modern CPUs. Some folks claim that modern Java is just as powerful as C, but that's BS. Java can't hold a candle to to C when a programmer knows what he is doing and is really going all-out with optimization. Voxel engines almost exclusively rely on raytracing/raycasting, which is a heavily parallel task and heavily dependent on floating-point operations. Because Java can't handle this properly, and because it seems to not trust the programmer with manual control, a CPU voxel engine for Minecraft is out of the question.

That only leaves the GPU. Fortunately, there's a lot of GPU voxel implementations. Aside from memory limitations, it is really ideal for the task, being built specifically for parallel computing with floating point operations. I won't get into the algorithm details right now, but I can give an overview of how this would work:
We would use the GLSL shader language, the same as all those shader mods, only instead of being a generalized framework, this would be highly specific in its execution and heavily optimized. For every pixel on the screen, a shader process iterates through a custom-tailored data structure of the world-sized voxel grid, optimized for size and data relevancy. Depending on the distance traveled, the ray may encounter a reduced resolution version of the terrain and display that instead. It should also be possible to return texture and lighting data, too, so it shouldn't look terribly different from the polygon version, except for maybe not supporting smooth lighting. Also, this wouldn't replace the existing polygon and occlusion system, but rather supplement it for long distance viewing. If done well enough, you should be able to reduce the draw distance from "far" to "normal" or even "short" without a distracting amount of difference. Non-cubes elements could be placed on their own displaylist, so that they render farther away than the normal terrain.

Integrating GLSL into the graphics engine allows for a bunch of other interesting opportunities, too, like programming the planet curvature directly into the voxel renderer. Theoretically, we could also do things like dynamic shadows or bump-mapping for special materials like hull blocks more efficiently than the generalized shader mod framework.

I'll talk more about the implementation once I work out precisely how everything will work. If any of this gets added, it would be entirely optional, and there would be disappointing non-GLSL alternatives for some of it, like planet rendering (think Google Earth).

Thoughts?
Back to top Go down
Laibach
General
General
Laibach


Posts : 2024
Join date : 2012-01-23
Age : 73
Location : Frozen Fields

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 2:50 pm

fr0stbyte124 wrote:

amazing graphics engine stuff


My brain is now dead

so, this seems like a stupid question, roughly how much more graphics intensive will this make minecraft?

wow, I need to read through this thing a few more times

EDIT: hey i'm a marine Very Happy
Back to top Go down
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 3:02 pm

CoalMiningAlchemist wrote:

so, this seems like a stupid question, roughly how much more graphics intensive will this make minecraft?
It is hugely dependent on implementation, hardware, screen resolution, and how skillfully it can be optimized. All I can say with certainty is that it will be...different. Also, it depends what it's being compared to. If you tried to draw 20km of world the Minecraft way, I can safely say that the GLSL implementation will be faster.
Back to top Go down
Laibach
General
General
Laibach


Posts : 2024
Join date : 2012-01-23
Age : 73
Location : Frozen Fields

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 3:07 pm

another question, will the super long distances look kind of like the un-detailed terrain in MCedit, if you know what i'm talking about


EDIT: like this
Spoiler:
Back to top Go down
xanex21
Newbie
Newbie



Posts : 131
Join date : 2012-01-21
Location : Between the Delta and Alpha Quadrant (trexies)

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 3:39 pm

Sounds like a lot. Don't understand most of what you said. i think i get the gist of things. You are going to use an old system, because the new systems will either makes more complicated or wont work. You'll find a way though, if you already have, we believe in you. As for planets, why not make planets cubic for simplicity and for the spirit of minecraft ?
Back to top Go down
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 4:21 pm

CoalMiningAlchemist wrote:
another question, will the super long distances look kind of like the un-detailed terrain in MCedit, if you know what i'm talking about


EDIT: like this
Spoiler:
No, it will be true voxels, meaning there won't be those block shadows. And performance permitting, it will still provide as much detail as you are able to see, but ideally no more than that.

xanex21 wrote:
Sounds like a lot. Don't understand most of what you said. i think i get the gist of things. You are going to use an old system, because the new systems will either makes more complicated or wont work. You'll find a way though, if you already have, we believe in you. As for planets, why not make planets cubic for simplicity and for the spirit of minecraft ?
The technology I'm researching is actually pretty cutting-edge, nothing like its predecessors.
We've discussed cube planets before, and while I'm not against it, it may end up being pretty difficult to pull off due to the complex edge conditions: how gravity works, how blocks are rendered, how interactions like redstone work, how building above and below the surface would be handled. It ends up getting pretty messy, whereas spheres are only slightly messy. Ironically, the easiest planet to do would probably be a ring-world.
Back to top Go down
Dux Tell31
Recruit
Recruit
Dux Tell31


Posts : 379
Join date : 2012-01-05
Location : That is out of the question

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 5:01 pm

So how does this affect the (fairly ruff) schedule?
Back to top Go down
Laibach
General
General
Laibach


Posts : 2024
Join date : 2012-01-23
Age : 73
Location : Frozen Fields

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 5:02 pm

tell31 wrote:
So how does this affect the (fairly ruff) schedule?

There's a schedule?
Back to top Go down
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 5:07 pm

I gave up on keeping a schedule when my weekend occlusion culling experiment wound up taking two months.
Back to top Go down
Laibach
General
General
Laibach


Posts : 2024
Join date : 2012-01-23
Age : 73
Location : Frozen Fields

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 5:09 pm

fr0stbyte124 wrote:
I gave up on keeping a schedule when my weekend occlusion culling experiment wound up taking two months.

Lol, I actually know what you mean
Back to top Go down
Red Fang
Recruit
Recruit
Red Fang


Posts : 201
Join date : 2011-12-03
Age : 98
Location : In my cave full of treasure.

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 8:38 pm

Wow, the things Frostbyte can do... I didn't even know something like this was possible.
Back to top Go down
Keon
Lord/Lady Rear Admiral 1st
Lord/Lady Rear Admiral 1st
Keon


Posts : 3076
Join date : 2012-01-17
Location : Hahahaha.

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 8:45 pm

Ouch. One thing that you should consider is just importing a world renderer, like google earth. (I know there are some.) Then, when a world is formed, have it create a model file, and instead of drawing each block and all, just draw a precomputed sphere. No need to make complex calculations, they won't be visible. I think that is what you are doing.
Back to top Go down
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 9:07 pm

I plan on doing something like that for players who can't run GLSL, but it won't be as good. Especially not from near ground level.

Take a look at this picture again for reference.
Spoiler:

This one, of course, is a rendering, but it is indicative of what this graphics engine will be able to do. And it will be able to do it from any elevation.
Take a look how noticeable the hills and the clouds are. You would never be able to see that sort of thing from a flat world projection.
Back to top Go down
Keon
Lord/Lady Rear Admiral 1st
Lord/Lady Rear Admiral 1st
Keon


Posts : 3076
Join date : 2012-01-17
Location : Hahahaha.

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 9:16 pm

I didn't say it was flat. Just look at google earth. I assume that is a mesh, but I might be wrong. Anyway, whatever you chose to do.
Anyway, how was that rendered?
Back to top Go down
Dux Tell31
Recruit
Recruit
Dux Tell31


Posts : 379
Join date : 2012-01-05
Location : That is out of the question

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeThu Feb 16, 2012 9:27 pm

fr0stbyte124 wrote:
I plan on doing something like that for players who can't run GLSL, but it won't be as good. Especially not from near ground level.

Take a look at this picture again for reference.
Spoiler:

This one, of course, is a rendering, but it is indicative of what this graphics engine will be able to do. And it will be able to do it from any elevation.
Take a look how noticeable the hills and the clouds are. You would never be able to see that sort of thing from a flat world projection.

THAT WILL BE AMAZING!!!

I didn't actually have a clue to what you meant by "visible from space" and that stuff. This makes it so much clearer and EPIC! Very Happy cheers Very Happy cheers cheers Very Happy cheers Very Happy
Back to top Go down
fr0stbyte124
Super Developrator
Super Developrator
fr0stbyte124


Posts : 1835
Join date : 2011-10-13

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeFri Feb 17, 2012 12:32 am

Keon wrote:
I didn't say it was flat. Just look at google earth. I assume that is a mesh, but I might be wrong. Anyway, whatever you chose to do.
Anyway, how was that rendered?
Google earth is essentially a flat projection of aerial photography pasted on a sphere with some heightmap distortion. It can't display anything extreme on the level Minecraft would handle without looking weird.
The image was probably a 1.8 world exported to a .obj format and then rendered in blender. The spherical shape is produced by a fishbowl projection.


Quick update:

My current model for the voxel engine base is the project GigaVoxels. There's a huge amount of information published on it, and it's been invaluable for learning voxel theory. I need to figure out how to optimize it for a world like Minecraft, though. I've got a few ideas, but it's still pretty fuzzy.

First is surface rendering. I figure the primary use of the voxel engine is for rendering above ground. If we separate the cave/underground tunnel data from the surface data, or remove it altogether (it would just be foggy like normal underground), the surface data could be compressed to a much higher degree. For that to work though, we would need some way of guaranteeing that an area is not visible from the surface. I'll have to put some thought into that.

Another thing, which I got from GigaVoxels, is a proxy mesh. This is a kind of neat idea. You make a polygon mesh around the voxelized object, and instead of texturing, the shader threads do the raycasting like normal. The difference is that they start right next to the voxel data and avoid a ton of data traversing. We can abuse the crap out of this for Minecraft. If you notice, the minecraft terrain is predominately smooth aside from trees. So ignoring trees for a moment, we generate a manifold over the terrain using the heightmap as a starting point and reduce the poly-count via one of the many mesh generalization methods (it doesn't have to be blocky so we've got lots of options) until it's a nice manageable size. Even better, on newer cards you could use tesselation to make the mesh fit perfectly to the heightmap. Either way, once that's done, you let the rasterizer figure out the ray locations for you and end up doing 0-1 block traversals per pixel most of the time. If that's the case, then it's a real game changer, completely changes the dynamic of the voxel strategy.

The only times it wouldn't be the case are areas where there are visible concavities below the highest block, things like trees, cave entrances, and land bridges/overhangs. In those cases it will traverse normally, but they are in the vast minority of cases. For trees, since there are relatively few permutations of them naturally occurring, we could remove those from general rendering and put them in as instances. If implemented right, that should be a pretty cheap action and avoid a lot of the manifold distortion.

I'm also thinking something other than oct-trees should be used to store the data structure. It's great for storing uniform sizes of data which helps with caching and memory management, but there is so much foreknowledge of which regions are empty, it would be a shame to ignore it. Maybe BSP trees? It wouldn't matter too much for regular voxel drawing, but if you wanted to add other effects like shadows, it becomes important again. Oct-trees are good for a general setup, but don't do well in areas where there is too much detail. I'll keep thinking about this.
Back to top Go down
hiloser12221
Newbie
Newbie



Posts : 58
Join date : 2012-02-03

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeFri Feb 17, 2012 5:17 pm

So from what I seem to be understanding and what I took away from your fancy computer science game designer stuff is that Minecraft went from being somewhat playable on the average laptop (30FPS, normal, no smooth lighting etc) to basically trying to run say BF3 max graphics on a laptop. Or will you be able to optimize it so that it will be playable (I know you mentioned a version without this feature, but do you have any other plans for optimization?).
Back to top Go down
Keon
Lord/Lady Rear Admiral 1st
Lord/Lady Rear Admiral 1st
Keon


Posts : 3076
Join date : 2012-01-17
Location : Hahahaha.

Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitimeFri Feb 17, 2012 5:27 pm

hiloser12221 wrote:
So from what I seem to be understanding and what I took away from your fancy computer science game designer stuff is that Minecraft went from being somewhat playable on the average laptop (30FPS, normal, no smooth lighting etc) to basically trying to run say BF3 max graphics on a laptop. Or will you be able to optimize it so that it will be playable (I know you mentioned a version without this feature, but do you have any other plans for optimization?).

He has some.
@frost:
I don't think you need shading. What is the planned lower bound of space (When you leave the world and go into a different world of space?)
Back to top Go down
Sponsored content





Super Long Draw Distance Empty
PostSubject: Re: Super Long Draw Distance   Super Long Draw Distance Icon_minitime

Back to top Go down
 
Super Long Draw Distance
Back to top 
Page 1 of 1
 Similar topics
-
» So long, GAY BOWSER!
» How long have you been playing Minecraft?
» Most Interesting Mod in a VERY long time
» I havn't had this much fun from a free game in a long time.
» super weapon...............maybe

Permissions in this forum:You cannot reply to topics in this forum
Futurecraft Forums :: General Area :: Members' Lounge-
Jump to: