当前位置: 首页>>代码示例>>C++>>正文


C++ SkyBox::loadSkyBox方法代码示例

本文整理汇总了C++中SkyBox::loadSkyBox方法的典型用法代码示例。如果您正苦于以下问题:C++ SkyBox::loadSkyBox方法的具体用法?C++ SkyBox::loadSkyBox怎么用?C++ SkyBox::loadSkyBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SkyBox的用法示例。


在下文中一共展示了SkyBox::loadSkyBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: engine_init_display


//.........这里部分代码省略.........
	LOGI("PositionAttributes: %i",PositionAttributes);
	LOGI("NormalAttributes: %i",NormalAttributes);
	LOGI("TexCoordAttributes: %i",TexCoordAttributes);

	LOGI("MVPMatrixUniform: %i",MVPMatrixUniform);
	LOGI("EyePosUniform: %i",EyePosUniform);
	LOGI("LightPosUniform: %i",LightPosUniform);

	LOGI("TextureSampler: %i",TextureSampler);
	LOGI("===END===");

    //////////////////
    // DEPTH SHADER //
    //////////////////

	if(!DepthShader.createShader((char*)"depthcolor.vs",(char*)"depthcolor.fs")) 
	{
		LOGE("Could not create depth shader program.");
		return false;
	}

	DepthShaderMVPMatrixUniform = 	glGetUniformLocation(DepthShader.ID, "MVPMatrixUniform");
	DepthShaderPositionAttributes = glGetAttribLocation(DepthShader.ID, "aPosition");

	LOGI("===DEPTH-DEBUG VALUES===");
	LOGI("DepthShaderPositionAttributes: %i",DepthShaderPositionAttributes);
	LOGI("DepthShaderMVPMatrixUniform: %i",DepthShaderMVPMatrixUniform);
	LOGI("===END===");
	/////////////////////////////////
	// TEXPASSTHRU (SKYBOX) SHADER //
	/////////////////////////////////

	if(!TexPassThruShader.createShader((char*)"texpassthru.vs",(char*)"texpassthru.fs")) 
	{
		LOGE("Could not create texpassthru program.");
		return false;
	}

	TexPassThruSampler = glGetUniformLocation(TexPassThruShader.ID,"sTexture");
	TexPassThruMVPMatrixUniform = glGetUniformLocation(TexPassThruShader.ID,"MVPMatrixUniform");

	TexPassThruPositionAttributes = glGetAttribLocation(TexPassThruShader.ID, "aPosition");
	TexPassThruTexCoordAttributes = glGetAttribLocation(TexPassThruShader.ID, "aTexCoords");

	LOGI("===TEXPASSTHRU-DEBUG VALUES===");
	LOGI("TexPassThruSampler: %i",TexPassThruSampler);
	LOGI("TexPassThruMVPMatrixUniform: %i",TexPassThruMVPMatrixUniform);
	LOGI("TexPassThruPositionAttributes: %i",TexPassThruPositionAttributes);
	LOGI("TexPassThruTexCoordAttributes: %i",TexPassThruTexCoordAttributes);
	LOGI("===END===");



    ////////////////////////
    // ENVIRONMENT SHADER //
    ////////////////////////

	if (!EnvironmentMappingShader.createShader((char*)"environmentcubemap.vs",(char*)"environmentcubemap.fs")) 
	{
		LOGE("Could not create program.");
		return false;
	}

	EnvironmentMappingShaderMVPMatrixUniform=glGetUniformLocation(EnvironmentMappingShader.ID,"MVPMatrixUniform");
	EnvironmentMappingShaderPositionAttributes=glGetAttribLocation(EnvironmentMappingShader.ID, "aPosition");
	EnvironmentMappingShaderNormalAttributes=glGetAttribLocation(EnvironmentMappingShader.ID, "aNormal");
	EnvironmentMappingShaderCubeSampler=glGetUniformLocation(EnvironmentMappingShader.ID,"sCubeTexture");

	LOGI("===ENVIRONMENT-DEBUG VALUES===");
	LOGI("EnvironmentMappingShaderCubeSampler: %i",EnvironmentMappingShaderCubeSampler);
	LOGI("EnvironmentMappingShaderMVPMatrixUniform: %i",EnvironmentMappingShaderMVPMatrixUniform);
	LOGI("EnvironmentMappingShaderPositionAttributes: %i",EnvironmentMappingShaderPositionAttributes);
	LOGI("TexPassThruTeEnvironmentMappingShaderNormalAttributesxCoordAttributes: %i",EnvironmentMappingShaderNormalAttributes);
	LOGI("===END===");

	//Matrices
	esMatrixLoadIdentity(&MVPMatrix);

	//viewport
	glViewport(0, 0, w, h);
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	checkGlError("glViewport");

	//load resources internally from the APK

	StatueMesh.loadMesh((char*)"athena.obj");
	checkGlError("loadMesh");

	if(!StoneTexture.loadTexture((char*)"rockish.tga")) 
	{
		LOGE("texture loading FAILED");
	}

	CubeSkyBox.loadSkyBox();

	if(!EnvironmentCubeTexture.loadCubeTexture())
		LOGE("Could not load cube texture.");

    return 0;
}
开发者ID:jiayu1016,项目名称:nativeactivity-es2,代码行数:101,代码来源:main.cpp


注:本文中的SkyBox::loadSkyBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。