Jump to content
  • Advertisement
Sign in to follow this  

Motion Blurs & Velocity Maps

This topic is 2781 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So i am trying to do a pixel motion blur using the same way that nVidia & DX SDK used. Render the scene on surface, calculate the velocity and output it as color info, then render the scene again and use the velocity info to create a Motion Blur( i skipped the step where you do the blur on separate quad and then apply it to the original scene because i think it isn't needed)
But the problem is that the Velocity map is not getting any info for some reason.
Here is the code

//Velocity Calculation Shaders
void VelocityVShader(float3 PosL : POSITION0,
out float4 oPosH: POSITION0,
out float2 oVel : TEXCOORD0)
float4 CurrVel = mul(float4(PosL,1.0f),gMatWVP);
float4 PrevVel = mul(float4(PosL,1.0f),gMatPrevWVP);

CurrVel /= CurrVel.w;
PrevVel /= PrevVel.w;

oVel = CurrVel - PrevVel;
oVel /= 2.0f;

oPosH = CurrVel;

float4 VelocityPShader(float2 Vel : TEXCOORD0):COLOR
return float4(Vel,1.0f,1.0f);

Any help on the subject will be really appreciated.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!