Realtime morphing

Project diary for a realtime morphing demonstration. We are two skilled students at gsCept university creating an advanced real time morphing simulation. This is our diary about it.

Wednesday, November 17, 2004

Small progress update


Projected texture with shadowsPosted by Hello

Implemented projective texturing for the spotlight and it looks pretty cool.
The above image looks a "little" gray because the diffuse texture is gray both for the floor and the angel. All the color is coming from the projected texture, instead of using a constant diffuse / speclar color for the light i sample them from the projected texture.

Also the shadows is much smoother and has fewer aliasing problems than in the last post. I switched from a second depth shadow buffer and uses a first depth with a constant bias instead.
The shadow edges are filtered using a 3x3 PCF filter to make them look smoother (yes, it's a percentage closes filter but not bilinearly interpolated as some claim a PCF filter would be, the original paper about PCF from sigraph '87 does NOT use bilinear interpolation).

I really hope the 6800 GT gfxcard will be here soon, with that i'll probably be able to boost the framerate quite a bit because of the hardware accelerated shadow rendering wich for some reason isn't implemented on ATI cards.

Monday, November 15, 2004

Progress update


Shadow Posted by Hello

Since the last post i've been busy coding shadows, glow etc (im still in the vs/ps research/design phase of the project).
The shadowing is done using an ordinary shadowmap and i managed to get rid of most aliasing artifacts by using a second depth shadowbuffer.
It works by rendering the backfaces from the lights point of view instead of biasing the z-values for the frontfaces.
By rendering the backfaces i move the z-fighting problem to the "shadowed" areas of the object, this however introduced some problems when using normalmapping (the texel normal on a backface seen from the light can be tilted so much that it's actually visible) but this was solved by computing a geometric selfshadowing term using the interpolated normal from the vertices instead of the fetched one from the normalmap.
There is still some aliasing problems when a face is close to parallell to the light and at the moment i dont know if this can be helped at all.
I've also tried some different filtering techniques to soften/antialias the shadows, 2x2 PCF, 3x3 blur etc and each of them is good except in special cases so i havent decided yet with one to use.

Im now upp to in 3 passes to render a shadowed scene (1 for the shadowmap rendered from the lights perspective, 1 to compute the shadowing term and store that in alpha and 1 for the ordinary lightning etc wich gets alphablended with the previous pass).
The last 2 passes could be combined when i get hold of a card that supports ps 3.0 but with ps 2.0 im running out of space because the added calculations for filtering the shadow makes me exceed the limit on number of instructions.

I've also coded a pretty cool gloweffect but it remains to be seen if it's gonna be used in the final demo.

The screenshot above shows the shadowing/selfshadowing running with a 3x3 blur filter and a 1024 x 1024 shadow map generated from a spotlight.
There is only a flat normalmap and a green diffuse texture applied to the angel so it doesnt look to good but it's mainly to show the shadowing in progress.

If the fps seems low it's just because the "real" pixel / vertexshaders are in use but there is not any fancy texturedata to really show them off.

In the coming weeks i'll probably focus more on improving the shadow quality and fixing the engine design.


Wednesday, November 03, 2004

Engine progress

The engine is starting to shape up now.
There are some design issues left but it's getting usable at least (it's hard to keep from "overdesigning" instead of just getting the job done :)
There is a simple transform oriented scenegraph implemented with methods to collect renderable objects, lights, shadowcasters etc. so the rendering logic is controlled from the app layer (this makes it must simpler/faster to test effects etc).
So far skinned and nonskinned meshes work both with/without normalmapping.

There is only rotational skinning support right now but i'll implement the translation part in the near future.
The rotation is interpolated using SLERP (Spherical Linear Interpolation) and seems to give close enough results when compared to maya.
For the translation i'll probably use a hermite spline.

I also skin the normals/tangents using only the rotational part of the skinmatrix, this isn't entirelly mathematically correct but gives reasonable results (accurately recomputing the TBN space per vertex per frame is out of the question).

Monday, November 01, 2004

Concept sketch 001

Well this isn't exactly how it's going to turn out, but they look pretty cool anyway so I'll post 'em for your pleasure...


Well, the armor is from the regular angel actually, and have been a bit changed since this sketch. Colours are a little off, and wings shouldn't be that way at all.

Demo controls, v.00.01

Checkbuttons:
Normalmap
Specularity (toggles both specular map and specular power map)
Diffuse color (if off, use a default colour)
Wireframe (grays out other controls)
Shadows

Sliders:
Zoom amount
Morph amount [ angel -------- 50/50 -------- fallen ]

Time Controls: < | >
Play (starts animation, regular speed)
Freeze (pauses the animation)
Backplay (starts animation backwards, same speed)

Other buttons:
Reset (resets all controls to default values)
Demo! (starts the automatic controls)


Other controls:
Scrollwheel = zooms in/out, forward = in, backward = out
Left buttonpress + mousemove = camera pan
Right buttonpress + mousemove = Camera rotate


perhaps an invert mouse option?