len3d

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页

2007年7月14日

摘要: __asm { // dot_nd = - ( normal.x * ray_dir.x + normal.y * ray_dir.y + normal.z * ray_dir.z ); // optimized version : // xmm0 src // xmm4 dir ... 阅读全文
posted @ 2007-07-14 19:41 Len3d 阅读(835) 评论(2) 推荐(0) 编辑

摘要: class __declspec(align(16)) vector4 {public: union { struct { float x, y, z, w; }; __m128 mm; };};inline void dot3( vector4 & r, const vector4 & x, const vector4 & y ){ /**//*re... 阅读全文
posted @ 2007-07-14 17:15 Len3d 阅读(1114) 评论(0) 推荐(0) 编辑

摘要: __asm {; 152 : ray_dir = ray->dir;; 153 : ; 154 : dot_nd = - ( normal.x * ray_dir.x + normal.y * ray_dir.y + normal.z * ray_dir.z ); xorps xmm3, xmm3 ... 阅读全文
posted @ 2007-07-14 11:22 Len3d 阅读(484) 评论(0) 推荐(0) 编辑

2007年7月13日

摘要: 分析了一下编译器(VC8)生成的汇编代码,发现问题是编译器造成的。。。在没有用SSE优化的情况下,编译器生成的代码非常好,直逼手写代码。。。而在用了SSE优化以后,编译器不能合理的分配和利用寄存器,并且生成了很多冗余的指令,导致代码简直一团糟,接近于弱智水平。。。具体可参看下面的汇编代码,我在重要的行后面加了注释,方便理解。。。没用SSE并行:; COMDAT ?intersectEye@R... 阅读全文
posted @ 2007-07-13 11:26 Len3d 阅读(2250) 评论(0) 推荐(1) 编辑

2007年7月12日

摘要: template class MemPage {public: inline MemPage( UINT _size, MemPage *oldPage ) { UINT asize = MAX( _size, MEMORY_PAGE_SIZE ); head = _mm_malloc( asize, ALIGN ); page = (BYTE... 阅读全文
posted @ 2007-07-12 10:53 Len3d 阅读(308) 评论(0) 推荐(0) 编辑

2007年5月19日

摘要: 有关注过的朋友可能会知道,我的渲染器是基于光线追踪的,虽然以前的版本也有扫描线,但后来嫌同时维护两个渲染核心很辛苦,所以暂时改成纯raytracer了,所以这里新加入的毛发功能是基于后置处理的,方法很简单,就是用Z-BUFFER,然后毛发的光照模型我是直接用3ds max里面的各向异性标准材质,大家可能知道了这是一个3ds max的插件渲染器,所以我暂时没有用别的特别的模型,毛发的自阴影效果是用基... 阅读全文
posted @ 2007-05-19 14:13 Len3d 阅读(574) 评论(2) 推荐(0) 编辑

2007年5月11日

摘要: 在同一含670000多个多边形的场景中,我的渲染器和MR的速度一样快!完全用C++写成,暂时还没有用SSE并行算法,也没有用汇编! 阅读全文
posted @ 2007-05-11 16:51 Len3d 阅读(576) 评论(3) 推荐(0) 编辑

2007年4月27日

摘要: Shader Type Overview There are many types of shaders, all of which can be substituted by user-written shaders: material shaders describe the visible material of an object. They are the only man... 阅读全文
posted @ 2007-04-27 22:15 Len3d 阅读(997) 评论(0) 推荐(0) 编辑

摘要: Direct Illumination To understand indirect illumination, first we must clarify direct illumination. A shader that uses direct illumination, calculates the light coming directly from lights. We show th... 阅读全文
posted @ 2007-04-27 21:06 Len3d 阅读(587) 评论(0) 推荐(0) 编辑

摘要: General Subsurface scattering is a term used in computer graphics to describe the method for attaining the 'softer' look of natural materials such as skin, marble, and milk. The term comes from medica... 阅读全文
posted @ 2007-04-27 20:39 Len3d 阅读(1943) 评论(1) 推荐(1) 编辑

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页