Saturday, September 29, 2007

Water surfaces

hi
a lot of features and bug fixes, one of them is water surfaces.
i'v added water surfaces at the beginning but there was no lights interaction with it, i just rendered it last and it doesn't looks real, one of the main changes i made is recreating the material system so each material stage could use different shader, also each shader need to have few techniques if light interaction is needed.
after all shaders recreated for this new material system, every surface in the game could define how light interaction will effect the surface, so water will effected by lights.
i'v also fix refraction mask generation, i'm using ambient pass to generate refraction map, after that i'm rendering water surface into alpha channel of this map so i could mask pixels that doesn't need to be effected by water pertubation effect.
here is few screenshots of water inside the game.

ambient and point light
flash light interaction
refraction (close look)

Saturday, September 15, 2007

Soft Particles

hi
one of DX10 features is the ability to read from depth buffer, in DX9 you can't do it unless you are generating it by yourself and pass it as texture.
in my ambient pass i'm using multiple render target, one for color buffer and one for depth, after that i'm setting it as texture and use it when needed in the pixel shader.
for soft particle effect, i'm reading the depth value from depth buffer rt and compare it with particle depth, then i'm compute new alpha value based on the difference between those values, (closest particle to level surfaces = more transparent).
here is few screenshots of the effect.
i marked in red the area the particles intersect with level surfaces.


Saturday, September 8, 2007

MegaTexture

hi
after seeing id tech 5 mega texturing, i though how the heal he did that?
so i start digging and reading a lot about clipmaps and streaming and i succeeded creating mega texturing.
to create the huge textures i'm using L3DT (pro trial version) i'v created 8k and 16k, the 16k texture took more than 12 hours to complete and with 5 mip levels its takes 1 giga.
my computer have only 1 giga ram so it's not impossible to use this texture in system mem.
here is few screenshots showing the difference between using mega texturing and not.
note that this is just sample app using engine features but for now its isn't integrated inside.
the app uses 16k streaming texture with about 20 mb gpu mem.
the fps difference is big because mega texture ps takes 74 instructions (not optimized)

using mega texture

not using mega texture (very blurry)

Sunday, August 12, 2007

Fixed time step

hi
i have added fixed time step with new interagor (midpoint or rk4) to the physics simulation (objects movement), until now i used the frame dt with euler (yes euler - very lame) integration and the results was very bad, the movement was very jerky (very noticeable when fps goes down and up during the game).
the problem is this, when we are using numerical integrations the result depends on the dt, the larger the dt the less accurate result we get, so if develop our simulation to run at 60 fps (dt = 1/60) and at some point the frame rate drops to 10 fps then the result we get is very inaccurate and results very odd movement (or even exploding), this is true for advance integrations as well - verlet, midpoint, rk4 etc...
with the new fixed dt, i assure the physics simulation runs at the same speed as the display frame rate (sync with it), so if the display frame rate is 30 fps and the physics design to run in 60 fps then we need to do 2 physics steps for every display update to make physics in sync.
i also added a final touch that interpolate between 2 physics states (previous and current) based on some alpha.
interpolation is needed to handle cases when the physics frame rate is not divided by display frame rate (without a remainder), for example the frame rate is 50 fps and the physics is 60 fps, so every frame the algorithm will have to alternate between 2 physics steps or one, this will be good enough to keep it in sync but visually it looks jerky.

Saturday, July 28, 2007

Outdoor scenes

hi, a a lot of updates i have integrated the GUI on weapons, also add option to add terrian models to map, see pictures below:

Sunday, June 24, 2007

GUI Continued

hi
there is a lot of updates, the must important ones is: events and if expressions.
here is the list of events supported by the system:
onTime - Runs the event at T+