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


C++ UVGen类代码示例

本文整理汇总了C++中UVGen的典型用法代码示例。如果您正苦于以下问题:C++ UVGen类的具体用法?C++ UVGen怎么用?C++ UVGen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ReplaceReference

void Gradient::Init() 
	{
	if (uvGen) uvGen->Reset();
	else ReplaceReference( UVGEN_REF, GetNewDefaultUVGen());	
	if (texout) texout->Reset();
	else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput());
	ivalid.SetEmpty();
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:8,代码来源:gradient.cpp

示例2: ReplaceReference

//From MtlBase
void SampleShaderPlugin::Reset() 
{
	if (uvGen) uvGen->Reset();
	else ReplaceReference( 0, GetNewDefaultUVGen());	
	//TODO: Reset texmap back to its default values
	
	ivalid.SetEmpty();
	
}
开发者ID:2asoft,项目名称:xray,代码行数:10,代码来源:SampleShaderPlugin.cpp

示例3: ReplaceReference

//From MtlBase
void CrackVisualizer::Reset() 
{
	if (uvGen) uvGen->Reset();
	else ReplaceReference( 0, GetNewDefaultUVGen());	
	//TODO: Reset texmap back to its default values

	ivalid.SetEmpty();

}
开发者ID:skydave,项目名称:thesis,代码行数:10,代码来源:CrackVisualizer.cpp

示例4: CreateParamDlg

ParamDlg* SampleShaderPlugin::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) 
{
	IAutoMParamDlg* masterDlg = SampleShaderPluginDesc.CreateParamDlgs(hwMtlEdit, imp, this);
	uvGenDlg = uvGen->CreateParamDlg(hwMtlEdit, imp);
	masterDlg->AddDlg(uvGenDlg);
	//TODO: Set the user dialog proc of the param block, and do other initialization	
	return masterDlg;	
}
开发者ID:2asoft,项目名称:xray,代码行数:8,代码来源:SampleShaderPlugin.cpp

示例5: EvalNormalPerturb

Point3 Gradient::EvalNormalPerturb(ShadeContext& sc) 
	{
	Point3 dPdu, dPdv;
	if (!sc.doMaps) return Point3(0,0,0);
	if (gbufID) sc.SetGBufferID(gbufID);
	Point2 dM = uvGen->EvalDeriv(sc,&mysamp);
	uvGen->GetBumpDP(sc,dPdu,dPdv);

#if 0
	// Blinn's algorithm
	Point3 N = sc.Normal();
	Point3 uVec = CrossProd(N,dPdv);
	Point3 vVec = CrossProd(N,dPdu);
	Point3 np = -dM.x*uVec+dM.y*vVec;
#else 
	// Lazy algorithm
	Point3 np = dM.x*dPdu+dM.y*dPdv;
//	return texout->Filter(dM.x*dPdu+dM.y*dPdv);
#endif
	Texmap* sub[3];
	for (int i=0; i<3; i++) 
		sub[i] = mapOn[i]?subTex[i]:NULL;
	if (sub[0]||sub[1]||sub[2]) {
		// d((1-k)*a + k*b ) = dk*(b-a) + k*(db-da) + da
		float a,b,k;
		Point3 da,db;
		Point2 UV, dUV;
		uvGen->GetUV(sc, UV,dUV);
		k = gradFunc(UV.x,UV.y);
		if (k<=center) {	
			k = k/center; 		
			EVALSUBPERTURB(a,da,2);
			EVALSUBPERTURB(b,db,1);
			} 
		else {
			k = (k-center)/(1.0f-center);		
			EVALSUBPERTURB(a,da,1);
			EVALSUBPERTURB(b,db,0);
			}
		np = (b-a)*np + k*(db-da) + da;
		}
	return texout->Filter(np);
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:43,代码来源:gradient.cpp

示例6: EvalMono

float Gradient::EvalMono(ShadeContext& sc) {
	if (!sc.doMaps) 
		return 0.0f;
	float f;
	if (sc.GetCache(this,f)) 
		return f; 
	if (gbufID) sc.SetGBufferID(gbufID);
	f = texout->Filter(uvGen->EvalUVMapMono(sc,&mysamp));
	sc.PutCache(this,f); 
	return f;
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:11,代码来源:gradient.cpp

示例7: EvalColor

AColor Gradient::EvalColor(ShadeContext& sc) {
	if (!sc.doMaps) 
		return black;
	AColor c;
	if (sc.GetCache(this,c)) 
		return c; 
	if (gbufID) sc.SetGBufferID(gbufID);
	c = texout->Filter(uvGen->EvalUVMap(sc,&mysamp));
	sc.PutCache(this,c); 
	return c;
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:11,代码来源:gradient.cpp

示例8: GetVPDisplayDIB

BITMAPINFO* Gradient::GetVPDisplayDIB(TimeValue t, TexHandleMaker& thmaker, Interval &valid, BOOL mono, BOOL forceW, BOOL forceH) {
	Bitmap* bm = NULL;
	Interval v;
	Update(t,v);
	bm = BuildBitmap(thmaker.Size());
	BITMAPINFO *bmi = thmaker.BitmapToDIB(bm,uvGen->SymFlags(),0,forceW,forceH);
	bm->DeleteThis();
	valid.SetInfinite();
	Color ac;
	pblock->GetValue( grad_color1, t, ac, valid );
	pblock->GetValue( grad_color2, t, ac, valid );
	pblock->GetValue( grad_color3, t, ac, valid );
	return bmi;
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:14,代码来源:gradient.cpp

示例9: Update

void Gradient::Update(TimeValue t, Interval& valid) 
	{
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		uvGen->Update(t,ivalid);
		texout->Update(t,ivalid);
		pblock->GetValue( grad_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( grad_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( grad_color3, t, col[2], ivalid );
		col[2].ClampMinMax();		
		pblock->GetValue( grad_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( grad_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( grad_map3_on, t, mapOn[2], ivalid);
		pblock->GetValue( grad_type, t, type, ivalid );
		pblock->GetValue( grad_noise_type, t, noiseType, ivalid );
		pblock->GetValue( grad_amount, t, amount, ivalid );
		pblock->GetValue( grad_size, t, size, ivalid );
		pblock->GetValue( grad_phase, t, phase, ivalid );
		pblock->GetValue( grad_center, t, center, ivalid );
		pblock->GetValue( grad_levels, t, levels, ivalid );
		pblock->GetValue( grad_high_thresh, t, high, ivalid );
		pblock->GetValue( grad_low_thresh, t, low, ivalid );
		pblock->GetValue( grad_thresh_smooth, t, smooth, ivalid );		
		if (low>high) {
			float temp = low;
			low = high;
			high = temp;
			}
		hminusl = (high-low);
		sd = hminusl*0.5f*smooth;
		if (size!=0.0f) size1 = 20.0f/size;
		else size1 = 0.0f;
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}
		EnableStuff();
		}
	valid &= ivalid;
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:42,代码来源:gradient.cpp

示例10: CreateParamDlg

ParamDlg* Gradient::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) 
{
// JBW: the main difference here is the automatic creation of a ParamDlg by the new
// ClassDesc2 function CreateParamDlgs().  This mirrors the way BeginEditParams()
// can be redirected to the ClassDesc2 for automatic ParamMap2 management.  In this 
// case a special subclass of ParamDlg, AutoMParamDlg, defined in IParamm2.h, is 
// created.  It can act as a 'master' ParamDlg to which you can add any number of 
// secondary dialogs and it will make sure all the secondary dialogs are kept 
// up-to-date and deleted as necessary.  
// Here you see we create the Coordinate, Gradient and Output ParamDlgs in the desired 
// order, and then add the Coordinate and Output dlgs as secondaries to the 
// Gradient master AutoMParamDlg so it will keep them up-to-date automatically

	// create the rollout dialogs
	uvGenDlg = uvGen->CreateParamDlg(hwMtlEdit, imp);	
	IAutoMParamDlg* masterDlg = gradCD.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	// add the secondary dialogs to the master
	masterDlg->AddDlg(uvGenDlg);
	masterDlg->AddDlg(texoutDlg);
	EnableStuff();
	return masterDlg;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:23,代码来源:gradient.cpp

示例11: LocalRequirements

ULONG SampleShaderPlugin::LocalRequirements(int subMtlNum)
{
	//TODO: Specify various requirements for the material
	return uvGen->Requirements(subMtlNum); 
}
开发者ID:2asoft,项目名称:xray,代码行数:5,代码来源:SampleShaderPlugin.cpp

示例12: GetMapChannel

		int GetMapChannel () { return uvGen->GetMapChannel (); }
开发者ID:artemeliy,项目名称:inf4715,代码行数:1,代码来源:gradient.cpp

示例13: LocalRequirements

		// Requirements
		ULONG LocalRequirements(int subMtlNum) {
			return uvGen->Requirements(subMtlNum); 
			}
开发者ID:artemeliy,项目名称:inf4715,代码行数:4,代码来源:gradient.cpp

示例14: GetUVWSource

    int GetUVWSource() 
	{ 
		return uvGen->GetUVWSource(); 
	}
开发者ID:2asoft,项目名称:xray,代码行数:4,代码来源:SampleShaderPlugin.cpp

示例15: GetTextureTiling

    // TODO: Return the tiling state of the texture for use in the viewports
    int GetTextureTiling() 
	{ 
		return  uvGen->GetTextureTiling(); 
	}
开发者ID:2asoft,项目名称:xray,代码行数:5,代码来源:SampleShaderPlugin.cpp


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