Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Dec 2002
Offline Last Active Today, 01:59 PM

Posts I've Made

In Topic: using coldet with DirectX

29 May 2014 - 06:43 AM

Double check (using the debugger) that all the objects are initialized before you call their methods. The code you posted seems ok, so the problem is likely elsewhere.


Is the exception code 0xC0000005 (access violation)?


Also, it is a good practice to check the HRESULTs of the D3D calls to determine if something went wrong. That code should work as is, though.

In Topic: using coldet with DirectX

28 May 2014 - 11:48 PM

How do you initialize "model"?

In Topic: Level Of Detail

19 May 2014 - 04:50 AM

Your mesh data would consist of patch control points; just before rasterizing, these patches would be expanded to grids of triangles with desired precision. The grid resolution is variable, which means that LOD is easy to implement.

A common type of patch is the Bézier patch, but in D3D 11 you can use any patch type that takes up to 32 control points. As a shader author, you write the function (domain shader) that interpolates between the control point data. I believe that modern OpenGL has its equivalent mechanism.

In Topic: Level Of Detail

19 May 2014 - 03:09 AM

It is also possible to implement LOD using tessellation; in this case, you'd only need one base mesh that contains patch control points. The control point mesh can usually be very light, as the polygonal surface (of almost arbitrary complexity) can be constructed on the fly. Tessellation can be augmented with heightmap textures to get more control over the details - this is a very common technique.


Reasonably modern hardware (D3D11 and later) implement tessellation in an unified manner, making the technology itself accessible. Tessellation hardware was available before this generation of GPUs, but the usage was highly vendor-specific.


Tessellation can, of course, be implemented on the software side too but you will lose some significant benefits of a hardware implementation (bus bandwidth, optimized processing).

In Topic: Using Directx11 without using a Microsoft math library

04 May 2014 - 10:50 PM

Direct3D has no special requirements about math libraries you happen to use with it.


In general, when you have calculated something on the CPU side, you send the result to the device in a constant buffer or a texture (or some other buffer types). The system does not care what data goes in there; it is the responsibility of the shaders to load the data and do something meaningful with it.


The shader stages are optimized to work with single-precision floating point numbers (float) so it would be beneficial if a CPU-side math library should be able to output them.


Note that internally, DirectXMath matrices and vectors are just arrays of float values. The library does impose some alignment restrictions to the types in order to leverage accelerated vector processing such as SSE2, but other than that, it is just basic math.