复制纹理到纹理 [英] Copy Texture to Texture

查看:115
本文介绍了复制纹理到纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了2个程序来使用共享资源,它们在SlimDX& DirectX10.一个程序将在3D网格上显示共享纹理.第二个程序将图像加载为纹理.到目前为止,每次从新图像更新纹理时,我都需要传递共享处理.

I've done 2 programs to use Shared Resources, running on SlimDX & DirectX10. One program will display the shared texture on a 3D mesh. The 2nd program will load an image as texture. So far I need to pass the shared handled everytime the texture is update from a new image.

现在,有一种方法可以初始化固定大小的共享纹理(Texture2D),然后每次加载新图像时,我要做的就是将其加载为纹理,然后将其复制到现有纹理中.这样,共享句柄将不会更改,并且我可以节省传递共享句柄的一些开销.对于DirectX9,我确实知道有一个函数可以做到这一点,"StretchRectangle",但在DirectX10中找不到该函数或类似的东西.

Now, is there a way that I can initialize a fixed size shared texture (Texture2D), then everytime when I load a new image, all I need to do is load it as texture, then copy it to the existing texture. This way the shared handle would not change, and I can save some overhead of passing the shared handle. For DirectX9, I do know there a function to do just that, "StretchRectangle" but I can't find that or anything similar in DirectX10.

中间格式可以是任何东西,甚至可以是表面,只要我将其更新为共享纹理即可.

The intermediate format can be anything, even surface, as long as I get to update it to the shared texture.

谢谢

推荐答案

CopyResource()或CopySubresourceRegion()呢?我不知道SlimDX,但是这些在本机D3D10中应该可以正常工作.

What about CopyResource() or CopySubresourceRegion()? I don't know SlimDX, but these should work fine in native D3D10.

这篇关于复制纹理到纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆