Slash weapon effect

Started by
1 comment, last by andor 18 years, 8 months ago
i want to make effect when weapon slashed, it's like in game.....soul calibur anyone can help ?...... thankz
Advertisement
Hiya be17_17y,
How are you doing bud?

[The problem]
How can I achieve the slash effect in Direct3D?

[a Possible Solution]
Guess what?
direct3d comes to the rescue by explaining a effect called motion blur that will make the object seem to move faster than it actually is.

How do I achieve this effect you may ask?
Direct3D has a wonderful part in it's documentation where they explain what motion blur is and how to implement it.

I cannot find a link right now but let me paste it for anyone else who doesn't have access to the documentation


[Motion Blur]

You can enhance the perceived speed of an object in a 3-D scene by blurring the object and leaving a blurred trail of object images behind the object. Microsoft Direct3D applications accomplish this by rendering the object multiple times per frame.

Recall that Direct3D applications typically render scenes into an off-screen buffer. The contents of the buffer are displayed on the screen when the application calls the IDirect3DDevice9::Present method. Your Direct3D application can render the object multiple times into a scene before it displays the frame on the screen.

Programmatically, your application makes multiple calls to a DrawPrimitive method, repeatedly passing the same 3-D object. Before each call, the position of the object is updated slightly, producing a series of blurred object images on the target rendering surface. If the object has one or more textures, your application can enhance the motion blur effect by rendering the first image of the object with all its textures nearly transparent. Each time the object renders, the transparency of the object's texture decreases. When your application renders the object in its final position, it should render the object's textures without transparency. The exception is if you're adding motion blur to another effect that requires texture transparency. In any case, the initial image of the object in the frame should be the most transparent. The final image should be the least transparent.

After your application renders the series of object images onto the target rendering surface and renders the rest of the scene, it should call the IDirect3DDevice9::Present method to display the frame on the screen.

If your application is simulating the effect of the user moving through a scene at high speed, it can add motion blur to the entire scene. In this case, your application renders the entire scene multiple times per frame. Each time the scene renders, your application must move the viewpoint slightly. If the scene is highly complex, the user may see a visible performance degradation as acceleration is increased because of the increasing number of scene renderings per frame.


I hope this helps a bit bud.
Keep cool.
Take care.
Motion blur is one way of doing it, another way is to dynamically create a small triangle fan following the motion of the sword's movement. Each frame you can extend the fan by another section and adjust the colors of the older ones to make them fade out and eventually delete them when they are old enough. I've seen this sort of approach done before in commercial games, and I'm almost completely certain its what soul calibur is doing.

This topic is closed to new replies.

Advertisement