Saturday, October 8, 2011

Writeable Bitmap Alpha Channel

Was able to move the 3D engine to SilverLight and create aspx file ready for the web. So happy I have the alpha channel back thought I would make some tests.
Here is a wall of glass, from single line of code.
Adding another wall of glass is simple. The alpha value starts at 255, every time it hits a wall 64 is subtracted from alpha.
This is the glass with less opacity.
Just simply use screen.Pixels[offset] = Alpha << 24 | Red << 16 | Green << 8 | Blue;

A Voxel Engine is just a stack of slices in front of the camera. So as each slice is rendered alpha is decreased by one. It gives this effect.

The next screen shots show a basic 3D World. Moving up and down changes the light effect.


With a little trial and error, I came up with this background. Adding a desert map from Google would give me a World representing Mars for a space adventure.







No comments:

Post a Comment