- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
float sh0 =  tex2Dgrad( heightSampler, texSample, dx, dy ).r;
		float shA = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.88, dx, dy ).r - sh0 - 0.88 ) *  1 * g_fShadowSoftening;
		float sh9 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.77, dx, dy ).r - sh0 - 0.77 ) *  2 * g_fShadowSoftening;
		float sh8 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.66, dx, dy ).r - sh0 - 0.66 ) *  4 * g_fShadowSoftening;
		float sh7 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.55, dx, dy ).r - sh0 - 0.55 ) *  6 * g_fShadowSoftening;
		float sh6 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.44, dx, dy ).r - sh0 - 0.44 ) *  8 * g_fShadowSoftening;
		float sh5 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.33, dx, dy ).r - sh0 - 0.33 ) * 10 * g_fShadowSoftening;
		float sh4 = (tex2Dgrad( heightSampler, texSample + vLightRayTS * 0.22, dx, dy ).r - sh0 - 0.22 ) * 12 * g_fShadowSoftening;
	   
		fOcclusionShadow = 1 - max( max( max( max( max( max( shA, sh9 ), sh8 ), sh7 ), sh6 ), sh5 ), sh4 );
                                     
        
            HLSL, шейдер для Parallax Occlusion Mapping.
Пруф - http://xnacommunity.codeplex.com/wikipage?title=Parallax%20Occlusion%20Ma  pping&referringTitle=Home.&ProjectName=x  nacommunity, файл Textured.fx.
В принципе баян, но на HLSL ещё такого тут вроде не было :)