DirectX:如何将纹理渲染到屏幕 (DirectX10.1)

发布于 2024-09-01 15:46:45 字数 58 浏览 3 评论 0原文

我在寻找如何将屏幕外纹理渲染到 屏幕。

谁能帮我指出正确的方向?

谢谢

I'm having some troubles finding out how i can render an offscreen texture to the
screen.

Can anyone help me with pointing me in the right direction?

Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慕烟庭风 2024-09-08 15:46:45

基本上,您渲染一个屏幕大小的矩形,将渲染的离屏纹理设置为纹理。

现在,了解一些细节:

最好预先生成所需的顶点缓冲区。您需要一个位置分量(X、Y、Z,尽管从技术上讲您不需要 Z)和 UV 分量。我建议制作其中之一供整个程序使用,左上角位置为 0, 0, 0,UV 0, 0,右下角位置为 1, 1, 0,UV 1, 1。然后,渲染你的纹理,设置纹理(就像任何其他纹理一样),设置矩阵以将其缩放到您想要的任何位置,然后使用该顶点缓冲区发送绘制调用。

Basically, you render a rectangle the size of the screen, setting as the texture the off-screen texture you rendered.

Now, for some details:

It's probably best to just generate your desired vertex buffer beforehand. You'll want a position component (X, Y, Z, though you technically don't need Z), and a UV component. I recommend making one of these for use by the entire program, with upper left corner being position 0, 0, 0 with UV 0, 0 and the bottom right being 1, 1, 0 with UV 1, 1. Then, to render your texture, set your texture (as you would any other texture), set your matrix/matrices to scale that to whereever you want it, and send off a drawcall with that vertex buffer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文