使用FreeImage库加载纹理
[ 2007-03-05 16:26:29 | 作者: Admin ]
如有转载,请注释明:
http://www.azure.com.cn/
FreeImage是按GPL和FIPL发行的自由软件。目前支持26种图像格式,如bmp,jpeg,gif,png,tiff等等。可以在Windows, Linux or Mac OS X 平台上面使用。
要使用FreeImage当然我们首先包含其头文件。 然后在工程的附加依赖项中添加 FreeImage.lib
使用FreeImage加载纹理的代码如下: ...
阅读全文...
http://www.azure.com.cn/
FreeImage是按GPL和FIPL发行的自由软件。目前支持26种图像格式,如bmp,jpeg,gif,png,tiff等等。可以在Windows, Linux or Mac OS X 平台上面使用。
要使用FreeImage当然我们首先包含其头文件。
#include "FreeImage.h"
使用FreeImage加载纹理的代码如下:
const char textName[64] = ".\\woodfloor.tga";
// 获得图像文件的类型
FREE_IMAGE_FORMAT fifmt = [color=Blu
// 获得图像文件的类型
FREE_IMAGE_FORMAT fifmt = [color=Blu
阅读全文...
解决Z-fighting, 使用Polygon Offset
[ 2007-02-27 18:02:51 | 作者: Admin ]
如有转载,请注明:
http://www.azure.com.cn/
当两个面共面时,会出现十分难看的z - fighting 问题,
要解决此问题可以使用, Polygon Offset, 方法如下: ...
阅读全文...
http://www.azure.com.cn/
当两个面共面时,会出现十分难看的z - fighting 问题,
要解决此问题可以使用, Polygon Offset, 方法如下:
drawSomething();
//同一位置绘制另一个东西
glEnable( GL_POLYGON_OFFSET_FILL ); // This is the one we need...
glPolygonOffset( g_OffsetFactor, g_OffsetUnit );
drawOtherthing();
glPolygonOffset( 0.0f, 0.0f );
//同一位置绘制另一个东西
glEnable( GL_POLYGON_OFFSET_FILL ); // This is the one we need...
glPolygonOffset( g_OffsetFactor, g_OffsetUnit );
drawOtherthing();
glPolygonOffset( 0.0f, 0.0f );
阅读全文...
Occlusion Query (ARB_occlusion_query 扩展的使用)
[ 2007-02-27 15:17:47 | 作者: Admin ]
如有转载,请注明:
http://www.azure.com.cn/
Occlusion Query 的用处
板用黄色绘制, 球用红色绘制.
我们利用 Occlusion Query 来查询到他们分别显示在屏幕上的Fragment Count.
首先定义一些需要的函数指针
把他们定义为全局变量. ...
阅读全文...
http://www.azure.com.cn/
Occlusion Query 的用处
- 增量的物体级别的剔除
- 顺序独立的透明
- 光晕效果实现
- 模板阴影
板用黄色绘制, 球用红色绘制.
我们利用 Occlusion Query 来查询到他们分别显示在屏幕上的Fragment Count.
首先定义一些需要的函数指针
把他们定义为全局变量.
PFNGLGENQUERIESARBPROC glGenQueriesARB = NULL;
PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB = NULL;
PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB = NULL;
阅读全文...
如有转载,请注明:
http://www.azure.com.cn
作者:Max McGuire(06 May 2002)
翻译:azure
Object Outlining
物体勾边
Introduction
I was recently charged with the task of rendering outlines around models in the game I am working on to show when they are selected. There are a number of techniques available for accomplishing this, however they typically produce outlines of inconsistent ...
阅读全文...
http://www.azure.com.cn
作者:Max McGuire(06 May 2002)
翻译:azure
Object Outlining
物体勾边
Introduction
I was recently charged with the task of rendering outlines around models in the game I am working on to show when they are selected. There are a number of techniques available for accomplishing this, however they typically produce outlines of inconsistent ...
阅读全文...










