My result is that my Quad is not showing at all...
My code for Billboarding is:
I don´t understand why it is all blank?
[source lang="cpp"]float4x4 matWorldView = mul(worldMatrix, viewMatrix); float3 vPositionVS = position + float3(matWorldView._41, matWorldView._42, matWorldView._43); output.position = mul(float4(vPositionVS, 1.0f), projMatrix);[/source]
and my complete vertex shader looks like this :
OBS! My worldMatrix is Identity if that mathers.
[source lang="cpp"]VOut VShader(float4 position : POSITION, float4 normal : NORMAL, float2 texcoord : TEXCOORD, float4 color: COLOR){ VOut output; //This is the billboard code. float4x4 matWorldView = mul(worldMatrix, viewMatrix); float3 vPositionVS = position + float3(matWorldView._41, matWorldView._42, matWorldView._43); output.position = mul(float4(vPositionVS, 1.0f), projMatrix); //I just commented this code out for the billboard code //output.position = mul(final, position); //The rest is just lighting. // set the ambient light output.color = ambientcol; output.color.rgb = color.rgb; // calculate the diffuse light and add it to the ambient light float4 norm = normalize(normal); float diffusebrightness = saturate(dot(norm, lightvec)); output.color += lightcol * diffusebrightness; //be sure to take alpha last as other formulas might destroy this. output.color.a = color.a; output.texcoord = texcoord; // set the texture coordinates, unmodified return output;}[/source]
Edited by KurtO, 29 October 2012 - 11:29 AM.






