那些年我看到开源工程中的 光栅化算法
来源:互联网 发布:网络四大杀手 编辑:程序博客网 时间:2024/06/10 05:57
code source:salvia
代码展示
template<class T> void CRasterizer::rastTri_constColTex(int iy0,int iy1,sfByte8* buf,ZBUF_TYPE* zbuf,t_rasterizier_point attribute,T col,t_material* material){int affine=m_run_flags&RAST_AFFINE;int nline=0;for (int iy = iy0;iy>=iy1;- -iy,buf+=m_linebytes,++nline){int ix0 = idMath::FtoiFast(attribute.pl.x);int ix1 = idMath::FtoiFast(attribute.pr.x);ZBUF_TYPE* zbuf = m_zbuf + (m_context->getParam()->height-iy-1)*m_context->getParam()->width;T* screenbuf = (T*)buf;screenbuf +=ix0;if (affine)scanLine_ColTex_Affine(screenbuf ,ix0,ix1,col,attribute,material);elsescanLine_ColTex(screenbuf ,zbuf+ix0,ix0,ix1,col,attribute,material);attribute.interpolateVerticalCol();}}
结论分析
三角形,如下情形,y值变小,然后xright-xleft的差距越来越大
*
**
***
****
代码详细标记:
调用堆栈的处理过程:
softcore.exe!CRasterizer::scanLine_ColTex<unsigned int> //基础的函数,但是还只是发现位置而已 softcore.exe!CRasterizer::rastTri_constColTex<unsigned int> //这里的画三角函数,使用模板,softcore.exe!CRasterizer::drawTriangle_colTex(std::vector<CRasterizer::t_rast_triangle,std::allocator<CRasterizer::t_rast_triangl softcore.exe!CRasterizer::flush() 行386C++
//刷出buffer内容 softcore.exe!CSoftrender::rasterizer() 行721C++
//最后光栅化处理 ,包含纹理 softcore.exe!CSoftrender::renderFrame() 行505C++ softcore.exe!CChildView::RunFrame() 行205C++ softcore.exe!CMainFrame::RunFrame() 行105C++ softcore.exe!CsoftcoreApp::Run() 行172C++
//每一帧都在这里调用 mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00185289, int nCmdShow=0x00000001) 行47 + 0xd 字节C++ softcore.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00185289, int nCmdShow=0x00000001) 行30C++ softcore.exe!__tmainCRTStartup() 行574 + 0x35 字节C softcore.exe!WinMainCRTStartup() 行399C
0 0
- 那些年我看到开源工程中的 光栅化算法
- 那些年我看到的奇怪sql
- 直线光栅化算法
- 三角形光栅化算法
- 直线的光栅化算法
- 那些年我看到过的牛逼设计
- 光栅算法
- 直线光栅化算法--Bresenham算法
- 光栅化&插值的算法
- 2D三角形光栅化算法
- 自己动手实现光栅化直线生成算法
- 开源光栅化渲染器SALVIA的漫长五年
- 光栅化
- 光栅化
- 光栅化
- 光栅化
- 光栅化
- 光栅化
- symbol:constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature
- 从信息论的角度理解极大似然法
- Visual Studio 2008 Consolas字体包
- 排序问题(结构体排序)
- 访问String及其内容
- 那些年我看到开源工程中的 光栅化算法
- 11.6 UIScrollview的放大和缩小
- 输入一个字符串,求单词个数
- QMake 生成VS2013的工程文件
- 希望能坚持下去
- 如何配置JDK和设置系统默认JDK版本
- 【编程练习】收集的一些c++代码片,算法排序,读文件,写日志,快速求积分等等
- hdu 5093 Battle ships(二分图匹配)
- hdu4674 Trip Advisor,双连通分量,LCA