Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将相机输出与纹理混合(在 PostProcessing-Shader 中)。有没有加载纹理的方法?就像是
texture mytexture = "file.bmp" sampler2D smp = sampler_state { texture = <mytexture>; ... }
着色器是一个运行在 gpu 上的微程序。因此它不能做一些复杂的事情,比如从磁盘加载纹理。正确的方法是通过 DirectX-Api(例如)从您的程序中加载纹理,D3DX11CreateTextureFromFile并在着色器的渲染调用中设置此资源以便在那里使用它。
D3DX11CreateTextureFromFile