Thursday, April 15, 2010

Yet Another Bsp Viewer Update!


It now renders lightmapped textures! Try it here.

I'm rendering the textures and the lightmaps on two separate buffers, then blending them together using Multiply blend mode. Unfortunately this requires rendering all triangles twice and since the drawing calls are the main bottleneck this results in almost halved performance.

Also, since I'm not doing any gamma adjustments the map ends up being displayed quite darker than in the quake 3 engine.

Also also, some textures are missing, I replace them with a plain white textures.

Thursday, April 8, 2010

BSP Viewer Update!

This is a mayor update to the flash Quake 3 BSP viewer I've been working on.

Try it here.

Current features:

  • Perfect triangle sorting ( No glitches, sort of ).
  • Near plane clipping ( Needed for indoors scenes ).
  • Frustrum culling of bsp nodes.
  • Backface culling of leaf faces.
  • Culling of unseen bsp nodes using Potentially Viewable Sets.
  • Lightmap parsing ( Now being displayed as solid textures ).
  • Renders into a flash.display.Graphics instance using flash 10 drawTriangles.
  • Uses custom projection instead of Utils3D.projectVectors.
  • Implemented in HaXe.

Whats next:

  • Load textures and render lightmaps ontop with Multiply blend. ( Probably quite costly to the CPU ).
  • Clean up the code, Release it.
  • Random optimizations.

And after that?

Bsps are really nice for static scenes, but they are too expensive for dynamic data. I have a few ideas in mind which would allow me to mix traditionally sorted models with the rendering of the bsp. I might implement that in the future.