Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMigi0027

Posted 24 May 2013 - 04:27 AM

Can you show your initialization code for directx 11?

What IDE are you using?

 

Have you tried to initialize your input layout without the Semantic COLOR ?

 

So it would look like this:

 

D3D11_INPUT_ELEMENT_DESC layout[3];
	layout[0].SemanticName = "POSITION";
	layout[0].SemanticIndex = 0;
	layout[0].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
	layout[0].InputSlot = 0;
	layout[0].AlignedByteOffset = 0;
	layout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
	layout[0].InstanceDataStepRate = 0;

	layout[1].SemanticName = "TEXCOORD";
	layout[1].SemanticIndex = 0;
	layout[1].Format = DXGI_FORMAT_R32G32_FLOAT;
	layout[1].InputSlot = 0;
	layout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
	layout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
	layout[1].InstanceDataStepRate = 0;

	layout[2].SemanticName = "NORMAL";
	layout[2].SemanticIndex = 0;
	layout[2].Format = DXGI_FORMAT_R32G32B32_FLOAT;
	layout[2].InputSlot = 0;
	layout[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
	layout[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
	layout[2].InstanceDataStepRate = 0;

	UINT numElement = ARRAYSIZE( layout ) ;
	if(D3DERR_INVALIDCALL == deviceDX11->CreateInputLayout( layout, numElement, blobVertexGBuffer->GetBufferPointer(), blobVertexGBuffer->GetBufferSize(), &vertexGBufferLayout ))
		return ;

 

 

And then the shader as the following:

 

struct vsIn
{
	float4 position : POSITION ;
	float2 texCoord : TEXCOORD0 ;
	float3 normal   : NORMAL   ;
};

struct vsOut
{
	float4 RTposition : POSITION1 ;
	float2 texCoord : TEXCOORD0 ;
	float4 color : COLOR0 ;
	float4 finalPos :SV_POSITION ;
	float3 normal   : NORMAL   ;
	float4 posInLightSpace	 : TEXCOORD1 ;
};

cbuffer globalMatrices
{
	float4x4 WorldView ;
	float4x4 WorldViewProj;
	float4x4 InverseTransposedWorld ;
	//float4x4 lightViewProj ;
}

vsOut vertex_main(in vsIn IN, vsOut OUT)//, in float4 position : POSITION0)
{
	
	//OUT.posInLightSpace = mul(position, lightViewProj); 
	OUT.RTposition = mul(IN.position, WorldView);
	OUT.color = float4(1, 1, 1, 1) ;
	OUT.color.w = 1.0 ; 
	//OUT.normal = mul(IN.normal, WorldView);
	OUT.normal = mul(IN.normal, InverseTransposedWorld);
	OUT.texCoord = IN.texCoord ;
	
    OUT.finalPos= mul( IN.position, WorldViewProj );

	return OUT ;
} 

 

 

Just to see if COLOR is the issue.


#1Migi0027

Posted 24 May 2013 - 04:23 AM

Can you show your initialization code for directx 11?


PARTNERS