Freitag, 17. August 2012

OpenCL Voxel Splatting 2.000.000.000 points/s

This time OpenCL is used for rendering the voxels as single points. The gaps between are filled in a post-process. The performance is much better than OpenGL: 2 Billion Points/sec @ GTX580M

Resolution:1024x768 Voxel Field: 20.000 x 20.000 x 1024 Voxels, Framerate: 30-40 Fps, LOD and Frustrum Culling are used. Dataset: 5.4M points  / instance at highest resolution , 6.9M including all levels of detail.

Download : Link1 Link2

Samstag, 21. Juli 2012

Voxel Splatting using OpenGL & Shaders

This screenshot shows a first test of using OpenGL 
and the Geometry Shader as well as LOD to render 
a voxel scene. 

Specs:
* 4 bytes / voxel 
* ~40 fps for the scene on the left
* LOD support
* Per voxel frustrum culling





Main bottleneck seems to be the triangle setup after the Geometry shader. As for the memory consumption, 
4 bytes / voxel is more than RLE ( 3.5 ) and less than the previous posted octree method ( 6.8 )

Donnerstag, 19. Januar 2012

Procedural Geometry Maps & Tessellation Shaders

In this sample, terrains and objects are created using procedural geometry maps as input for the tessellation shader. For windows in procedural buildings, hole generation is supported. 

Features

• Geometry-Map based Procedural Geometry
• Dynamic Tesselation via Tesselation Shaders
• Procedural Holes / Extrusions

Performance

~ 48 FPS @ 1024x768 (no object culling)
~ 140 FPS @ 1024x768 (with object culling)
Used Hardware: Nvidia 560 Ti


   General Scene

 
   With carved holes        Wireframe




Samstag, 24. September 2011

Tessellation Shader Tutorial with Source Code C++

To make it easier to start with Tessellation Shaders, here a GL4.0 example. (VS9,C++). 

The file can be downloaded from here:

Update: a first performance benchmark gives around 266 Million Polygons/second using tesselation, which is slower than using a common VBO or OpenGL DisplayList (400 MPoly/s). However, its more flexible, so geometry can be rendered much more efficient.

Source for the tessellation control shader:
#version 410 core

layout(vertices = 4) out;

void main(void)
{
 gl_TessLevelOuter[0] = 2.0;
 gl_TessLevelOuter[1] = 4.0;
 gl_TessLevelOuter[2] = 6.0;
 gl_TessLevelOuter[3] = 8.0;

 gl_TessLevelInner[0] = 8.0;
 gl_TessLevelInner[1] = 8.0;

 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
}

Source for the quad tessellation evaluation shader:

#version 410 core

layout(quads, equal_spacing, ccw) in;

//quad interpol
vec4 interpolate(in vec4 v0, in vec4 v1, in vec4 v2, in vec4 v3)
{
 vec4 a = mix(v0, v1, gl_TessCoord.x);
 vec4 b = mix(v3, v2, gl_TessCoord.x);
 return mix(a, b, gl_TessCoord.y);
}

void main()
{ 
 gl_Position = interpolate(
  gl_in[0].gl_Position, 
  gl_in[1].gl_Position, 
  gl_in[2].gl_Position, 
  gl_in[3].gl_Position);
}
 

Dienstag, 14. Juni 2011

Voxel Sculpting test

Here a first test of using voxel sculpting with COAT3D, created in just few hours.

Sculpting is done in Coat3D, the lightmap is rendered in Blender. The models polygon count is reduced using MeshLab.

The UV map is not ideal in this case since its created in LithUnwrap. Using the unwrap function of Coat3D creates a seamless UV map.

Freitag, 4. März 2011

Raycasting Procedural Height-map based Geometry



This one is a trial to use multiple textures for defining a complex procedural 3D object. The basic idea is similar to True Impostors (link) - however with multiple maps to allow complex 3D objects. The screenshot below shows the rendering result of a biologic plant-like structure. The raycasting not optimized, but the results are promising. To render one bean, only a cube needs to be rendered - which means that its possible to render raycasted forests as well. As the geometry is procedural, also animation can be applied - as long as the animated part doesnt leave its bounding box.

Demo download: link

In the demo, the raycasting is not optimized yet which means artifacts near thin features can be observed. For the ones of you adept with shaders - shader source is included, so you can play around.

Screen Space Displacement Mapping

The demo is an experiment to combine terrain raycasting of perlin noise generated terrain with screen space ambient occlusions (SSAO) and screen space displacement mapping (SSDM).

The terrain is generated at the beginning of the demo as a 1024x256x1024 sized perlin noise volume data in CUDA, which is raycasted in the demo using distance functions for acceleration. To improve the quality, third-order texture filtering and hitpoint refinement using binary search are included.

After the first hit is found, the screen-space normal vector is computed for shading and for the SSDM. The SSDM is not achieved using a stack of textures as this leads to problems in case of overlapping areas for large displacements. Instead, the SSDM is achieved in a post-process using a high-resolution triangle mesh with two triangles per pixel. That is the reason why sometimes articafts near the screen-boundary can be observed.

The ones of you adept in CG may play around with the shader thats included.

Here the link to the Demo (needs an NVidia card as it uses CUDA):
Link1: Filefront
Link2: 2Shared

(Edit) Note: As the program generates the terrain as a 256MB PBO that is copied to the final texture, at least 768MB of GPU memory are recommended.



I've posted this already on Gamedev (link) a while ago, but to update the Blog as well, here it is.