摘要: cg内置的变量glstate.matrix.modelview[n]: modelview matrix nglstate.matrix.invtrans.modelview[0]:ModelViewIT 模型视图矩阵转置的逆矩阵,用于把顶点法向量变换到世界空间glstate.matrix.mvp:modelview-projection matrixglstate.matrix.projection :projection matrixglstate.matrix.texture[n] :texture matrix nglstate.matrix.palette[n]:palette ma 阅读全文
posted @ 2011-10-17 21:08 wangwh0910 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 第一个CG程序1. 首先,自然是包含头文件#include <cg/cg.h>#include <cg/cgGL.h>#pragma comment(lib,"cg.lib")#pragma comment(lib,"cgGL.lib")2. 创建着色器程序所需的变量着色上下文CGcontext,着色器程序CGprogram,CGprofile是用来告诉CG如何选择最适合你显卡的方式来处理顶点或片段着色,CGparameter,参数传递,从你所写的程序中向着色器程序中传递参数.static CGcontext Context = 阅读全文
posted @ 2011-10-17 20:06 wangwh0910 阅读(435) 评论(0) 推荐(0) 编辑