Original Post
Sup guys, How can someone achieve a classic motion blur effect? Also is there any good tutorial online? Thanks.
Quote:
Original post by pcbrainbuster
How can someone achieve a classic motion blur effect?
Quote:
Original post by pcbrainbuster
Sup guys,
How can someone achieve a classic motion blur effect? Also is there any good tutorial online?
Thanks.
Quote:Ooh, I never noticed that sample before - that looks pretty awesome.
Original post by MJP
There's the post-processing effect that's pretty popular these days, which is detailed in the PixelMotionBlur SDK sample.
Quote:Armadon's one isn't motion blur, it's just plain blur (As far as I see).
Original post by pcbrainbuster
The kind of blur I'm looking for would be the one Armadon just showed in his example but I do not work with managed DirectX :) Also the reason why I did not use the SDK is because its uses way to much extra code for an example which throws me off. So are there any online tutorials for it?
Quote:
Original post by Evil Steve
Ooh, I never noticed that sample before - that looks pretty awesome.
g_matWorldViewProj; // Current World * View * Projg_matWorldViewProjLast; // The World * View * Proj used in the previous framevoid VertexShader( float4 in_vPositionOS : POSITION, float4 out_vPositionCS : POSITION, float4 out_vPosCurrentFrameCS : TEXCOORD0, float4 out_vPosLastFrameCS : TEXCOORD1 ){ out_vPositionCS = mul(in_vPositionOS, g_matWorldViewProj); out_vPosCurrentFrameCS = out_vPositionCS; out_vPosLastFrameCS = mul(in_vPositionOS, g_matWorldViewProjLast);}float4 PixelShader( float4 in_vPosCurrentFrameCS : TEXCOORD0, float4 in_vPosLastFrameCS : TEXCOORD1 ) : COLOR0{ float2 vVelocity = (in_vPosCurrentFrameCS.xy / in_vPosCurrentFrameCS.w) - (in_vPosLastFrameCS.xy / in_vPosLastFrameCS.w); return float4(vVelocity, 1.0f, 1.0f);}float4 PixelShader( float2 vTexCoord : TEXCOORD0 ) : COLOR0{ // Sample the velocity texture float2 vPixelVelocity = tex2D(velocitySampler, vTexCoord).xy; vPixelVelocity.y = - vPixelVelocity.y; // Move in the direction of the velocity, taking samples // along the way. float3 vSum = 0; for(float i = 0; i < 12.0f; i++) { // Calculate the sample position float2 vSamplePoint = vPixelVelocity * (i / 12.0f) + vTexCoord; // Sample the scene texture float4 vCurrentSample = tex2D(sceneSampler, vSamplePoint ); // Add it with the other samples vSum += vCurrentSample.rgb; } // Return the average color of all the samples return float4((vSum / 12.0f), 1.0f);}This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more