Jump to content
  • Advertisement
Sign in to follow this  
kaifeng

Only using VS ( no PS )

This topic is 4012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I only want to use VS to calculate skin. and give the VS_OUTPUT to fixpipeline to continue process. But only position is display right. No texture and color on the mesh. And if i use PS, it works right.( But I cant use PS for I working on a rendersystem ) I dont know why. Please help, thanks a lot. There is my vs code:
float4x4 matBone[32];
float4x4 matWorldViewProj;

struct VS_OUTPUT
{
    float4 Pos 		: POSITION;
    float4 Diffuse	: COLOR;
    float4 Texcoord 	: TEXCOORD0;
};

VS_OUTPUT main( float3 InPos : POSITION, 
		float4 InColor : COLOR0, 
		float4 InTexcoord : TEXCOORD0, 
		
		float3 oripos : TEXCOORD4, 
		float4 blendindex0 : TEXCOORD5,
		float4 blendweight0 : TEXCOORD6,
		float4 blendindex1 : TEXCOORD7,
		float4 blendweight1 : TEXCOORD8 )
{
	VS_OUTPUT Out = (VS_OUTPUT)0;
	float4 position = float4( 0, 0, 0, 1 );
	if ( blendweight0.x + blendweight1.x == 1.0f )
	{
		position = mul( matBone[blendindex0.x], float4( oripos, 1 ) ) * blendweight0.x ;
		position += mul( matBone[blendindex1.x], float4( oripos, 1 ) ) * blendweight1.x ;
	}
	else
	{
		position = mul( matBone[blendindex0.x], float4( oripos, 1 ) );
	}	
	Out.Pos   	= mul( matWorldViewProj, float4( position.xyz, 1 ) ); 
	Out.Diffuse	= InColor; 
	Out.Texcoord 	= InTexcoord;
	return Out;
} 
If I use PS, it works right. PS code:
sampler tex0 : register(s0);

struct VS_OUTPUT
{
    float4 Pos 		: POSITION;
    float4 Diffuse	: COLOR;
    float4 Texcoord 	: TEXCOORD0;
};

float4 main( VS_OUTPUT v ) : COLOR
{
    return tex2D( tex0, v.Texcoord );
}
EDIT: Please remember to use 'source' tags in future. [Edited by - jollyjeffers on September 26, 2007 3:26:30 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!