Sign in to follow this  
Followers 0
SPi

Motion blur in cod4

12 posts in this topic

How can u do Motion blur in cod4?

with vision files? (ik em well)
with cfg files? that i dont know what they are and what they do?

1

Share this post


Link to post
Share on other sites

Pluto, I believe he wants it to happen in the map not in post editing :p

3

Share this post


Link to post
Share on other sites

Pluto, I believe he wants it to happen in the map not in post editing :P

simpler in post editing though because it is not a command lmfao

0

Share this post


Link to post
Share on other sites

@Le Plut0

 

You posted a tutorial on how to use it for Adobe After Effects and a how to install for Sony Vegas...

 

and again

 

Try not to double post nubzor

 

Merged them for you  :P

 
0

Share this post


Link to post
Share on other sites

How can u do Motion blur in cod4?

with vision files? (ik em well)

with cfg files? that i dont know what they are and what they do?

loop a shellshock on a player :dumb:

0

Share this post


Link to post
Share on other sites

simpler in post editing though because it is not a command lmfao

 

He never said he was making a video.

0

Share this post


Link to post
Share on other sites

I don't know if it's possible + Many people hate motion blur and it can cause motion sickness.

I know how do to depth of field ingame if you want that :D

0

Share this post


Link to post
Share on other sites

Wow i haven't expected so many replies. Thanks.

I have Sony vegas 10 pro but thats not my concern. Motion blur in video edit may be useful later thanks.

As @@Caspa said for now i want to try make it in game.

@@Bear had a good idea. Shellshock looks like motion blur. What if we could edit the shelshock raw file and make a new one with a cleaner motion blur?

I think its called shader or something. Never worked with one of those, Ill take look on it.

Thanks for ideas.

1

Share this post


Link to post
Share on other sites

@@SPi

 

welp, since i created the shader tool :awesome: you could try to implement motion blur with a custom .hlsl shader applied to a fullscreen 2d hud elem :sir:

 


 

first off, download the shader tool from this thread http://raid-gaming.net/forums/topic/1679-adding-new-sm3-hlsl-shaders-to-cod4/?p=25888 and extract the files to your cod4 folder 

 

create a new techset with the following code and save it to raw\techsets and raw\techsets\sm2 folders with name motion_blur.techset

"unlit":
    motion_blur;

then create a new technique with the following code and save it to raw\techniques with the name motion_blur.tech

{
    stateMap "default2d";
 
    vertexShader 3.0 "motion_blur"
    {
    }
 
    pixelShader 3.0 "motion_blur"
    {
        colorMapSampler = sampler.resolvedPostSun; // if this gives weird results, try sampler.resolvedPostScene
        floatZSampler = sampler.floatZ; // depth map sampler???
        // rawFloatZSampler = sampler.rawFloatZ; // or this maybe???
    }
 
    vertex.position = code.position;
    vertex.texcoord[0] = code.texcoord[0];
}
 
then create a vertex shader to raw\shader_bin\shader_src\ with the name vs_3_0_motion_blur.hlsl

#define PC
#define IS_VERTEX_SHADER 1
#define IS_PIXEL_SHADER 0
#include <shader_vars.h>
 
struct VertexShaderInput
{
    float4 position : POSITION;
    float4 normal : NORMAL;
    float4 color : COLOR;
    float2 texCoord : TEXCOORD0;
};
 
struct PixelShaderInput
{
    float4 position : POSITION;
    float2 texCoord : TEXCOORD0;
};
 
PixelShaderInput vs_main(VertexShaderInput input)
{
    PixelShaderInput output;
 
    // position in clip space
    output.position = mul(float4(input.position.xyz, 1.0f), worldViewProjectionMatrix);
    output.texCoord = input.texCoord;
 
    return output;
}

and then you need to create a pixel shader to raw\shader_bin\shader_src\ with the name ps_3_0_motion_blur.hlsl ...

#define PC
#define IS_VERTEX_SHADER 0
#define IS_PIXEL_SHADER 1
#include <shader_vars.h>
 
struct PixelShaderInput
{
    float4 position : POSITION;
    float2 texCoord : TEXCOORD0;
};
 
float4 ps_main(PixelShaderInput input) : COLOR
{
    float4 output; 
 
    // your code here...

    // you can get the current pixel color like this:
    // float4 color = tex2D(colorMapSampler, input.texCoord.xy);
    // and current depth map value like this:
    // float4 depth = tex2D(floatZSampler, input.texCoord.xy);
    // or 
    // float4 depth = tex2D(rawFloatZSampler, input.texCoord.xy);
 
    return output;
}

im not on my home pc atm so i dont have cod4 nor mod tools to experiment with, so the actual pixel shader code is up to you... you could try something like this... http://http.developer.nvidia.com/GPUGems3/gpugems3_ch27.html

 


 

to compile shader for use in cod4, open a command line in raw\shader_bin and type the following:

shader_tool.exe motion_blur

press enter

any errors in shader compilation will show up in the command prompt

 


 

and... to use in cod4...

 

open asset manager and create a new material called "motion_blur_overlay"

 

set type to custom, and in the 'template' field type motion_blur (or motion_blur.techset, im not sure and cant test)

 

hit f10

 

add to your .csv:

material,motion_blur_overlay
techset,motion_blur
rawfile,techniques/motion_blur.tech

in your .gsc, precacheShader("motion_blur_overlay"); and create a fullscreen hud element and use setShader("motion_blur_overlay", 640, 480); on it, compile mod/map and see if it works

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0