Jump to content
  • Advertisement
Sign in to follow this  

Slash weapon effect

This topic is 5180 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

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.

Share this post

Link to post
Share on other sites
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.

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!