Direct3d/C#-在精灵上绘制的矩形下的模糊区域 [英] Direct3d/C# - Blur area under a rectangle drawn on a sprite
问题描述
任何想法怎么做?我正在绘制一个应该是半透明窗口的矩形.我设法通过绘制半透明纹理来实现透明度,但是我也想模糊窗口下的任何内容.
Any idea how to do it? I am drawing a rectangle that is supposed to be a half-transparent window. I managed to do the transparency by drawing a half-transparent texture, but I also want to blur whatever is under the window.
通常(例如,使用GDI),我将创建该区域的位图,对其进行模糊处理并将其绘制为窗口的背景.使用Direct3D,我什至不知道如何获得已经渲染过的区域.甚至可以有不同的方法,不是吗.请帮忙.
Normally (eg. using GDI) I would create a bitmap of the area, blur it and paint it as the background of my window. With Direct3D I don't even know how to get the area with whatever is already rendered on it. Or even there can be a different approach, can't it. Please help.
推荐答案
D3D方法是使用像素着色器模糊"矩形下面的区域.
The D3D way is to use a pixel shader to "blur" the area underneath your rect.
此链接显示了如何使用C#中的像素着色器.
而且链接具有一个波斯模糊像素着色器.
This link shows you how to use a pixel shader in C#.
And this link has a guassian blur pixel shader.
这篇关于Direct3d/C#-在精灵上绘制的矩形下的模糊区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!