Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Vertex Shader Problem

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 trick   Members   

152
Like
0Likes
Like

Posted 01 February 2012 - 07:10 PM

I'm having trouble with my 3rd vertex shader for my application. I am getting E_FAIL result when calling
D3DX11CompileFromFile. Can anyone take a look at the HLSL below, and let me know if you see anything? I've been over it numerous times, and can't see what I'm doing wrong.

//Sprites.vs
//--------------------------------------------------------------------------------------
// Buffers
//--------------------------------------------------------------------------------------
cbuffer OnScreen : register( b0 )
{
float2 screenSize;
}
//--------------------------------------------------------------------------------------
// Typedefs
//--------------------------------------------------------------------------------------
struct VertexInput
{
float4 Pos : POSITION;
	float2 Tex : TEXCOORD0;
float2 sPos : TEXCOORD1;
float2 sSize : TEXCOORD2;
float2 tPos : TEXCOORD3;
float2 tSize : TEXCOORD4;
};
struct PixelInput
{
	float4 Pos : SV_POSITION;
	float2 Tex : TEXCOORD0;
};

//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PixelInput VS( VertexInput input )
{
	PixelInput output;
output.Pos = input.Pos;
output.Pos[0] = (((output.Pos[0] * output.sSize[0]) + output.sPos[0]) / screenSize[0]) - 1;
output.Pos[1] = (((output.Pos[1] * output.sSize[1]) + output.sPos[1]) / screenSize[1]) - 1;
	output.Tex = input.Tex;
output.Tex[0] = ((output.Tex[0] * input.tSize[0]) + input.tPos[0]);
output.Tex[1] = ((output.Tex[1] * input.tSize[1]) + input.tPos[1]);
	return output;
}


#2 MJP   Moderators   

19483
Like
0Likes
Like

Posted 01 February 2012 - 07:31 PM

The compile error will be in the ID3D10Blob that you get back from the ppErrorMsgs parameter.

#3 trick   Members   

152
Like
0Likes
Like

Posted 01 February 2012 - 07:37 PM

Thanks for quick response! Managed to see what was going on, after checking that.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.