08 2012 档案

摘要:Cg code for texture LOD calculation (copied from http://linedef.com/personal/demos/?p=virtual-texturing): 1 #define TEXTURE_SIZE 512 2 #define TEXTURE_MIPCOUNT 10 3 4 float MipLevel( float2 uv ) 5 { 6 float2 dx = ddx( uv * TEXTURE_SIZE ); 7 float2 dy = ddy( uv * TEXTURE_SIZE ); 8 fl... 阅读全文
posted @ 2012-08-16 09:47 Huidong Chen 阅读(633) 评论(0) 推荐(0)
摘要:I just did some math work on the distance between two lines in 3D space. After some boring calculation, I found the result itself is much more decent and help us to revisit the issue in an elegant way.Line 1: p = p1 + t * v1Line 2: p = p2 + t * v2(t is a scalar argument, while v1 and v2 are normaliz 阅读全文
posted @ 2012-08-16 09:17 Huidong Chen 阅读(278) 评论(0) 推荐(0)