问题描述
我试图从Direct2D效果中的顶点着色器中的输入纹理进行采样,通过基于存储在输入纹理中的向量移动顶点来扭曲图像。但是,每当我尝试从顶点着色器中的输入纹理进行采样时,采样
函数返回0。
我无法找到任何暗示这是明确可能或不可能的事情,这是我的主要问题。
有几个例子在Direct3D中这样做,但我宁愿单独使用Direct2D如果可能的话。示例代码显然会受到赞赏。如果事实证明这是可能的并且我做错了我会发布我的代码。
I am trying to sample from an input texture in a vertex shader in a Direct2D effect that distorts the image by shifting vertices based on vectors stored in the input texture. However, whenever I try to sample from an input texture in my vertex shader the sampling function returns 0.
I haven't been able to find anything suggesting that this is definitively possible or impossible so that's my main question.
There are several examples of doing this in Direct3D but I would rather use Direct2D exclusively if possible. Sample code would obviously be appreciated. If this turns out to be possible and I'm doing something wrong I'll post my code.
这篇关于是否可以在Direct2D顶点着色器中对输入纹理进行采样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!