Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 07 Oct 2007
Offline Last Active Apr 20 2016 12:57 PM

Posts I've Made

In Topic: Math behind anisotropic filtering?

23 March 2016 - 09:56 PM

The best way to think of it is to picture what a pixel looks like when projected into texture space. If the surface is aligned with the camera near plane then the pixel will map to a square in texture space. It could be freely rotated however and look like a diamond. For point sampling the texel closest to this square sample is used. For bilinear its a weighted average of the 4 nearest. For the case of mip mapping a mip level is selected such that the square is about 1 texel unit area. Think about this square projected onto each mip level. As each mip level goes down each texel effectively doubles in each axis.


For anisotropic filtering then the pixel is elongated and forms a thin rectangle. There is no mip level you can use which either fully represents all of the rectangle. Instead the rectangle can be subdivided into smaller rectangles such that they are more square like. Each of this subdivisions have their own texel centre and can be each bilinear filtered and averaged for a result whcih better represents all the texels that touch the rectangle.


Hope this helps. I know pictures will help better explain. I'm sure there is so good visual explanations out there. 

In Topic: Per Triangle Culling (GDC Frostbite)

21 March 2016 - 04:10 PM

The point is that the ALU processing capabilities far exceed that of the fixed function triangle setup and rasterizer. Using compute you can prune the set of triangles to get rid of the ones that don't lead to any shaded pixels and are therefore discarded. Its purely there to get a bit more performance. 

In Topic: How to draw 3d billboard fixed independent distance size?

26 October 2015 - 05:01 PM

Its probably worth calculating the distance usianf a projection onto the view space forward vector



float dist = dot(billboardpos-cameraPosition, cameraFwd)

In Topic: Non-linear zoom for 2D

04 September 2015 - 05:12 PM

The following code will do what you want assuming you have a constant update tick.


float Size = 16.0f;


then in the update

const float RateDecay = 0.99f; 

Size = Size*RateDecay;


If you don't have a fixed timestep you can do the same using exponential function

size = size * log(dt * kConstant)

In Topic: Post Processing Causing Terrible Swimming

27 August 2015 - 11:43 AM

This presentation is a great overview of how to resolve the issues you are probably seeing