hi, this time i fixed my physics objects support so i could add more complicated objects to the scene not just box, sphere etc, but also concave models.
physx does not support dynamic concave objects but it support multiple collision shape per obj so in order to support concave objects we must do something called: convex decomposition which break down or split the mesh into few convex meshes.
the data is stored in xml file which include all the info to create the convex mesh shapes that describe to render model.
i created new function in the physics manager that creates physics obj directly from this xml file, also i add the ability to specify collision script file (this xml) to every render model exist in the scene.
to work with xml files i use tinyXml which is very small and easy to use.
here is few screenshots that shows perfect collision with concave objects:
Saturday, August 30, 2008
Saturday, August 23, 2008
Sound Manager
hi, this time i worked on the sound system, there is a lot of sound libs such as openal, bass, fmod, miles.
i chosed to use fmod ex because it is very advanced system and very easy to use.
i created sound manager to manage all sound creation in the game, i also add something called sound shader which is very similar to my material script.
sound shader is a script that let you to define specific parameters to one or few sounds and when you want to play the sound/s in that shader you just call CreateSoundFromShader(shaderNameInScript) which is a function inside sound manager and it will be played with all the attributes you specified in the script.
for example:
sound weapon_blaster_fire
{
minDistance 393
maxDistance 1181
volumeDb -2
frequentlyused
sound/weapons/blaster/fire01
shakeData 0 zzzztsolggeedccbbbaaaaaaaa
sound/weapons/blaster/fire02
shakeData 1 zzzztsolggeedccbbbaaaaaaaa
}
1) weapon_blaster_fire is sound shader name which we called from the code
min/max distance is the distance which the sound is audible
2) volumeDb is volume in decibels
3) frequentlyused is one of few flags that allow me to control few sound attributes such as occlusion, looping etc. this is used to cache the sound so it will be played from memory and wont be decompressed every time we want to play it
4) sound/weapons/blaster/fire01 and sound/weapons/blaster/fire02 is 2 sound files we wish to play while activating this sound shader. by default we chose randomly one of them.
5) shakeData is intensity of the sound in ascii form (z is loud, a is complete silence), i use it to change camera view based on the sound volume.
few of the sounds in the game must be played in relation to model animations, so to make it possible i created something called frame based event system, which allows you to specify events that will be triggered on specific animation frame/s.
for example, this is how i created shotgun reload sound events:
VIEW_RELOAD_CMD =
{
"RELOAD", "9", "sound", "weapon_shotgun_clipout",
"RELOAD", "22", "sound", "weapon_shotgun_clipin",
"RELOAD", "35", "sound", "weapon_shotgun_pump1",
"RELOAD", "38", "sound", "weapon_shotgun_pump2"
}
"RELOAD" is animation name
"9", "22", "35", "38" is frames to trigger the event
"sound" event type - all of them is sound
the last parameter is based on event type, in sound events its sound shader name
i chosed to use fmod ex because it is very advanced system and very easy to use.
i created sound manager to manage all sound creation in the game, i also add something called sound shader which is very similar to my material script.
sound shader is a script that let you to define specific parameters to one or few sounds and when you want to play the sound/s in that shader you just call CreateSoundFromShader(shaderNameInScript) which is a function inside sound manager and it will be played with all the attributes you specified in the script.
for example:
sound weapon_blaster_fire
{
minDistance 393
maxDistance 1181
volumeDb -2
frequentlyused
sound/weapons/blaster/fire01
shakeData 0 zzzztsolggeedccbbbaaaaaaaa
sound/weapons/blaster/fire02
shakeData 1 zzzztsolggeedccbbbaaaaaaaa
}
1) weapon_blaster_fire is sound shader name which we called from the code
min/max distance is the distance which the sound is audible
2) volumeDb is volume in decibels
3) frequentlyused is one of few flags that allow me to control few sound attributes such as occlusion, looping etc. this is used to cache the sound so it will be played from memory and wont be decompressed every time we want to play it
4) sound/weapons/blaster/fire01 and sound/weapons/blaster/fire02 is 2 sound files we wish to play while activating this sound shader. by default we chose randomly one of them.
5) shakeData is intensity of the sound in ascii form (z is loud, a is complete silence), i use it to change camera view based on the sound volume.
few of the sounds in the game must be played in relation to model animations, so to make it possible i created something called frame based event system, which allows you to specify events that will be triggered on specific animation frame/s.
for example, this is how i created shotgun reload sound events:
VIEW_RELOAD_CMD =
{
"RELOAD", "9", "sound", "weapon_shotgun_clipout",
"RELOAD", "22", "sound", "weapon_shotgun_clipin",
"RELOAD", "35", "sound", "weapon_shotgun_pump1",
"RELOAD", "38", "sound", "weapon_shotgun_pump2"
}
"RELOAD" is animation name
"9", "22", "35", "38" is frames to trigger the event
"sound" event type - all of them is sound
the last parameter is based on event type, in sound events its sound shader name
Saturday, August 16, 2008
Material Hit Effect
hi, this week i fix my projectiles hit effects so they support per surface material effect,
until now, i had only one impact effect per projectile for all surface types, this was very unnatural when you hit water surface because it was applied the same effect on it, so you saw decal rendered on the water, yes - very strange so now if you hit glass surface the effect will be different when you hit stone or liquid surfaces, depending on what you defined in the weapon script.
here is a screenshot that shows the effect on stone, glass surfaces:
until now, i had only one impact effect per projectile for all surface types, this was very unnatural when you hit water surface because it was applied the same effect on it, so you saw decal rendered on the water, yes - very strange so now if you hit glass surface the effect will be different when you hit stone or liquid surfaces, depending on what you defined in the weapon script.
here is a screenshot that shows the effect on stone, glass surfaces:
Saturday, August 2, 2008
Weapons Sniper Scope
hi, i'm still working on weapons features, this time i added sniper scope with nice radial blur effect.
to create this radial effect i needed to add few features to material system so i could define which shader to use in which stage and which shader parameters and samplers i need to bind when binding this shader.
i also add the option to use current back buffer image as one of the samplers i'm binding to the shader, so i could create post process effects.
the effect i chosed is radial blur so everything outside our zoom area will be blurred and stretched.
i also change aim accuracy based on zoom, the more we zoom in the more we get accurate.
here is screenshots of the effect.
to create this radial effect i needed to add few features to material system so i could define which shader to use in which stage and which shader parameters and samplers i need to bind when binding this shader.
i also add the option to use current back buffer image as one of the samplers i'm binding to the shader, so i could create post process effects.
the effect i chosed is radial blur so everything outside our zoom area will be blurred and stretched.
i also change aim accuracy based on zoom, the more we zoom in the more we get accurate.
here is screenshots of the effect.
Wednesday, July 23, 2008
Weapon Sight and Lock mode
hi
i worked on some game play features that allows you to control your weapon more easy.
1. adding weapon sight on the screen so you know where you are aiming at also when you are aiming on game entity (for now bots) you will see the name of the bot and the distance near your sight icon.
note that each weapon have its own sight icon.
2. weapon lock mode, allows you to lock your weapon to your shoulder, and set your view with weapon sight for more accurate aiming, also it increase weapon accuracy while shoting.
here his few screenshots:
note: hud removed from those sceenshots.
i worked on some game play features that allows you to control your weapon more easy.
1. adding weapon sight on the screen so you know where you are aiming at also when you are aiming on game entity (for now bots) you will see the name of the bot and the distance near your sight icon.
note that each weapon have its own sight icon.
2. weapon lock mode, allows you to lock your weapon to your shoulder, and set your view with weapon sight for more accurate aiming, also it increase weapon accuracy while shoting.
here his few screenshots:
note: hud removed from those sceenshots.
Monday, July 14, 2008
SSAO Integration
hi
last time i was playing with SSAO effect inside render monkey, after i was pleased with the results i started to integrate it into my engine.
it was very easy to integrate it because my flexible material system, the only thing i needed to do is to scale the parameters to fit my scene scale.
i still think there is few tiny things to fix (i don't know if i would fix them), but still it adds very nice global illumination effect :)
here is few screenshots:
last time i was playing with SSAO effect inside render monkey, after i was pleased with the results i started to integrate it into my engine.
it was very easy to integrate it because my flexible material system, the only thing i needed to do is to scale the parameters to fit my scene scale.
i still think there is few tiny things to fix (i don't know if i would fix them), but still it adds very nice global illumination effect :)
here is few screenshots:
Friday, July 11, 2008
Screen Space Ambient Occlusion (SSAO)
hi, since the game crysis (by crytek) every talks about it, so i thought to give it a try :)
ambient occlusion is a global shading method that computes how much a certain point need to be illuminated based on the surrounding objects.
in computer graphics we can calculated this by taking specific point in space and cast x rays in random directions from that point and for every ray hit we check add or subtract "illumination value" from that point based on the closeness of the object the ray hit.
the closest the surface we hit, the point will be less illuminated, so if we have a point in space surrounded by alot of objects the point will be darken while other point that does not have a lot of objects around will be lighten.
ssao approximate this by using the depth buffer, for every pixel we check/sample few pixels around and try to compute the amount of occlusion from those points based on the difference in the depth of the current pixel and the pixels around, this technique has a lot of tiny things to set up before you could make it looks good, because of that i'v chosen to use ati render monkey application to create and test my shaders.
i'm glade to say the after one day and a half i got it, and it looks very good.
here is a screenshot from my results:

ambient occlusion is a global shading method that computes how much a certain point need to be illuminated based on the surrounding objects.
in computer graphics we can calculated this by taking specific point in space and cast x rays in random directions from that point and for every ray hit we check add or subtract "illumination value" from that point based on the closeness of the object the ray hit.
the closest the surface we hit, the point will be less illuminated, so if we have a point in space surrounded by alot of objects the point will be darken while other point that does not have a lot of objects around will be lighten.
ssao approximate this by using the depth buffer, for every pixel we check/sample few pixels around and try to compute the amount of occlusion from those points based on the difference in the depth of the current pixel and the pixels around, this technique has a lot of tiny things to set up before you could make it looks good, because of that i'v chosen to use ati render monkey application to create and test my shaders.
i'm glade to say the after one day and a half i got it, and it looks very good.
here is a screenshot from my results:

Subscribe to:
Posts (Atom)





