コード例 #1
0
ファイル: render_dx9.cpp プロジェクト: chenbk85/3dlearn
bool InitResourceDX9(void)
{
	g_orient_matrix.Identity();

	LPDIRECT3DDEVICE9 device = GutGetGraphicsDeviceDX9();

	if ( !ReInitResourceDX9() )
		return false;

	g_pPostEffect = GutLoadFXShaderDX9("../../shaders/Posteffect.fx");
	if ( NULL==g_pPostEffect )
		return false;

	g_pWaterEffect = GutLoadFXShaderDX9("../../shaders/Watereffect.fx");
	if ( NULL==g_pWaterEffect )
		return false;

	g_pWaterTexture = GutLoadTexture_DX9("../../textures/lena.tga");
	if ( NULL==g_pWaterTexture )
		return false;

	g_Model_DX9.ConvertToDX9Model(&g_Model);

	return true;
}
コード例 #2
0
ファイル: render_dx9.cpp プロジェクト: as2120/ZNginx
bool InitResourceDX9(void)
{
	LPDIRECT3DDEVICE9 device = GutGetGraphicsDeviceDX9();

	D3DCAPS9 caps;
	device->GetDeviceCaps(&caps);

	if ( caps.PixelShaderVersion < D3DPS_VERSION(3,0) )
	{
		printf("Requires Pixel Shader 3.0\n");
		return false;
	}

	for ( int i=0; i<TEX_TEXTURES; i++ )
	{
		g_pTextures[i] = NULL;
		g_pSurfaces[i] = NULL;
	}

	if ( !ReInitResourceDX9() )
		return false;

	g_pParticleFX = GutLoadFXShaderDX9("../../shaders/GPUParticle.fx");
	if ( NULL==g_pParticleFX )
		return false;

	g_pParticleRenderFX = GutLoadFXShaderDX9("../../shaders/GPUParticle_render.fx");
	if ( NULL==g_pParticleRenderFX )
		return false;

	g_pPostFX = GutLoadFXShaderDX9("../../shaders/Posteffect.fx");
	if ( NULL==g_pPostFX )
		return false;

	g_pNoiseTexture = GutLoadTexture_DX9("../../textures/noise_512x512.tga");
	if ( NULL==g_pNoiseTexture )
		return false;

	g_pParticleTexture = GutLoadTexture_DX9("../../textures/particle.tga");
	if ( NULL==g_pParticleTexture )
		return false;

	return true;
}
コード例 #3
0
ファイル: render_dx9.cpp プロジェクト: chenbk85/3dlearn
bool InitResourceDX9(void)
{
	LPDIRECT3DDEVICE9 device = GutGetGraphicsDeviceDX9();

	CGutModel::SetTexturePath("../../textures/");

	g_pTexture = GutLoadTexture_DX9("../../textures/lena.tga", &g_ImageInfo);

	g_pEffect = GutLoadFXShaderDX9("../../shaders/Posteffect.fx");
	if ( NULL==g_pEffect )
		return false;

	g_pRefractionFX = GutLoadFXShaderDX9("../../shaders/Refraction.fx");
	if ( NULL==g_pRefractionFX )
		return false;

	g_Model_DX9.ConvertToDX9Model(&g_Model);

	if ( !ReInitResourceDX9() )
		return false;

	return true;
}
コード例 #4
0
ファイル: render_dx9.cpp プロジェクト: as2120/ZNginx
bool InitResourceDX9(void)
{
	LPDIRECT3DDEVICE9 device = GutGetGraphicsDeviceDX9();

	for ( int i=0; i<NUM_FRAMEBUFFERS; i++ )
	{
		g_pFrameBuffer[i] = NULL;
		g_pFrameSurface[i] = NULL;
	}

	CGutModel::SetTexturePath("../../textures/");

	if ( !g_Model_DX9.ConvertToDX9Model(&g_Model) )
		return false;

	g_pEffect = GutLoadFXShaderDX9("../../shaders/Posteffect.fx");
	if ( NULL==g_pEffect )
		return false;

	g_pAddImageShader = g_pEffect->GetTechniqueByName("DrawImage");
	g_pBlurShader = g_pEffect->GetTechniqueByName("BlurImage");
	g_pBrightnessShader = g_pEffect->GetTechniqueByName("Brightness");

	if ( NULL==g_pAddImageShader || NULL==g_pBlurShader || 
		 NULL==g_pBrightnessShader )
		return false;

	g_pExposureEffect = GutLoadFXShaderDX9("../../shaders/Exposure.fx");
	if ( NULL==g_pExposureEffect )
		return false;

	if ( !ReInitResourceDX9() )
		return false;

	return true;
}