Sunday, June 26, 2011

Warp speed

To implement the warp speed effect I decided to implement a generic motion blur effect. My strategy for that is based on avoiding a tick-based integrator:

The engine used to have two callbacks; step and draw. For every tenth millisecond, the step function would be called to update the internal state of the starfield, moving all the stars towards the camera. Then the draw function would be called to update the image on the screen.

This is now rewritten to get rid of the step function. The draw function now has a time-parameter, and the state of the starfield is calculated from this.

This makes it possible to look anywhere on the timeline, and I use this to draw the stars from fifty consecutive milliseconds in every frame. This is CPU intensive enough to warrant a play/pause-button.

Source


Saturday, June 25, 2011

Classic starfield

Simple perspective projection.

Source

Simple scroller

No perspective.

Source

Mission

While watching Star Trek TNG for my geek studies, I noticed how central the simple starfield simulation effect is for the series. They have some small variations, such as drawn-out stars due to "warp speed" and a camera pointing in a different direction than it is traveling.

I realized that while I have made several renditions of the effect, I have never added any extra effects such as these. I hereby pick up my old demo scene skillz and accept this challenge I have given myself.