Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualFromShadow

Posted 13 November 2012 - 08:25 PM

Feeling like a total scrub now. Your correction works.
The particles are visible now and do turn (arround some wrong axis, though).
I think I can safely work from here. ^^

Thanks a lot, and sorry for this stupidity.

Edit:
Here is the new shader with a workarround using the View matrix for the billdboard orientation.
This way I don't need to use float3 at all.

[source lang="cpp"]VSOutput ParticleVS(VSInput input, InstanceData instance){    VSOutput output = (VSOutput)0;float lifeTimeFactor = (instance.T1 - T) / (instance.T1 - instance.T0);input.Position *= instance.Size * lifeTimeFactor;// transform to Screenspacefloat4x4 transform = transpose(View);transform[3] = 0;input.Position = mul(input.Position, transform);    // Calculate the particle's position    float dt = T - instance.T0;    input.Position += instance.Position;    input.Position += dt * instance.Velocity;    input.Position += 0.5 * dt * dt * instance.Acceleration;    float4 pos4 = mul(input.Position, World);    pos4.w = 1;    pos4 = mul(pos4, View);    pos4 = mul(pos4, Projection);     output.Position = pos4;    output.TextureCoordinate = input.TextureCoordinate;    output.Alpha = lifeTimeFactor;    return output;}[/source]

#1FromShadow

Posted 13 November 2012 - 03:21 PM

Feeling like a total scrub now. Your correction works.
The particles are visible now and do turn (arround some wrong axis, though).
I think I can safely work from here. ^^

Thanks a lot, and sorry for this stupidity.

PARTNERS