本文整理汇总了C++中ObjModel::LoadOBJ方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjModel::LoadOBJ方法的具体用法?C++ ObjModel::LoadOBJ怎么用?C++ ObjModel::LoadOBJ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjModel
的用法示例。
在下文中一共展示了ObjModel::LoadOBJ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeApp
bool InitializeApp()
{
glClearColor(0, 0, 0, 1);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
// Load texture.
int width = 0, height = 0, comp = 0;
unsigned char *image;
image = LoadTGA("/home/aashish/tools/mywork/src.git/data/noise.tga", width, height, comp);
glGenTextures(1, &_gRandomSampler);
glBindTexture(GL_TEXTURE_2D, _gRandomSampler);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height,
0, GL_RGB, GL_UNSIGNED_BYTE, image);
delete[] image;
// Load shaders.
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/setRenderTargetsVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/setRenderTargetsPs.glsl",
_gSetRenderTargetShader))
return false;
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/clearRenderTargetsVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/clearRenderTargetsPs.glsl",
_gClearRenderTargetShader))
return false;
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/ssaoVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/ssaoPs.glsl",
_gSsaoShader))
return false;
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/hBlurVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/hBlurPs.glsl",
_gHorizontalBlurShader))
return false;
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/vBlurVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/vBlurPs.glsl",
_gVerticalBlurShader))
return false;
if(!CreateGLSLShader("/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/renderingVs.glsl",
"/home/aashish/tools/mywork/src.git/opengl/ssao_crytek/renderingPs.glsl",
_gRenderShader))
return false;
// Bind our shader variables.
_gOffset = glGetUniformLocationARB(_gRenderShader, "offset");
_gLight1Pos = glGetUniformLocationARB(_gRenderShader, "light1Pos");
_gLight1AmbientColor = glGetUniformLocationARB(_gRenderShader, "light1AmbientColor");
_gLight1DiffuseColor = glGetUniformLocationARB(_gRenderShader, "light1DiffuseColor");
_gLight1SpecularColor = glGetUniformLocationARB(_gRenderShader, "light1SpecularColor");
_gLight2Pos = glGetUniformLocationARB(_gRenderShader, "light2Pos");
_gLight2AmbientColor = glGetUniformLocationARB(_gRenderShader, "light2AmbientColor");
_gLight2DiffuseColor = glGetUniformLocationARB(_gRenderShader, "light2DiffuseColor");
_gLight2SpecularColor = glGetUniformLocationARB(_gRenderShader, "light2SpecularColor");
_gAmbientOcclusion = glGetUniformLocationARB(_gRenderShader, "aos");
_gSceneColors = glGetUniformLocationARB(_gRenderShader, "colors");
_gSceneDepths = glGetUniformLocationARB(_gRenderShader, "depths");
_gSceneNormals = glGetUniformLocationARB(_gRenderShader, "normals");
_gSsaoOffset = glGetUniformLocationARB(_gSsaoShader, "offset");
_gSsaoNormals = glGetUniformLocationARB(_gSsaoShader, "normals");
_gSsaoDepths = glGetUniformLocationARB(_gSsaoShader, "depths");
_gSsaoRandoms = glGetUniformLocationARB(_gSsaoShader, "randoms");
_gHorizontalBlurSceneSampler = glGetUniformLocationARB(_gHorizontalBlurShader, "scene");
_gHorizontalBlurSceneSamplerDepth = glGetUniformLocationARB(_gHorizontalBlurShader, "depths");
_gHorizontalBlurSceneSamplerNormal = glGetUniformLocationARB(_gHorizontalBlurShader, "normals");
_gVerticalBlurSceneSampler = glGetUniformLocationARB(_gVerticalBlurShader, "scene");
_gVerticalBlurSceneDepthSampler = glGetUniformLocationARB(_gVerticalBlurShader, "depths");
_gVerticalBlurSceneNormalSampler = glGetUniformLocationARB(_gVerticalBlurShader, "normals");
// Create frame buffer objects.
if(_gSceneFbo.Create(WIDTH, HEIGHT) == false)
return false;
// Create frame buffer objects.
if(_gSsaoFbo.Create(WIDTH, HEIGHT) == false)
return false;
// Create frame buffer objects.
if(_gHorizontalBlurFbo.Create(WIDTH, HEIGHT) == false)
return false;
if(_gVerticalBlurFbo.Create(WIDTH, HEIGHT) == false)
return false;
if(_gModel.LoadOBJ("/home/aashish/tools/mywork/src.git/data/sponza.obj") == false)
//.........这里部分代码省略.........