• Create Account

# hupsilardee

Member Since 20 Oct 2010
Offline Last Active Feb 14 2015 12:42 PM

### In Topic: Tangents for heightmap from limited information

11 December 2013 - 12:21 PM

Thanks for the alternative! Your method actually looks faster.

(While we're here, would anyone mind reassuring me that this HLSL code to calculate the normal from the heightfield is actually correct?)

```float hxm = Heightmap.Load(int3(iPos.x-1, iPos.y, 0)).r;
float hxp = Heightmap.Load(int3(iPos.x+1, iPos.y, 0)).r;
float hzm = Heightmap.Load(int3(iPos.x, iPos.y-1, 0)).r;
float hzp = Heightmap.Load(int3(iPos.x, iPos.y+1, 0)).r;
float h = Heightmap.Load(int3(iPos.x, iPos.y, 0)).r;

float3 t1 = float3(2, hxp - hxm, 0);
float3 t2 = float3(0, hzp - hzm, 2);

float3 n = cross(t2, t1);
```

### In Topic: Direction Vector2 from float 0-360 degree in pixel shader?

08 July 2013 - 04:10 AM

```float2 vec;
```

### In Topic: Distance field font artifacts

02 July 2013 - 07:46 AM

Off topic tip: Instead of an alpha threshold, you could try a steep gradient outside the threshold, which will give nice antialiasing

### In Topic: MSAA in WinRT

08 June 2013 - 06:02 AM

You could try a post-process AA, but it might damage performance. There are many options out there because lots of research went into it after deferred rendering became popular a few years ago

### In Topic: Reflection/refraction map edges

01 June 2013 - 03:19 PM

I don't understand, why can't you clamp or saturate() the texture coordinates?

PARTNERS