Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualsteven166

Posted 28 January 2013 - 09:20 AM

Thank Zaoshi Kaba, but I even modify the shader for debug, but values of three arrays are the same (1, 0, 0)

 

cbuffer cbPerFrame: register(b1)
{
float4x4 g_mMatrixArray[10];
}

VS_OUTPUT RenderSceneVS( VS_INPUT input )
{
    VS_OUTPUT Output;    

    float4 temp = 0;
    float3 posL = float3(1.0f, 0.0f, 0.0f);
    float4x4 temp1 = g_mMatrixArray[0] + g_mMatrixArray[1] + g_mMatrixArray[2];
    temp = mul(float4(posL, 1.0f), temp1);

    // Transform the position from object space to homogeneous projection space
    Output.Position = mul( float4(temp.xyz, 1.0f), g_mWorldViewProjection );
    
    Output.Color = input.Color;

    return Output;
}

 

errorls.jpg

 

As you can see the image, all matrices have the same value and they are float1x4 instead of float4x4. I do not understand sad.png


#1steven166

Posted 28 January 2013 - 05:08 AM

Thank Zaoshi Kaba, but I even modify the shader for debug, but values of three arrays are the same (1, 0, 0)

 

cbuffer cbPerFrame: register(t1)
{
float4x4 g_mMatrixArray[10];
}

VS_OUTPUT RenderSceneVS( VS_INPUT input )
{
    VS_OUTPUT Output;    

    float4 temp = 0;
    float3 posL = float3(1.0f, 0.0f, 0.0f);
    float4x4 temp1 = g_mMatrixArray[0] + g_mMatrixArray[1] + g_mMatrixArray[2];
    temp = mul(float4(posL, 1.0f), temp1);

    // Transform the position from object space to homogeneous projection space
    Output.Position = mul( float4(temp.xyz, 1.0f), g_mWorldViewProjection );
    
    Output.Color = input.Color;

    return Output;
}

 

errorls.jpg

 

As you can see the image, all matrices have the same value and they are float1x4 instead of float4x4. I do not understand :(


PARTNERS