Intel sponsors gamedev.net search:   
Journal of YsaneyaBy Ysaneya      
Main project:

Infinity, a space-based MMOG

Forums

Sunday, March 25, 2007
In the past two weeks, I've been quite busy on various topics: experimenting the player-custom colors in shaders, and releasing a new ASEToBin version.

Misceallenous map

I wrote a lengthy post about player-custom colors, so I won't enter into details here. You can still see the thread here.

The idea is to use a "misceallenous" map ( for lack of a better name ) that encodes, in the red channel, pixels that are affected by the primary custom color; in the green channel, pixels affected by the secondary custom color; and finally, in the blue channel, an intensity saying how much dirt there can be at most on this pixel.

The player will be able in-game to select ( when he re-paints his ship, or acquires a brand new one ) a primary and secondary custom color. The dirt amount will be based on how old the ship is, how often it entered into dusty environments/atmospheres, etc.. The dirt map is not meant to replace aging, which can still be done with a separate set of texture maps.

Everything gets combined in the pixel shader.

Ambient occlusion

Last week, I added support for ambient occlusion. Usually, AO must be set up via render-to-texture in 3ds Max ( or equivalent software ), but it's still tricky to set the good parameters and to share the textures. So I've added AO to ASEToBin.

The algorithm works by using an UV map coordinate set ( same than for skinning / unique UV mapping ), and for each triangle, rasterize the triangle in the AO map. For each pixel, a certain amount of rays are cast on the hemisphere about the triangle surface. The amount of AO is based on the percentage of rays that hit back the object, versus the amount of rays that do not hit anything. So areas that are very occluded get a lower AO value, resulting in a darker pixel; while areas that are on a roof, with nothing above / near, get a white AO pixel.

This AO map is then multiplying with the diffuse and specular maps, giving a much more realistic feeling ( although subtle ) to the objects.

In the last ASEToBin, AO only works if your object uses unique UV mapping. If that isn't the case ( for example you are using tiling / generic textures ), it will not work.

New ASEToBin version

This new version can be downloaded here:

ASEToBin 0.6 ( 12.4 MB )

Main changes:
- fixed the stretching of the viewport when resizing the window
- fixed crashes when trying to load/export models, when a model is already loaded
- added an option to fix T-Junctions ( experimental )
- added an option to generate ambient-occlusion maps. There are 5 parameters that can be changed: the number of rays cast per pixel ( the higher, the better quality ) ; the strength of the AO ( the higher, the stronger the AO map will be ) ; the resolution of the AO map ( the higher, the better quality ) ; and the minimum and maximum distance at which rays should be cast ( default values are usually fine for small models, increase them for larger ones ).
- gave default textures when some of the material chunks were used in shaders, but not filled by the user at export time or in the .ASE.
- reviewed all the shaders: many shaders were useless. The remaining shaders allow to see the diffuse, misc and ambient maps; the vertex normals and the texture coordinates; or the final shader with or without optimized textures ( depending on if you checked the option in the converter tab ). All shaders use backface culling, and the final ( non-optimized ) shader uses the alpha channel of the diffuse map as an alpha mask. There's currently no alpha mask for the optimized shader.
- added a set of parameters in the viewer tab to customize the shaders; from top to bottom: the primary custom color; the secondary custom color; the dirt amount in 0-1; the specular power; a slider for the light direction; a slider for the light altitude (set it to the left and lighting will come from the underside; set it to the right, and lighting will come from the very top); the light color; the ambient color; the specular highlights color. Note that all colors are in high-dynamic range, so you can use values above 255. For example, (512 512 512) is a white twice brighter than standard white (255 255 255).
- added an option to set the camera speed
- added an option to change the skybox. The default one is gray, but if you go in Data/Textures/ you can select Skybox0_0.tga for a space-type ( ICP style! ) skybox.

A video of the new ASEToBin viewer can be seen here:

ASEToBin 0.6 video (14.9 MB).

It's sometimes a bit boring, but shows the new shaders and the parameters.




Comments: 3 - Leave a Comment

Link


All times are ET (US)

 
S
M
T
W
T
F
S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
26
27
28
29
30
31

OPTIONS
Track this Journal

 RSS 

ARCHIVES
October, 2009
August, 2009
July, 2009
May, 2009
April, 2009
March, 2009
February, 2009
January, 2009
November, 2008
October, 2008
July, 2008
June, 2008
May, 2008
April, 2008
March, 2008
January, 2008
December, 2007
November, 2007
October, 2007
September, 2007
August, 2007
July, 2007
June, 2007
May, 2007
April, 2007
March, 2007
February, 2007
January, 2007
December, 2006
November, 2006
October, 2006
September, 2006
August, 2006
July, 2006
June, 2006
May, 2006
April, 2006
March, 2006
February, 2006
January, 2006
December, 2005
November, 2005
October, 2005
September, 2005
August, 2005
July, 2005
June, 2005
May, 2005
April, 2005
March, 2005
February, 2005
January, 2005
December, 2004
October, 2004
September, 2004
August, 2004