adrianj / Direct3D-Testing

Toying around with Direct3D - specifically SlimDX
2 stars 1 forks source link

Height AGL #6

Open adrianj opened 12 years ago

adrianj commented 12 years ago

Set motion relative to it

adrianj commented 12 years ago

I have a working solution that uses the Vertex StreamOut, but it is slow. Major cost is iterating through the vertices to find the ones closest to the camera's X,Z location. If I needed to recalculate this each time the camera moves, then that is quite a burden for the CPU.

My next idea is to add an extra PixelShader output or different RenderTarget that retrieves the currently used HeightMap that way.

adrianj commented 12 years ago

Now using a seperate render target to draw a minimap of the local area. The idea if I can then sample the centre of this texture for the height.

Problem is the minimap moves in leaps, only when the minimap is updated. Still working on the logic to convert from World Coordinates to Minimap Image coordinates.