将缓冲区渲染到 XNA 中的 texture2D 对象 [英] Render buffer to texture2D object in XNA

查看:63
本文介绍了将缓冲区渲染到 XNA 中的 texture2D 对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 XNA 中,有没有办法在渲染到屏幕之前渲染到纹理对象之后渲染 spriteBatch 的内容?

In XNA is there a way to render the contents of a spriteBatch after drawing to a texture object before rendering to the screen?

推荐答案

因为 Hexxagonal 已经回答了,是的,你可以.但是,如果您使用半透明的精灵,您可能会遇到麻烦.原因是,两个重叠的精灵最终不会在您的屏幕外渲染目标中获得正确的 alpha 值.

As Hexxagonal already answered, yes you can. But you might get into trouble, if you are using sprites with translucency. The reason is, that two overlapping sprites wont end up with the right alphavalue in your offscreen rendertarget.

要使事情正确,您必须制作自己的 SpriteBatch 并开始使用预乘 alpha.

To make things right you will have to make your own SpriteBatch and start using premultiplied alpha.

这篇关于将缓冲区渲染到 XNA 中的 texture2D 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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