Thursday, 30 April 2009

Heading Towards the End

Most of the work I have been doing lately has been on writing up my actual dissertation. While I'm getting there in terms of quantity I really need to put in diagrams, results tables and generally detail to clear things up. I've tried to finish up working on the application but I continually find myself toying with little things.

Most changes have been minor optimisations, things such as; streamlining the shader and vertex structures, reducing the number of unecessary temporary variables. I rethought the Indices to reduce Draw Indexed Primitive calls from 128 to 65, ideally it could be reduced to 2 but that would involve finding a way to pass the random number to the geometry shader for each strip.

I spent some time trying to arrange the hair strips in a more sensible fashion though I have not had much success with that, it's hard to shake the blockiness in particular.



The collision detection has been improved, the forces being calculated most of the time were far too big because the distances weren't normalised. The result of this being the hair would thrash wildly rather than trying to find equilibrium. Generally all the collision detection manages to do though is give the hair a bit of volume, intersections are still very likely to occur and create visual artefacts due to the polygons passing through each other when they do.

I toyed with a few features of DirectX 10 but lack of clarity in the available documentation left me lost as to how to actually utilise features such as Texture2DMS which could perhaps potentially have been useful in the shadow mapping.

I find myself not sure whether I'm pleased or disappointed with the application as it stands. Performance wise it reaches acceptable standards but it falls short on many areas of Appearance and Behaviour.

Thursday, 9 April 2009

Shadows and Optimisation



A little overdue for an update this time as some things got in the way briefly. I've managed to implement some basic shadow mapping which took about 3 days in all. Shadow mapping is a fairly simple concept. A depth map is made from the light's world, view and orthographic/perspective. This same transform is then used to project the depth map onto the hair in the pixel shader. As much as i would have liked to try and do Deep Opacity mapping for the shadows I suspect time is now far too short to try to implement them. Also performance is becoming an issue as it is beginning to fall further beyond acceptable levels.

Other than shadow mapping I've made a few minor optimisations. I managed to move the calculation of part of the diffuse lighting term to the vertex shader. Also I changed the way I was doing the WVP transforms for the hair strips. I suspect the major bottlenecks in the application are focussed around the vertex buffer.

Also I've been trying to work on arranging the hairs better though that's proving awkward without making a mess.