Pixel Shader 3.0:TEXCOORD始终为0,0 [英] Pixel Shader 3.0: TEXCOORD always be 0,0
问题描述
我正在使用DirectX 9.0c并使用基于Pixel Shader 3.0的ID3DXSprite :: Draw开发2D游戏,但我不知道为什么"Coord"总是(0.0f,0.0f)
sampler2D s2D;
float4 PShader(float2 Coord:TEXCOORD,float4颜色:COLOR):COLOR
{
返回tex2D(s2D,Coord)*颜色;
}
但它适用于Pixel Shader 2.0
Hi holihand,
感谢您在此处发帖。
>> ;我正在使用DirectX 9.0c并使用基于Pixel Shader 3.0的ID3DXSprite :: Draw开发2D游戏,但我不知道为什么"Coord"总是(0.0f,0.0f)
这是一个名为Visual Studio Graphics Debugger的调试工具。 Visual Studio Graphics Debugger极大地提高了可用性,支持Windows 8和Direct3D 11.1,并集成了传统的Visual Studio功能,如调用堆栈和调试
windows for a a a href ="https://msdn.microsoft。 com / en-us / library / windows / desktop / bb509561(v = vs.85).aspx">
HLSL 调试。
有关此新功能的详细信息,请参阅
调试DirectX图形。
以下是一些关于在Direct3D 9中编写着色器的文档。
< a href ="https://msdn.microsoft.com/en-us/library/windows/desktop/bb944006(v=vs.85).aspx"> https://msdn.microsoft.com/en-us/ library / windows / desktop / bb944006(v = vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb509704(v = vs.85)的.aspx
希望这可以帮助你。
最好的问候,
Sera Yu 强>
I'm using DirectX 9.0c and developing a 2D game using ID3DXSprite::Draw based on Pixel Shader 3.0, but I don't know why the "Coord" always be (0.0f, 0.0f)
sampler2D s2D;
float4 PShader(float2 Coord : TEXCOORD, float4 Color : COLOR) : COLOR
{
return tex2D(s2D, Coord) * Color;
}
But it work on Pixel Shader 2.0
Hi holihand,
thanks for posting here.
>>I'm using DirectX 9.0c and developing a 2D game using ID3DXSprite::Draw based on Pixel Shader 3.0, but I don't know why the "Coord" always be (0.0f, 0.0f)
Here is a debug tool called Visual Studio Graphics Debugger. Visual Studio Graphics Debugger has greatly improved usability, support for Windows 8 and Direct3D 11.1, and integration with traditional Visual Studio features such as call stacks and debugging windows for HLSL debugging.
For more info about this new feature, see Debugging DirectX Graphics.
And here are some documents about Writing Shaders in Direct3D 9.
https://msdn.microsoft.com/en-us/library/windows/desktop/bb944006(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb509704(v=vs.85).aspx
Hope this could be help of you.
Best Regards,
Sera Yu
这篇关于Pixel Shader 3.0:TEXCOORD始终为0,0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!