Jump to content
  • Advertisement
Sign in to follow this  
Rienhl

Theory Behind These Uncharted 4 Bullet Trails

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

Hello everybody.
 
I'm trying to achieve a bullet trail effect similar to the one seen in Uncharted 4. 
Specifically, the bullet smoke trail (not the tracer round).
 
You can see the effect on the attached files and here: 


 
I don't believe they are using a Particle System, nor a Trail or Line Renderer for this. It looks like it is some kind of mesh which gets displaced in its trayectory. The effect can't be appreciated in all weapons, since most of them make all bullet trails follow an almost straight line. But some weapons leave a "wonky" trail, where the bullet kind of goes off its intended trayectory at first but then readjusts its direction.
 
People have mentioned using a disturbance field or turbulence shader.
I'm really new to shader programming and can't find a way around mixing examples I've seen around the web.
 
I'd really appreciate any kind of guidance tou guys can offer.
 
Cheers!

Share this post


Link to post
Share on other sites
Advertisement

I don't know how they achieved it, but when people want thicker textured lines, sometimes they use long narrow quads.

 

Since the line gets distorted, imagine you had a collection of line-segments attached to vertices, with each segment actually being a thin quad.

 

As the wind blows on the bullet trail (or rather, as you randomly pertube the trail), you distort the line vertices in-equally, distorting the appearance trail. Further, you also fade out the quads to make the trail fade into non-existence, and don't forget the quads themselves can be animated (with subtle smoke animation).

Share this post


Link to post
Share on other sites

You could look at ways to render lightning/electricity.  I know it isn't the same, but the principles could apply.  It generally involves calculating a line from A to B, and then perturbing points on said line, creating a chain of segments.  You could do something similar for this random smoke trail, but instead of rendering line segments as brightly colored, you either render lines as cloudy smoky textures(which little by little lose alpha), or make some sort of path particle emitter, or a point emitter than moves really quick along the path.

Share this post


Link to post
Share on other sites

I don't believe they are using a Particle System, nor a Trail or Line Renderer for this. It looks like it is some kind of mesh which gets displaced in its trayectory.
To me, it looks just like a particle system with a trail/line renderer, but immediately after spawning, the "smoke trail" starts deforming, with different particles in the trail drifting off sideways at different rates. 

Share this post


Link to post
Share on other sites
Try manually creating the smoke trail you want in a 3d modeling program such as blender first. Once you have figured out how to get the look you want manually, then try to write code to automate it.

If I had to guess how they made that effect, I would suspect they generate and manipulate a triangle strip with a texture/shader applied to it. Similar to a trail renderer but more customized.

Share this post


Link to post
Share on other sites

It appears that they are just using a quad strip particle effect and allowing the vertices to drift - this could be achieved by simply generating a single strip to submit to the GPU and then sending a time variable to the vertex shader which then randomly drifts the vertices while fading out the alpha. The goal here is to have the strip facing the camera, which is pretty simple to do, it's virtually the same as having a billboard face the camera. The texture coordinates of the smoke trail could also be allowed to drift lengthwise down the strip at a decelerating speed whilst also spreading out across the width of the strip to create a more vivid dispersal effect.

Share this post


Link to post
Share on other sites

I don't have any experience with Unity, I've always been a hardcore DIY type. I'm sure it can be pieced together pretty easily. The trick is treating the 'ribbon' (as it were) as just a line of points, ie: connect the dots, and generating the actual quad-strip vertices from those in screen-space. From there it's all about just how you animate the texture across that geometry, making it look like it's drifting down the strip and also drifting in the breeze by randomly pushing the points along the ribbon randomly and in accordance with an overall breeze velocity, I would imagine.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!