Sunday, 8 October 2017
Complete source release
I had for quite a while intended on fixing various problems with the engine's code and then doing a release of the source code. I have never managed to get around to any of that so instead I have decided to just stick the code up github as-is, warts and all. You can find the code used for all the posts on this blog here: https://github.com/nickgildea/leven
Saturday, 11 March 2017
Mesh simplification library
I've released a mes simplification library here: https://github.com/nickgildea/ng_mesh
No external dependencies beyond the qef_simd.h single file library I released last week.
No external dependencies beyond the qef_simd.h single file library I released last week.
Thursday, 2 March 2017
SSE2 QEF implementation
I've ported the existing QEF implementation to SSE2. You can grab the code here: https://github.com/nickgildea/qef/blob/master/qef_simd.h
It should be possible to just drop that in to your project as a replacement, assuming you then enable SSE2 extentions when building. I saw ~2.5x speed up in my tests.
It should be possible to just drop that in to your project as a replacement, assuming you then enable SSE2 extentions when building. I saw ~2.5x speed up in my tests.
Tuesday, 22 December 2015
Improving Generation Performance
There are quite a few high profile games coming out in the next year or so that make use of voxels to drive dynamic content. Two in particular have really caught my attention, for different reasons. The first was Hello Games' No Man's Sky which is in a similar vein to my own project, using voxel data and Dual Contouring to generate traditional polygonal meshes.
Monday, 19 October 2015
Video update for October 2015
I've posted a new video to YouTube showing some of the speed improvements I've made recently.
Since the last video in Feburary I've moved the entire voxel -> mesh pipeline (except for the seam mesh generation) to the GPU via OpenCL and reworked how the volume is processed. I'm planning on a blog post to explain the changes but the main thing is that I no longer always sample the field at a 1:1 resolution. E.g. for a LOD1 node I now only sample a 128x128x128 volume instead of 8, and for LOD2 only 1 volume instead of 64. This has had a huge impact on the performance which has helped with other features, like the dragging operations you can see in the video.
Since the last video in Feburary I've moved the entire voxel -> mesh pipeline (except for the seam mesh generation) to the GPU via OpenCL and reworked how the volume is processed. I'm planning on a blog post to explain the changes but the main thing is that I no longer always sample the field at a 1:1 resolution. E.g. for a LOD1 node I now only sample a 128x128x128 volume instead of 8, and for LOD2 only 1 volume instead of 64. This has had a huge impact on the performance which has helped with other features, like the dragging operations you can see in the video.
Sunday, 26 July 2015
Fixing a seams bug
I've been sitting on the "fix" for a bug with the seams for a while now, and since I can't figure out a better solution I'll share my current one.
Thursday, 4 June 2015
Dual Contouring with OpenCL
I've spent the last few weeks rewriting the core component of my engine, the voxel pipeline. This encapsulates the whole process from density function to a triangle mesh. In terms of functionality the pipeline is essentially the same, but now is (almost) entirely implemented using OpenCL. In fact the OpenGL/OpenCL interop is used so that the generated mesh lives and dies exclusively on the GPU.
Wednesday, 29 April 2015
QEF implementations for C++/GLSL and OpenCL
I've created a github repo to hold QEF implementations. The repo currently contains a version created by Leonard Ritter (@paniq) which is a stripped down version of the original implementation by /u/unzret from my previous post. I've also forked that to create an OpenCL version, and added that to the repo too.
These implementations are completely free for any purpose which is an improvement over the reference implementation's license (which was free for non-commercial use). Moreover, this implementation is suitable for use on the GPU which is a technical improvement on the reference version.
I know a lot of people reading this blog are using C# so perhaps someone wants to contribute a C# port? Ideally the repo would be a single resource for QEF code so no one else ever has to write it!
These implementations are completely free for any purpose which is an improvement over the reference implementation's license (which was free for non-commercial use). Moreover, this implementation is suitable for use on the GPU which is a technical improvement on the reference version.
I know a lot of people reading this blog are using C# so perhaps someone wants to contribute a C# port? Ideally the repo would be a single resource for QEF code so no one else ever has to write it!
Tuesday, 10 March 2015
Engine overview
This post will be describing at a fairly high level how my engine works in the last video I posted to YouTube. There are a few places where I go into some more detail as these were either requested explicitly by someone or I have been asked about them multiple times. If there's anything you'd like expanded upon let me know in the comments.
Friday, 20 February 2015
Updated Sample Application
I've updated the sample Dual Contouring implementation to use a new QEF implementation. You can now find the sample on Github.
The previous QEF implementation was from the original reference code and was under a non-commercial license. The new implementation is completely free for any purpose and is, I think, a lot more readable than the old implementation. This new implementation was written by /u/unzret who contacted me on Reddit.
Sunday, 9 November 2014
Implementing Dual Contouring
If you've read the Dual Contouring paper and the ProcWorld post From Voxels To Polygons but haven't been able to get an implementation working, then this post is for you. I've put together a Dual Contouring implementation and added it to a Github repo. The rest of this post will explain how it works.
Sunday, 28 September 2014
Dual Contouring: Seams & LOD for Chunked Terrain
There was a mistake in the original version of this post, the second last selectionFunc was a duplicate of the previous entry in the table. The table has now been corrected. Apologies to anyone who was tearing their hair out trying to debug that one!
Then about a year ago, EverQuest Next was announced. Far from using blocky Minecraft style graphics EQN looked like a typical AAA game. I wanted to know how this was possible, and quickly discovered that I already knew -- it was based on the Procedural World project. I realised Miguel was really on to something here, and the next day started on a new voxel renderer. I set myself a goal: learn how this technology worked by creating a Dual Contouring renderer that would be capable of handling large terrains.
Introduction
A couple of years ago I read these blog posts (1, 2) on 0 FPS, and like a lot of programmers decided I should write one of these voxel renderers. I implemented Marching Cubes first, but I was unhappy with the way terrain looked using MC -- it was far too blocky. I then implemented Naive Surface Nets and was pleased that I now had smooth terrain, but I soon discovered that Surface Nets couldn't support sharp features, like a 90 degree angle. That meant it would never be possible to have both a smooth terrain and a realistic looking building produced by the Surface Nets algorithm. I was aware of Dual Contouring from the 0 FPS posts, and my main source of information Miguel Cepero's Procedural World blog. Dual Contouring sounded like a significant step up in difficulty from Surface Nets, and I was quite skeptical about how feasible it would be to use Dual Contouring in a game. I never tried to upgrade my renderer to use DC and my interest in the project faded.Then about a year ago, EverQuest Next was announced. Far from using blocky Minecraft style graphics EQN looked like a typical AAA game. I wanted to know how this was possible, and quickly discovered that I already knew -- it was based on the Procedural World project. I realised Miguel was really on to something here, and the next day started on a new voxel renderer. I set myself a goal: learn how this technology worked by creating a Dual Contouring renderer that would be capable of handling large terrains.
Subscribe to:
Posts (Atom)