Unprojecting: 1000 questions, 0 answers

Started by
10 comments, last by ET3D 15 years, 5 months ago
Quote:Original post by resle
(Just out of curiosity... what makes picking easier in Dx10?)

Quite a few things:

- You can read from a depth buffer.
- You can get the instance, primitive and vertex ID in the shaders.
- You have a geometry shader, that can deal with triangles after transformation.
- You have stream output, so you can output things from the geometry shader.

All of these can be used for various forms of picking.
Advertisement
Quote:Original post by resle
Hmm, what I seem to fail to communicate is that I don't need to strictly pick an object. Think of another scenario: you've got a 3d terrain working with LOD and other tricks that add/remove vertices and faces dynamically. Then you need to click somewhere on that terrain and have some object move there: how do you get the point where the object should go? You can't use intersections, most of the gometry has been generated either by a shader or something else. Using intersections, too, would return - at best - the clicked *triangle*, certainly not the exact world point.

In this particular case the hierarchy can allow the CPU to trace a ray against the geometry quite efficiently. Especially if you're using D3D9 which probably implies that the addition/removal of vertices is done on the CPU.

This topic is closed to new replies.

Advertisement