{
	float f = u_tcModParms[tcOffs++];
	if (f == GLSL_TMOD_NONE)
		return;
	if (f == GLSL_TMOD_MATRIX)
	{	// stupid ATI HD2600 can't parse 'a*u[t++]+b*u[t++]+u[t++]' :((
		vec2 sm = st;
		float pa, pb, pc, pd, pe, pf;
		pa = u_tcModParms[tcOffs++];
		pb = u_tcModParms[tcOffs++];
		pc = u_tcModParms[tcOffs++];
		pd = u_tcModParms[tcOffs++];
		pe = u_tcModParms[tcOffs++];
		pf = u_tcModParms[tcOffs++];
		st.s = dot(vec3(sm, 1.0), vec3(pa, pb, pc));
		st.t = dot(vec3(sm, 1.0), vec3(pd, pe, pf));
	}
	if (f == GLSL_TMOD_TURBULENT)
	{
		vec2 sm;
		float now = u_tcModParms[tcOffs++];
		float amplitude = u_tcModParms[tcOffs++];
		sm.x = sin(((glVertex.x + glVertex.z) * 0.125/128.0 + now) * 2.0 * 3.14159);
		sm.y = sin((glVertex.y * 0.125/128.0 + now) * 2.0 * 3.14159);
		st += sm * amplitude;
	}
}
