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


C++ CBlender_Compile::R方法代码示例

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


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

示例1:

void CBlender_ShTex::Compile	(CBlender_Compile& C)
{
	IBlender::Compile		(C);
	C.PassBegin		();
	{
		C.PassSET_ZB		(FALSE, FALSE);
		C.PassSET_Blend_SET	();
		C.PassSET_LightFog	(FALSE, FALSE);

		// Stage0 - Base texture
		C.StageBegin		();
		C.StageSET_Color	(D3DTA_TFACTOR,	  D3DTOP_SELECTARG1,	D3DTA_TFACTOR);
		C.StageSET_Alpha	(D3DTA_TFACTOR,	  D3DTOP_SELECTARG1,	D3DTA_TFACTOR);
		C.Stage_Texture		("$null");
		C.Stage_Matrix		("$null",0);
		C.Stage_Constant	("$null");
		C.StageEnd			();

		// 
		C.R().SetRS			(D3DRS_TEXTUREFACTOR,0);
	}
	C.PassEnd			();
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:23,代码来源:Blender_Shadow_Texture.cpp

示例2: if

void	uber_deffer	(CBlender_Compile& C, bool hq, LPCSTR _vspec, LPCSTR _pspec, BOOL _aref, LPCSTR _detail_replace, bool DO_NOT_FINISH)
{
	// Uber-parse
	string256		fname,fnameA,fnameB;
	xr_strcpy			(fname,*C.L_textures[0]);	//. andy if (strext(fname)) *strext(fname)=0;
	fix_texture_name(fname);
	ref_texture		_t;		_t.create			(fname);
	bool			bump	= _t.bump_exist		();

	// detect lmap
	bool			lmap	= true;
	if	(C.L_textures.size()<3)	lmap = false;
	else 
	{
		pcstr		tex		= C.L_textures[2].c_str();
		if (tex[0]=='l' && tex[1]=='m' && tex[2]=='a' && tex[3]=='p')	lmap = true	;
		else															lmap = false;
	}


	string256		ps,vs,dt;
	strconcat		(sizeof(vs),vs,"deffer_", _vspec, lmap?"_lmh":""	);
	strconcat		(sizeof(ps),ps,"deffer_", _pspec, lmap?"_lmh":""	);
	xr_strcpy		(dt,sizeof(dt),_detail_replace?_detail_replace:( C.detail_texture?C.detail_texture:"" ) );

	// detect detail bump
	string256		texDetailBump = {'\0'};
	string256		texDetailBumpX = {'\0'};
	bool			bHasDetailBump = false;
	if (C.bDetail_Bump)
	{
		LPCSTR detail_bump_texture = DEV->m_textures_description.GetBumpName(dt).c_str();
		//	Detect and use detail bump
		if ( detail_bump_texture )
		{
			bHasDetailBump = true;
			xr_strcpy		( texDetailBump, sizeof(texDetailBump), detail_bump_texture);
			xr_strcpy		( texDetailBumpX, sizeof(texDetailBumpX), detail_bump_texture);
			xr_strcat			( texDetailBumpX, "#");
		}
	}

	if	(_aref)		
	{ 
		xr_strcat(ps,"_aref");	
	}

	if	(!bump)		
	{
		fnameA[0] = fnameB[0] = 0;
		xr_strcat			(vs,"_flat");
		xr_strcat			(ps,"_flat");
		if (hq && (C.bDetail_Diffuse || C.bDetail_Bump) )	
		{
			xr_strcat		(vs,"_d");
			xr_strcat		(ps,"_d");
		}
	} 
	else 
	{
		xr_strcpy			(fnameA,_t.bump_get().c_str());
		strconcat		(sizeof(fnameB),fnameB,fnameA,"#");
		xr_strcat			(vs,"_bump");
		if (hq && C.bUseSteepParallax)
		{
			xr_strcat			(ps,"_steep");
		}
		else
		{
			xr_strcat			(ps,"_bump");
		}
		if (hq && (C.bDetail_Diffuse || C.bDetail_Bump) )
		{
			xr_strcat		(vs,"_d"	);
			if (bHasDetailBump)
				xr_strcat		(ps,"_db"	);	//	bump & detail & hq
			else
				xr_strcat		(ps,"_d"	);
		}
	}

	// HQ
	if (bump && hq)
	{
		xr_strcat			(vs,"-hq");
		xr_strcat			(ps,"-hq");
	}

	// Uber-construct
#if defined(USE_DX10) || defined(USE_DX11)
#	ifdef USE_DX11
	if (bump && hq && RImplementation.o.dx11_enable_tessellation && C.TessMethod!=0)
	{
		char hs[256], ds[256];// = "DX11\\tess", ds[256] = "DX11\\tess";
		char params[256] = "(";
		
		if (C.TessMethod == CBlender_Compile::TESS_PN || C.TessMethod == CBlender_Compile::TESS_PN_HM)
		{
			RImplementation.addShaderOption("TESS_PN", "1");
			xr_strcat(params, "TESS_PN,");
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray-16,代码行数:101,代码来源:uber_deffer.cpp

示例3: uber_shadow

void uber_shadow(CBlender_Compile& C, LPCSTR _vspec)
{
	// Uber-parse
	string256		fname,fnameA,fnameB;
	xr_strcpy			(fname,*C.L_textures[0]);	//. andy if (strext(fname)) *strext(fname)=0;
	fix_texture_name(fname);
	ref_texture		_t;		_t.create			(fname);
	bool			bump	= _t.bump_exist		();

	// detect lmap
	bool			lmap	= true;
	if	(C.L_textures.size()<3)	lmap = false;
	else 
	{
		pcstr		tex		= C.L_textures[2].c_str();
		if (tex[0]=='l' && tex[1]=='m' && tex[2]=='a' && tex[3]=='p')	lmap = true	;
		else															lmap = false;
	}


	string256		vs,dt;
	xr_strcpy		(dt,sizeof(dt),C.detail_texture?C.detail_texture:"");

	// detect detail bump
	string256		texDetailBump = {'\0'};
	string256		texDetailBumpX = {'\0'};
	bool			bHasDetailBump = false;
	if (C.bDetail_Bump)
	{
		LPCSTR detail_bump_texture = DEV->m_textures_description.GetBumpName(dt).c_str();
		//	Detect and use detail bump
		if ( detail_bump_texture )
		{
			bHasDetailBump = true;
			xr_strcpy		( texDetailBump, sizeof(texDetailBump), detail_bump_texture);
			xr_strcpy		( texDetailBumpX, sizeof(texDetailBumpX), detail_bump_texture);
			xr_strcat			( texDetailBumpX, "#");
		}
	}


	if	(!bump)		
	{
		fnameA[0] = fnameB[0] = 0;
	} 
	else 
	{
		xr_strcpy			(fnameA,_t.bump_get().c_str());
		strconcat		(sizeof(fnameB),fnameB,fnameA,"#");
	}

	if (bump && RImplementation.o.dx11_enable_tessellation && C.TessMethod!=0)
	{
		char hs[256], ds[256];// = "DX11\\tess", ds[256] = "DX11\\tess";
		char params[256] = "(";
		
		if (C.TessMethod == CBlender_Compile::TESS_PN || C.TessMethod == CBlender_Compile::TESS_PN_HM)
		{
			RImplementation.addShaderOption("TESS_PN", "1");
			xr_strcat(params, "TESS_PN,");
		}

		if (C.TessMethod == CBlender_Compile::TESS_HM || C.TessMethod == CBlender_Compile::TESS_PN_HM)
		{
			RImplementation.addShaderOption("TESS_HM", "1");
			xr_strcat(params, "TESS_HM,");
		}

		if (lmap)
		{
			RImplementation.addShaderOption("USE_LM_HEMI", "1");
			xr_strcat(params, "USE_LM_HEMI,");
		}

		if (C.bDetail_Diffuse)
		{
			RImplementation.addShaderOption("USE_TDETAIL", "1");
			xr_strcat(params, "USE_TDETAIL,");
		}

		if (C.bDetail_Bump)
		{
			RImplementation.addShaderOption("USE_TDETAIL_BUMP", "1");
			xr_strcat(params, "USE_TDETAIL_BUMP,");
		}
		
		xr_strcat(params, ")");

		strconcat(sizeof(vs),vs,"deffer_", _vspec, "_bump", params);
		strconcat(sizeof(hs),hs,"DX11\\tess", params);
		strconcat(sizeof(ds),ds,"DX11\\tess_shadow", params);
	
		C.r_TessPass	(vs, hs, ds, "null", "dumb", FALSE,TRUE,TRUE,FALSE);
		RImplementation.clearAllShaderOptions();
		C.r_dx10Texture		("s_base",		C.L_textures[0]);
		C.r_dx10Texture		("s_bumpX",		fnameB);	// should be before base bump
		C.r_dx10Texture		("s_bump",		fnameA);
		if (bHasDetailBump)
		{
			C.r_dx10Texture	("s_detailBump",	texDetailBump);
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray-16,代码行数:101,代码来源:uber_deffer.cpp


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