3

I am writing a program (c# .NET 4.0 WPF 3D) that renders earth slices (like OpendTect's or Petrel's seismics module).

The problem is that I need to be able to zoom in deeply, and still see the details.

I tried putting a huge detailed texture (5000x5000), but it eats too much memory (200-300 MB), and crashes when I try to increase the size.

Now I want to see if there is any way of using something like a dynamic texture - the one that will change depending on distance to the camera.

Or maybe there is some other way of dealing with high-resolution surfaces?

I use this code to load texture:

wbm = new WriteableBitmap(
(int)1306*scale,
(int)ns*scale,
96,
96,
PixelFormats.Indexed8,
new BitmapPalette(getColors()));

...

visual3d.Material = visual3d.BackMaterial
= new DiffuseMaterial(new ImageBrush(wbm));
4

1 回答 1

1

您在这里有几个选择:

  • 优化当前解决方案。5000 * 5000 * 4 大约是 100 MB。你如何加载和显示纹理?我有一个应用程序可以渲染多达 1100 个 3d 对象并使用 300MB 内存,并且性能足够好。我强烈建议您运行分析器,不仅出于纯粹的性能原因,而且有助于捕获错误!我是 WPF 3D,感谢分析器,我发现我在做无用的镶嵌。
  • 创建一个完整纹理的低分辨率图像和一些小的高分辨率图像,它们是纹理的一部分。如果用户单击/放大,您将加载适合视口的小型高分辨率图像。与谷歌地图类似的效果。
  • 使用 XNA。您可以在 WPF 中托管 XNA 并使用DXT纹理。我不确定,但 WPF 不直接支持该纹理共振峰。
于 2012-04-23T11:57:42.203 回答