Pixel Shader 3.0:TEXCOORD始终为0,0 [英] Pixel Shader 3.0: TEXCOORD always be 0,0

查看:370
本文介绍了Pixel Shader 3.0:TEXCOORD始终为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屋!

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