8 ms·
Voxel Quest Fluid Dynamics and New Rendering Method
- deleted 11y ago[deleted]
- pervycreeper 11y agoI'd be curious to know what the new algorithm is that dispenses with "chunk loading" allows all scene data to appear instantly.
- phkahler 11y ago>> I'd be curious to know what the new algorithm is that dispenses with "chunk loading" allows all scene data to appear instantly. Looks like instancing to me. There isn't really that much data shown at once.
- gavanwoolery 11y agoIts all "unique" - have a look at: https://twitter.com/gavanw/status/590884138871230464 https://twitter.com/gavanw/status/590884138871230464 That said, the uniqueness is limited to the generation algorithms and parameters you pass to those algorithms. Each cell can be completely unique, I vary the color and shape here but you could vary any generation param.
- corysama 11y agoI expect that it's signed distance field ray marching. You can see a demo of the tech here: http://m.youtube.com/watch?v=lwFVlNytq0Q http://m.youtube.com/watch?v=lwFVlNytq0Q And a presi of how that demo works here: http://on-demand-gtc.gputechconf.com/gtcnew/on-demand-gtc.php?searchByKeyword=Timeless&searchItems=&sessionTopic=&sessionEvent=&sessionYear=&sessionFormat=&submit=&select= http://on-demand-gtc.gputechconf.com/gtcnew/on-demand-gtc.ph...
- VikingCoder 11y agoWow, thanks!
- superqd 11y agoYeah, when I saw the video on the VoxelQuest site it immediately reminded me of this demo of raymarching/signed-distance-fields: https://dl.dropboxusercontent.com/u/27844576/raymarch/raymarching.html https://dl.dropboxusercontent.com/u/27844576/raymarch/raymar...
- gavanwoolery 11y agoYep, it uses SDF in the detail pass :)
- gavanwoolery 11y agoBasically its the difference between calculating a full volume and just the surface of that volume. The old chunks had to store points or cached bitmaps (depending on if it was the isometric method or the perspective method). The new method stores nothing, and generates the scene instantly based on the camera's viewing volume. As mentioned above, its really simple stuff (at least, as simple as this stuff gets!), not new - it is based on distance field marching and grid marching.
- david-given 11y agoThis sounds a bit like Euclideon's Unlimited Detail tech demo video, which got some press a couple of years ago and then vanished without trace: https://www.youtube.com/watch?v=00gAbgBu8R4 https://www.youtube.com/watch?v=00gAbgBu8R4 (Warning. Video may contain critical levels of overhyped vapourware.) To me it sounded like Euclideon had figured out a new wrinkle in efficiently storing and searching very large instanced voxel spaces, and Voxel Quest sounds very similar. While Euclideon's demo was obviously a rigged tech demo, it still looked very cool, and I'm glad that it's turning out that this sort of thing is feasible.
- gavanwoolery 11y agoOh wow was not expecting this to go up on HN...and I thought I was going to get some sleep. :) Primary difference between Euclideon's stuff and mine is that I am willing to disclose how my stuff works. It is actually a really simple combination of marching in a grid and then working down into that grid cell with distance field marching. I am doing a writeup on it as soon as I get some time. :) The primary difference from the old methods I used in Voxel Quest is that the old methods calculated the full volumes, whereas the new method calculates only the visible surfaces.
- rsp1984 11y agoVery cool! Are you doing this on the CPU or GPU?
- gavanwoolery 11y agoFluid sim is CPU, all rendering is done on the GPU though.
- rsp1984 11y agoSince I happen to know the founder of Euclideon and the company a little bit I have to emphasize here that their tech was and is real. Sure in the videos it wasn't presented in a neutral academic setting but it's far from rigged and in fact is being used in the geospatial industry today. Voxelquests technology looks very promising too and I am looking forward to seeing this applied in a game setting.
- erikb 11y agoDid they just add a feature or replace the whole rendering engine? It looks like a replacement with the second video. I start to wonder if it will ever be finished.
- gavanwoolery 11y agoMuch of the old rendering pipeline is still there for materials, fog, post process fx, screenspace lighting, etc. The only part of the rendering that has changed is the part that generates the depth and normals. I have been using a test scene to quickly get some other stuff up and running, stress test things, and debug. But its still capable of rendering the old stuff, although there is a bit of work to get it back in. :) I think the performance improvements were a necessary evil. The old chunk loading was simply too slow and had a negative impact on gameplay. I'm hoping to keep things going on the gameplay front as well but I am only one man! :)
- kenrikm 11y agoTo me it looks like the effort was worth it. The chunk loading was a showstopper where as this looks really slick now.
- gavanwoolery 11y agoThanks!
- gavanwoolery 11y agoAuthor here - as mentioned I was not expecting this to get posted but I am happy to answer any questions or elaborate further. For so long as I can stay awake at least. :) Some other shots worth looking at: Some terrain I quickly whipped up based on this method, using Voxel Quest's actual generated map: https://twitter.com/gavanw/status/589499986854838272 https://twitter.com/gavanw/status/589499986854838272 Screenshot of the test scene, with median filter: https://twitter.com/gavanw/status/590895532509265920 https://twitter.com/gavanw/status/590895532509265920 Here is a short vid showing that it is in fact volumetric: https://twitter.com/gavanw/status/590903499342229504 https://twitter.com/gavanw/status/590903499342229504 A few basic tricks I use: A "macro" pass that ignores small, expensive to compute details. A "micro" pass that avoids texture reads but produces complex algorithmic textures (texture reads will KILL your performance in many cases because of cache invalidation). Supercover lines used for raymarching to precisely march through each cell. http://lifc.univ-fcomte.fr/home/~ededu/projects/bresenham/ http://lifc.univ-fcomte.fr/home/~ededu/projects/bresenham/
- cordite 11y agoLooking forward to a full breakdown on this :)
- chrisseaton 11y agoCan you give an overview of the technique you are using for this project (in general, not just this demo) for someone with only undergraduate level graphics knowledge? Do you basically draw two triangles that fill the whole screen and then render everything using a shader? And how do you store that many voxels? A sparse data structure? When you have a large solid area do you simply say this entire area is filled so don't have to represent the voxels individually? I saw a video where you cut away sections of a building using a brush. Do you store the building voxels and then store the subtraction separately? If you had a world with thousands of buildings in it and cut away a little at each does that mean you can no longer share the shape of each building and space requirements blow up?
- gavanwoolery 11y ago> Do you basically draw two triangles that fill the whole screen and then render everything using a shader? Yes. It determines the ray origin and direction for each pixel, and casts out a ray from there with pretty standard ray tracing methods and a few additional tricks I mention above. > And how do you store that many voxels? A sparse data structure? When you have a large solid area do you simply say this entire area is filled so don't have to represent the voxels individually? No voxels anymore, although it can be fairly easily "voxelized" by clamping the step space of the rays to approximate towards the nearest cube. So, I guess I might have to change the name, or make it look more voxel-ly :) > I saw a video where you cut away sections of a building using a brush. Do you store the building voxels and then store the subtraction separately? If you had a world with thousands of buildings in it and cut away a little at each does that mean you can no longer share the shape of each building and space requirements blow up? You can store a million modifications in a few megabytes. I was never intending for it to allow that many though, but I will figure out what corner cases are worth addressing.
- markus2012 11y agoLooking forward to playing with the API and building my own worlds/demos/games :-) I'm hoping your license terms let folks initially play with it for free like the UT4/Unity licenses.
- gavanwoolery 11y agoFull source will be up on Github (with possible exception of any code that needs to be secure like server stuff). It will get leaked/pirated anyway, so not going to bother charging for the source.
- bobajeff 11y agoI understand if you just don't want to deal with commercial licensing and developer support. But really, regardless of if your code is leaked or not you can get royalties the same way Unreal does on commercial products that use it.
- gavanwoolery 11y agoYeah there will be some sort of license in place although I hope to one day have it under permissive open source. All I mean is that I'm not limiting code to people who have purchased the game. :)
- c3d 11y agoNo discussion of ray marching is complete wihtout mentioning Shadertoy (http://www.shadertoy.com http://www.shadertoy.com) and the work of great shader artists such as Iñigo Quílez, Paul Malin, Dave Hoskins, Reinder Nijhoff and many others. If you are interested in these techniques, check it out. One of my favorites is Elevated: https://www.shadertoy.com/view/MdX3Rr https://www.shadertoy.com/view/MdX3Rr. I've converted many of the most beautiful ones to auto-stereoscopic 3D for Tao3D (http://tao3d.sourceforge.net http://tao3d.sourceforge.net). An infinite landscape in glasses free 3D is a thing of beauty :-)
- gavanwoolery 11y agoI agree! I learned a lot from both Shadertoy and IQ's website. Also, while we are mentioning people, I should mention that Jon Olick is running a Kickstarter right now: https://www.kickstarter.com/projects/1760210928/voxelnauts-vr-mmo https://www.kickstarter.com/projects/1760210928/voxelnauts-v... Jon has been a major pioneer in voxel research and ray-based techniques.
- jere 11y agoI've seen this website mentioned many, many times. What kind of background would one need to begin to start understanding/making these things? Every time I see this site, I think I should figure this out. I don't see any sort of introduction area, so I click on a shader and am presented with some totally indecipherable code.
- david-given 11y agoThe maths isn't hard, but you do need a decent grasp of vectors and (optionally) 3D transformation matrices, and it's pretty opaque until you figure out the terminology. I haven't done GPU raymarching myself but I've used the same techniques on the CPU side in order to develop a whole-planet procedural renderer (in Ada, of course); the raymarching was relatively straightforward but I got horribly bogged down trying to make a volumetric atmosphere work. One resource I found really useful was Iñigo Quilez' website; in particular, his article on basic terrain raymarching explains most of the concepts: http://www.iquilezles.org/www/articles/terrainmarching/terrainmarching.htm http://www.iquilezles.org/www/articles/terrainmarching/terra... (Also known as iq, he's responsible for a number of amazing demos, including the 4kB demo _Elevated_: https://www.youtube.com/watch?v=jB0vBmiTr6o https://www.youtube.com/watch?v=jB0vBmiTr6o He also appears to have written ShaderToy. Search for iq to see his stuff omfg ShaderToy lets you write shaders to produce _music_ now? https://www.shadertoy.com/view/ldXXDj https://www.shadertoy.com/view/ldXXDj)
- newobj 11y agoLooks awesome. Gavan, any advice where to get started on graphics programming? I'm an ex-games programmer (AI, networking) who always avoided graphics like the plague - too many weird hardware permutations, fallbacks, crappy drivers, etc. Now that I'm not in the industry, I'd like to learn for fun. But I have no idea what the "sweet spot" is for desktop (non-mobile/console) graphics - DirectX? OpenGL? What version of vertex/pixel/geom shaders are the norm? Are there standard practices for shadows/lighting now, or are they still done on an ad-hoc basis? How normal is GPU ray tracing? Virtual textures? And so and so on. I haven't been able to find anything that kind of discusses these issues at a comprehensive/holistic level. Anything useful you've found?
- agentultra 11y agoI'm not gavin, but I like the style of http://www.amazon.com/Math-Primer-Graphics-Development-Edition/dp/1568817231/ref=dp_ob_title_bk http://www.amazon.com/Math-Primer-Graphics-Development-Editi... and recommend it to anyone getting started. You don't need any more than high-school maths and some familiarity with programming in your language of choice (though the example code is in C++). If you're just getting started and want a low-impact way to prototype things try WebGL! (I'm an unbiased WebGL contributor and user). OpenGL seems to be the way to go on most platforms; DirectX is probably easier on Windows. There are libraries that take care of the platform-specific code for you if you don't want to write your own that are quite good: SDL2, glfw, etc. hth
- gavanwoolery 11y agoThanks! My advice is to find a good set of tutorials and start ripping them apart. In another comment I mentioned Three.js is a great way to get up and running fast. WebGL has limitations but the ease of development pays off especially if you are just learning. TBH does not matter what versions you use too much. I am still using one of the older shader versions (1.2 or 1.3) but I will probably upgrade just because there is not a major downside to using a newer version. Lighting and shadows vary everywhere and there is no best way, just depends on your use case. Cascaded shadow maps are quite common in high-quality, polygon-based pipelines. Commercially, GPU ray tracing is very rare, if for no other reason than the tooling is just not there like it is for polygons. Ultimately, no fast path - you just take it one step at a time starting with simple goals and you will ultimately get there. Even a year of hobby development will make a dramatic difference in your understanding, but the payoff is slower from there.