Question

I seem to be in a rut at the moment while writing the rendering side of my game engine. My original plan was to implement, at the very least, dynamic per pixel lighting with HLSL and having a light buffer communicate with the shader for a maximum of 8 lights.

It is important to note that as of now, my entire map is made a 3 dimensional array of blocks (64x64x64). After a VERY basic face reduction algorithm, I'm looking at 32x32x32x6 faces to render in the worst case scenario. I'm going to be using other methods to reduce the load but first I wanted to get this settled.

Currently, with 8 lights in the shader, I'm obtaining frame rates of around 60-120 with a GTX 470 which is a decent card. Obviously there are many other optimizations I must look into but as dynamic lighting is not crucial to me (at least not for 8 lights), I've been looking into light mapping.

If I were to have 4x4 lumels per face, I'm looking at a texture atlas for my light map of the entire level that is 32x32x32x6x16 large with 4 bytes per pixel. This comes out to a texture that I would use that is 2048x2048 (closest power-2 resolution).

I've already looked at a couple of sources, notably this one, http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml, and while I grasp how to implement it with a basic scene, I'm stumped on how I could implement it with my current geometry situation.

So here is my question. Is there a better way to do this? Is a light map of this size alright to use? I feel comfortable with using 4x4 lumels per face as the bilinear filtering seems to really smooth things out in the end. Also, would it be fairly simple to combine a static light map system with a dynamic per pixel one with HLSL?

Was it helpful?

Solution

http://www.rastertek.com/dx10tut18.html

Textures you use would be 4x4 mini textures inside your "super texture". Check out that link, but to be honest, you aren't giving very much to go on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top