Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualbelfegor

Posted 18 July 2013 - 04:27 AM

I think that that ssao shader needs view space position (whole three components x,y and z), as i can see you store normals that way, although:

output.NormalW = mul(mul(worldMatrix, viewMatrix), float4(normal.xyz,0) );

this mul order is right if shader packs matrices as column major, i don't know dx11  shader systems so i am not sure, but in dx9 i can force row major with this statement:

#pragma pack_matrix(row_major)

beacuse it matches my system in cpp code and i always mul vectors with matrices this way:

result = mul( vec, matrix );

#2belfegor

Posted 18 July 2013 - 04:27 AM

I think that that ssao shader needs view space position (whole three components x,y and z), as i can see you store normals that way, although:

output.NormalW = mul(mul(worldMatrix, viewMatrix), float4(normal.xyz,0) );

this mul order is right if shader packs matrices as column major, i don't know dx11  shader systems so i am not sure, but in dx9 i can force row major with this statement:

#pragma pack_matrix(row_major)

beacuse it matches system in cpp code and i always mul vectors with matrices this way:

result = mul( vec, matrix );

#1belfegor

Posted 18 July 2013 - 04:24 AM

I think that that ssao shader needs view space position (whole three components x,y and z), as i can see you store normals that way, although:

output.NormalW = mul(mul(worldMatrix, viewMatrix), float4(normal.xyz,0) );

this mul order is right if shader packs matrices as column major, i don't know dx11  shader systems so i am not sure, but in dx9 i can force row major with this statement:

#pragma pack_matrix(row_major)

PARTNERS