
3. Particle-Based Simulation of Material Aging 45
void PS_SurfaceUpdate (
in float4 gammaPos : SV_Position , // a t l as pos o f gammaton
in float4 gammaMat : MATERIAL , // material of gammaton
out float4 newMat : SV_Target0 ) // new surface material
{
// get current and initial material on surface
float4 curMat = g_TexMatCur . Load ( gammaPos);
float4 orgMat = g_TexMatOrg . Load ( gammaPos);
// calculate transfer rates and update material
newMat = curMat − transferRate ( curMat , gammaMat);
newMat = max ( orgMat , newMat); // clamp
}
Listing 3.6. Gammatons are expanded to quads in a geometry shader and are splatted
into the atlas. This pixel shader removes ...