Jump to content
  • Advertisement
Sign in to follow this  
Sante05

Help with sword trails

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

Hi, I just implemented a "sword trails" effect in the project I'm working on, but I'm having some rendering artifacts. Have tried to find the cause, unsuccessfully, so I'd really appreciate some help on it. As you can see in this zoomed in pic, it looks just like aliasing. It's more visible the slower the sword moves. What I'm doing here is rendering a triangle strip as the sword moves. No textures involved so far, just vertex colors and alpha blending. So, if you've implemented this effect before, or ran into this same problem, how did you solve it? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Pretty much a guess, but I'm thinking that triangles are overlapping slightly with their neighbors. How could you fix this? Not sure, but mabye using fewer triangles will help.

Share this post


Link to post
Share on other sites
I agree with Ezbez, it looks like parts of the triangles are overlapping. The only way that I can think of to fix it would be to use a triangle fan.

Looks pretty cool btw.

Good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
Pretty much a guess, but I'm thinking that triangles are overlapping slightly with their neighbors. How could you fix this? Not sure, but mabye using fewer triangles will help.


Yeah, I think as well that is caused by overlapping triangles. Using fewer triangles reduces the problem, but doesn't solve it, though (even when extremely reducing the number of them, there are still artifacts in their shared borders)

Also, I found out it's not really related to the speed the sword is moving, but with if the sword is turning or not. In this new capture you can see same sword, almost same speed, same number of triangles, and way fewer artifacts. Only difference: the guy's not twisting the sword around, but rather moving it vertically.

Share this post


Link to post
Share on other sites
as Programmer16 suggested, try using a Triangle fan. Other than that, you could try to filter out the artifacts... Have a loop scan through the positions of the pixels along the shared borders and just set any errant pixel to the right color/alpha... It is a difficult, Incredibly inefficient, and Incredibly stupid way to do it, but it should work.

Share this post


Link to post
Share on other sites
Quote:
Original post by medevilenemy
as Programmer16 suggested, try using a Triangle fan. Other than that, you could try to filter out the artifacts... Have a loop scan through the positions of the pixels along the shared borders and just set any errant pixel to the right color/alpha... It is a difficult, Incredibly inefficient, and Incredibly stupid way to do it, but it should work.


Not a triangle fan - a triangle strip with shared vertices at shared borders.

Share this post


Link to post
Share on other sites
Well, solved it. It turned to be rather easy after taking some sleep [rolleyes]

The problem happened because I was getting the hand's position to create the inner vertices of the strip. When rotating, the hand almost doesn't move, so I'm getting lots of almost degenerated triangles, in some cases overlapping each other and such.

To solve it, I'm just taking a different inner point, in the lower part of the sword, rather than the hand itself. It's a quick fix, sure, but we need to get a demo working for next week, and have to work on some bigger issues, so no time to rewritting the whole thing.

Thanks for the help!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!