"First of all, original game do not have proper lightning,"
Original game had some kind of tile lightning. I am looking to improve OpenXCom to the maximum possible of graphic fidelty it can have. There is a lot of untapped potential. The goal of re-creating x-com has been achieved. Now it is time to take it to the next level.
"| because light go troughs walls and only depend on distance and ignored levels."
Valid complaint here, with real lightning inside of houses might become dark. Perhaps extra lights need to be added to game data.
"My lighting obeys walls and floors."
I am not sure what you are referring to ? OpenXCom, OpenXCom Extended ? A certain mod ? A certain set of options ?
"This is 10000 time more complex and compotation demanding than original."
Original ran on 33 MHz, so 330.000, so your version would require 330 GHz.
"And for your project. Per pixel you say?"
Yes per pixel, is the original idea to see how it looks like. This is what the original in a weird way does. Thanks to sprite rendering.The sprite rendering can be taken to a next level.
If that fails or doesn't look good, next step would be to do it per voxel. But this may not be necessary.
"Do you know that this game have 2d graphic?"
Yes, this is the brilliant part about it. It's not just 2d graphics. It's 2d graphics combined with 3d graphics.
The original had 2 kinds of graphics per sprites, not all but the 3d's yes.
The 2 kinds of graphics are:
1. 2D graphics sprites to show what the voxel 3d sprite would look like from it's orientation. In principle these 2d sprites are pre-rendered 3d voxel sprites.
2. 3D voxel, scaled down, run length compressed, 1 bit hit boxes. These were used to do hit detection of rays.
Combine these two restores the 3D voxel sprite. It is not necessary to have 3D voxel color data, the 2D colored sprites are "layered/pulled" over these 3D hit box/voxel detections.
The same can be done for lighting, the 3d voxels are used to detect hit of light rays. The sprites are then used as a texture to get color data for what the light color should be.
"How you calculate normals for flat sprites?"
Normals are not required. The 2d sprite is layered over the 3d hitboxes. The 3d hitboxes are interpreted as voxels. Each voxel has a 3D box, the normals for such a 3D box are known.
Thus these flat surfaces can be used to approxiamete the lightning. More advanced computations could be done by interpolation the voxels to create half voxels if so required.
"Another thing how do you plan do it without GPU?"
A first implementation on CPU would be easiest to see how it looks, then to asses the runtime it takes. Since the game is turn based and usually slow there is plenty of time to render the scene, very few interactive computations needed, except when a soldier moves, a bullit flies, or an explosion happens. Some of that could be pre-computed and/or re-used. Parts of the scene could also be pre-rendered and re-used if it was not changed.
As a matter of fact the entire scene could be rendered in a gigant 3D voxel scene. Since computers now have gigabytes of ram. I am pretty sure the entire level of a typical xcom level may residue in memory completely on a voxel to voxel basis.
However such incredibly memory usage might not be necessary if it can be computed per title and so forth to save some memory, this stays in line with the original idea/architecture of the game and could be used to scale up the graphics of the game to proportions never seen before in any computer game.
Sprites could be scaled by 4x times the size and re-done by artist.
It seems sprites are 16x16x24 ? At high resolution still looks nice if battlescape is not scaled. However what if the sprites are doubled in size 32x32x64. Perhaps this allows 3D artists to create nicer looking sprites and re-do the entire game at more detail. Perhaps even 64x64x128 for insanely cool graphics. Or 128x128x256 or 128x128x128 or even 256x256x256.
My preference would more likely be something like 256x256x256 and if needed to be scale it down. So that initial graphics files are max quality. This also prepares the re-imagined game for high resolution monitors like 4K and 8K.
"My lightning is on edge of limits for CPU can do where I only shade whole tiles."
I am unaware of what lightning you are referring to. So far you have showed a link to a youtube video of Terror from the Deep. I am not so much interested in TFTD. It was a nice game, but my focus will be on X-COM UFO Enemy Unknown.
"And you plan incense work up to by 32*40 times?"
OpenXCom runs fine on my laptop. The existing lightning of soldiers in the dark and such can be kept. An extra layer of lightning can be added on top of it.
The current laptop resolution is 1600x900.
Which is 1.440.000 rays.
Each pixel on the screen can and should be shaded at least once.
Once this is achieved, then asses how it looks, and perhaps add additional lightning if enough cpu is left.
Another option is to switch to multi-threading and/or cuda.
However my laptop has broken 3D chip, so for now openl and/or cuda is out of the question.
Better to have CPU rendering anyway