TarAlacrin / HeightmapOnTheGPU

A dynamically tesselating, deforming terrain map made in Unity using Compute shaders

Home Page:http://www.samd.biz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HeightmapOnTheGPU

This was the result of further exploration on programming on the GPU. Similarly to the last project this was built in Unity using a combination of C# to handle the camera, motion of the object, and Data management; combined with HLSL to run most of the actual deformation on the GPU. Also involved with this one was CgFx to actually render the shader with height deformation, a simple and primitive ambient occlusion algorithm, and dynamic tessellation to increase the poly count the closer you get to the object. I wanted to explore how I could put something like this to even better use, so I developed this heightmap system that basically tests objects at each pixel to see if they intersect and then displaces it as it seems fit. The hardest part again was figuring out how to pass information back and forth, especially trying to figure out how to test the height for collision purposes. Right now it’s kinda primitive, and not easily scalable beyond the set amount of objects here. I also wound up programming a shader for the surface so it looks like you are actually digging into the dirt when you make depressions, and I added dynamic geometry tessellation (basically means that the closer you get to the object the smoother and more detailed the object gets).

About

A dynamically tesselating, deforming terrain map made in Unity using Compute shaders

http://www.samd.biz


Languages

Language:C# 43.5%Language:JavaScript 28.4%Language:GLSL 28.1%