CaffeineViking / vkhr

Real-Time Hybrid Hair Rendering using Vulkan™
MIT License
446 stars 34 forks source link

Find a Isosurface in the Density Volume #37

Closed CaffeineViking closed 5 years ago

CaffeineViking commented 5 years ago

After creating #36 we should try to find a good isosurface by raymarching the volume via proxy-geometry. I don't know what's the best way to do this, but one way is to simply "shade" when the density is higher than a certain value e.g. 5 (i.e. at least 5 strands in this voxel), and discard the fragment when we are below this. I'll start by doing this since it's simple, but I'm sure there are better ways to do this. Just to cross check that our volume is indeed suited to do this, I've tried running it through ParaView and use the "Contour" filter with 5:

ponytail-isosurface

CaffeineViking commented 5 years ago

Done! Visualizing the raycast where the density is above a certain value gives me these results. Here instead of just assigning a single color I've chosen to take the difference in depth value from the proxy-geometry. I've also visualized sampling from the AO, which as can be seen gives very similar results to the rasterized one.

2019-01-24 16-43-36

2019-01-24 16-48-09

2019-01-24 16-50-25