Spectre Engine – Tracers and Shaders

Last time around we used particles to give the feeling of movement. That works well, but it uses a lot of particles and over time that can overwhelm the player in a sea of particles.  This time around I decided to try using tessellated tracers instead.  Basically imagine that each object will leave a ribbon of plasma behind it as well as a few smaller particles.

The tracer is a fairly simple idea.  As the ships, rockets, lasers, and other objects with propulsion systems move across the world, they will record their positions into the Tracer object.  The tracer object performs tessellation as new points are added and computes the trail that needs to be left showing movement.  Of course, the texture of the trail will seal the deal so to speak.  So of course, I am using a horrible texture at the moment, but you could imagine a plasma trail like texture would be much more convincing.  Over time, I feel like the trail should both dissipate much like the wake behind a moving boat over water. Also to give a smoother trail, I wanted to try multiple levels of tessellation, right now I started with the base case of 0 subdivisions, and I’m not really computing the joints correctly.  If the angle between two points becomes too large, the joint will become distored. Crazy maths what vector products will be my friend here, but for now.. its getting late, so I will leave it for another day.

While I was working on that, Dan worked on some Oren-Nayar shaders which you can see in the screenshot off to the side.  The grass sphere has one such shader, as well as a standard Lambert shader.  What is an Oren-Nayar you ask?  I’m glad you asked! Wikipedia explains the crazy maths for it, but in short, it makes the shading on a planet look more realistic.  Which will be important for our overall feel.

2013-06-30-Tracer

 

Some of the maths: ( ya I just draw pictures and hope for the best )

2013-06-30-Tracer-notes

Related Posts