示例#1
0
void Mask::Update(TimeValue t, Interval& valid) {		

	if (Param1)
		{
		pblock->SetValue( mask_map1_on, 0, mapOn[0]);
		pblock->SetValue( mask_map2_on, 0, mapOn[1]);
		pblock->SetValue( mask_invert, 0, invertMask);
		Param1 = FALSE;
		}

	if (!ivalid.InInterval(t)) {

		ivalid.SetInfinite();

		pblock->GetValue( mask_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( mask_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( mask_invert, t, invertMask, ivalid);
		NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
		}
	if (!mapValid.InInterval(t))
	{
		mapValid.SetInfinite();
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,mapValid);
		}
	}
	valid &= mapValid;
	valid &= ivalid;
	}
示例#2
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Speckle::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(speckle_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(speckle_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(speckle_size, t, size, texValidity);
		pblock->GetValue(speckle_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(speckle_mapon2, t, mapOn[1], texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE); 
		NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
	}
	if (!mapValid.InInterval(t))
	{
		mapValid.SetInfinite();
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, mapValid);
		}
	}
	ivalid &= texValidity;
	ivalid &= mapValid;
}
示例#3
0
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Splat::Update(TimeValue t, Interval& ivalid) {
    if (!texValidity.InInterval(t)) {
        texValidity.SetInfinite();
        xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
        pblock->GetValue(splat_color1, t, col[0], texValidity);
        col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
        pblock->GetValue(splat_color2, t, col[1], texValidity);
        col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
        pblock->GetValue(splat_size, t, size, texValidity);
        ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_THRESH, t, thresh, texValidity);
        pblock->GetValue(splat_threshold, t, thresh, texValidity);
        ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
//		pblock->GetValue(PB_ITER, t, iter, texValidity);
        pblock->GetValue(splat_iteration, t, iter, texValidity);
        pblock->GetValue(splat_mapon1, t, mapOn[0], texValidity);
        pblock->GetValue(splat_mapon2, t, mapOn[1], texValidity);
        ClampInt(iter, (int) MIN_ITER, (int) MAX_ITER);
        for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
            if (subTex[i])
                subTex[i]->Update(t, texValidity);
        }
    }
    ivalid &= texValidity;
}
示例#4
0
文件: planet.cpp 项目: 2asoft/xray
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Planet::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
		for (int i = 0; i < NUM_COLORS; i++) {
//			pblock->GetValue(i+PB_COL1, t, col[i], texValidity);
			pblock->GetValue(i+planet_color1, t, col[i], texValidity);
			col[i].ClampMinMax();
			}

//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(planet_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_ISLAND, t, island, texValidity);
		pblock->GetValue(planet_island, t, island, texValidity);
		ClampFloat(island, MIN_ISLAND, MAX_ISLAND);
//		pblock->GetValue(PB_PERCENT, t, percent, texValidity);
		pblock->GetValue(planet_percent, t, percent, texValidity);
		ClampFloat(percent, MIN_PERCENT, MAX_PERCENT);
		land = percent/100.0f;
//		pblock->GetValue(PB_SEED, t, seed, texValidity);
		pblock->GetValue(planet_seed, t, seed, texValidity);
		ClampInt(seed, (int) MIN_SEED, (int) MAX_SEED);
		pblock->GetValue(planet_blend, t, blend, texValidity);
	}
	ivalid &= texValidity;
}
示例#5
0
Interval TapeHelpObject::ObjectValidity(TimeValue time) {
    Interval ivalid;
    ivalid.SetInfinite();
    GetLength(time, ivalid);
    UpdateUI(time);
    return ivalid;
}
示例#6
0
文件: stucco.cpp 项目: 2asoft/xray
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Stucco::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(stucco_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(stucco_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(stucco_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_THRESH, t, thresh, texValidity);
		pblock->GetValue(stucco_threshold, t, thresh, texValidity);
		ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
//		pblock->GetValue(PB_THICK, t, thick, texValidity);
		pblock->GetValue(stucco_thickness, t, thick, texValidity);
		pblock->GetValue(stucco_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(stucco_mapon2, t, mapOn[1], texValidity);
		ClampFloat(thick, MIN_THICK, MAX_THICK);
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, texValidity);
		}
	}
	ivalid &= texValidity;
}
示例#7
0
Interval
FogObject::ObjectValidity(TimeValue time)
{
    Interval ivalid;
    ivalid.SetInfinite();
    return ivalid;	
}
示例#8
0
文件: backgrnd.cpp 项目: 2asoft/xray
Interval
BackgroundObject::ObjectValidity(TimeValue time)
{
    Interval ivalid;
    ivalid.SetInfinite();
    return ivalid;	
}
示例#9
0
Interval plPassMtl::DisplacementValidity(TimeValue t)
{
    Interval iv;
    iv.SetInfinite();

    return iv;  
}
示例#10
0
文件: touch.cpp 项目: 2asoft/xray
Interval
TouchSensorObject::ObjectValidity(TimeValue time)
{
    Interval ivalid;
    ivalid.SetInfinite();
    return ivalid;	
}
示例#11
0
文件: shaderonb.cpp 项目: 2asoft/xray
void OrenNayarBlinnShader::Update(TimeValue t, Interval &valid) {
	Point3 p, p2;
	if( inUpdate )
		return;
	inUpdate = TRUE;
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

//		pblock->GetValue( onb_ambient, t, p, ivalid );
//		ambient = LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( onb_diffuse, t, p, ivalid );
		diffuse= LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( onb_ambient, t, p2, ivalid );
		if( lockAD && (p!=p2)){
			pblock->SetValue( onb_ambient, t, diffuse);
			ambient = diffuse;
		} else {
			pblock->GetValue( onb_ambient, t, p, ivalid );
			ambient = Bound(Color(p.x,p.y,p.z));
		}
		pblock->GetValue( onb_specular, t, p2, ivalid );
		if( lockDS && (p!=p2)){
			pblock->SetValue( onb_specular, t, diffuse);
			specular = diffuse;
		} else {
			pblock->GetValue( onb_specular, t, p, ivalid );
			specular = Bound(Color(p.x,p.y,p.z));
		}
//		pblock->GetValue( onb_specular, t, p, ivalid );
//		specular = LimitColor(Color(p.x,p.y,p.z));

		pblock->GetValue( onb_glossiness, t, glossiness, ivalid );
		LIMIT0_1(glossiness);
		pblock->GetValue( onb_specular_level, t, specularLevel, ivalid );
		LIMITMINMAX(specularLevel,0.0f,9.99f);
		pblock->GetValue( onb_soften, t, softThresh, ivalid); 
		LIMIT0_1(softThresh);

		pblock->GetValue( onb_self_illum_amnt, t, selfIllum, ivalid );
		LIMIT0_1(selfIllum);
		pblock->GetValue( onb_self_illum_color, t, p, ivalid );
		selfIllumClr = LimitColor(Color(p.x,p.y,p.z));

		pblock->GetValue( onb_diffuse_level, t, diffLevel, ivalid );
		LIMITMINMAX(diffLevel,0.0f, 4.00f);
		pblock->GetValue( onb_roughness, t, diffRough, ivalid );
		LIMIT0_1(diffRough);

		// also get the non-animatables in case changed from scripter or other pblock accessors
		pblock->GetValue(onb_ds_lock, t, lockDS, ivalid);
		pblock->GetValue(onb_ad_lock, t, lockAD, ivalid);
		pblock->GetValue(onb_ad_texlock, t, lockADTex, ivalid);
		pblock->GetValue(onb_use_self_illum_color, t, selfIllumClrOn, ivalid);

		curTime = t;
	}
	valid &= ivalid;
	inUpdate = FALSE;
}
示例#12
0
void StraussShader::Update(TimeValue t, Interval &valid) {
   Point3 p;
   if (!ivalid.InInterval(t)) {
      ivalid.SetInfinite();

      pblock->GetValue( st_diffuse, t, p, ivalid );
      diffuse= Bound(Color(p.x,p.y,p.z));
      pblock->GetValue( st_glossiness, t, glossiness, ivalid );
      glossiness = Bound(glossiness );
      pblock->GetValue( st_metalness, t, metalness, ivalid );
      metalness = Bound(metalness );
   }
   valid &= ivalid;
}
示例#13
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Smoke::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(smoke_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(smoke_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(smoke_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_EXP, t, power, texValidity);
		pblock->GetValue(smoke_exponent, t, power, texValidity);
		ClampFloat(power, MIN_EXP, MAX_EXP);
//		pblock->GetValue(PB_PHASE, t, phase, texValidity);
//		pblock->GetValue(PB_ITER, t, iter, texValidity);
		pblock->GetValue(smoke_phase, t, phase, texValidity);
		pblock->GetValue(smoke_iteration, t, iter, texValidity);
		ClampInt(iter, (int) MIN_ITER, (int) MAX_ITER);
		pblock->GetValue(smoke_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(smoke_mapon2, t, mapOn[1], texValidity);

		NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
	}
	if (!mapValid.InInterval(t))
	{
		mapValid.SetInfinite();
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, mapValid);
		}
	}
	ivalid &= texValidity;
	ivalid &= mapValid;
}
示例#14
0
文件: composit.cpp 项目: 2asoft/xray
void Composite::Update(TimeValue t, Interval& valid) 
	{
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();		
		int n = pblock->Count(comptex_ons);
		if (n!=mapOn.Count()) mapOn.SetCount(n);
		for (int i=0; i<subTex.Count(); i++) {
			pblock->GetValue(comptex_ons,0,mapOn[i],valid,i);
	
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}
		}
	valid &= ivalid;
	}
示例#15
0
void WardShader::Update(TimeValue t, Interval &valid) {
	Point3 p, p2;
	if( inUpdate )
		return;
	inUpdate = TRUE;
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

//		pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
//		ambient = LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( PB_DIFFUSE_CLR, t, p, ivalid );
		diffuse= LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( PB_AMBIENT_CLR, t, p2, ivalid );
		if( lockAD && (p!=p2)){
			pblock->SetValue( PB_AMBIENT_CLR, t, diffuse);
			ambient = diffuse;
		} else {
			pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
			ambient = Bound(Color(p.x,p.y,p.z));
		}
		pblock->GetValue( PB_SPECULAR_CLR, t, p2, ivalid );
		if( lockDS && (p!=p2)){
			pblock->SetValue( PB_SPECULAR_CLR, t, diffuse);
			specular = diffuse;
		} else {
			pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
			specular = Bound(Color(p.x,p.y,p.z));
		}

//		pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
//		specular = LimitColor(Color(p.x,p.y,p.z));

		pblock->GetValue( PB_GLOSSINESS_X, t, glossinessX, ivalid );
		LIMITMINMAX(glossinessX, 0.0001f, 1.0f );
		pblock->GetValue( PB_GLOSSINESS_Y, t, glossinessY, ivalid );
		LIMITMINMAX(glossinessY, 0.0001f, 1.0f );

		pblock->GetValue( PB_SPECULAR_LEV, t, specLevel, ivalid );
		LIMITMINMAX(specLevel,0.0f,4.00f);
		pblock->GetValue( PB_DIFFUSE_LEV, t, diffLevel, ivalid );
		LIMITMINMAX(diffLevel,0.0f,2.0f);
		curTime = t;
	}
	valid &= ivalid;
	inUpdate = FALSE;
}
示例#16
0
void Plate::Update(TimeValue t, Interval& valid) {		
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		pblock->GetValue( plate_blur, t, blur, ivalid );
		pblock->GetValue( plate_reframt, t, refrAmt, ivalid);
		pblock->GetValue( plate_thick, t, thick, ivalid);


		pblock->GetValue( plate_apply, t, applyBlur, ivalid );

		pblock->GetValue( plate_nthframe, t, nth, ivalid);
		pblock->GetValue( plate_useenviroment, t, useEnvMap, ivalid);
		pblock->GetValue( plate_frame, t, do_nth, ivalid);


		}
	valid &= ivalid;
	}
示例#17
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Water::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(water_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(water_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_NUM, t, count, texValidity);
		pblock->GetValue(water_num, t, count, texValidity);
		ClampInt(count, (int) MIN_NUM, (int) MAX_NUM);
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(water_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_LEN_MIN, t, minperiod, texValidity);
		pblock->GetValue(water_len_min, t, minperiod, texValidity);
		ClampFloat(minperiod, MIN_LEN_MIN, MAX_LEN_MIN);	// > 6/11/02 - 2:42pm --MQM-- typo, was MIN_LEN_MIN, MAX_LEN_MAX
//		pblock->GetValue(PB_LEN_MAX, t, maxperiod, texValidity);
		pblock->GetValue(water_len_max, t, maxperiod, texValidity);
		ClampFloat(maxperiod, MIN_LEN_MAX, MAX_LEN_MAX);
//		pblock->GetValue(PB_AMP, t, amp, texValidity);
		pblock->GetValue(water_amp, t, amp, texValidity);
		ClampFloat(amp, MIN_AMP, MAX_AMP);
//		pblock->GetValue(PB_PHASE, t, phase, texValidity);
//		pblock->GetValue(PB_TYPE, t, type, texValidity);
		pblock->GetValue(water_phase, t, phase, texValidity);
		pblock->GetValue(water_type, t, type, texValidity);
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, texValidity);
//		pblock->GetValue(PB_SEED, t, randSeed, texValidity);
		pblock->GetValue(water_seed, t, randSeed, texValidity);

		pblock->GetValue(water_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(water_mapon2, t, mapOn[1], texValidity);

		ReInit();
		}
	}
	ivalid &= texValidity;
}
示例#18
0
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;
	}
示例#19
0
文件: output.cpp 项目: 2asoft/xray
void Output::Update(TimeValue t, Interval& valid) {		

	if (Param1)
		{
		pblock->SetValue( output_map1_on, 0, mapOn[0]);
		Param1 = FALSE;
		}

	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		texout->Update(t,ivalid);
		pblock->GetValue( output_map1_on, t, mapOn[0], ivalid);

		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}
		}
	valid &= ivalid;
	}
示例#20
0
void Noise::Update(TimeValue t, Interval& valid) {

	if (pblock == NULL) return;

	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		if (xyzGen != NULL)
			xyzGen->Update(t,ivalid);
		if (texout != NULL)
			texout->Update(t,ivalid);
		pblock->GetValue( noise_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( noise_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( noise_size, t,   size, ivalid );
		pblock->GetValue( noise_phase, t,  phase, ivalid );
		pblock->GetValue( noise_levels, t,  levels, ivalid );
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}		
		pblock->GetValue( noise_hithresh, t, high, ivalid );
		pblock->GetValue( noise_lowthresh, t, low, ivalid );		

		if (high<low) {
			float tmp = low;
			low = high;
			high = tmp;
			}
		pblock->GetValue( noise_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( noise_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( noise_type, t, noiseType, ivalid);


		//ComputeAvgValue(); // moved to UpdateCache DDS 10/3/00
		EnableStuff();
		}
	valid &= ivalid;
	}
示例#21
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Speckle::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(speckle_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(speckle_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(speckle_size, t, size, texValidity);
		pblock->GetValue(speckle_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(speckle_mapon2, t, mapOn[1], texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE); 
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, texValidity);
		}
	}
	ivalid &= texValidity;
}
示例#22
0
Interval CompositeMat::DisplacementValidity(TimeValue t) {
	Interval iv;
	iv.SetInfinite();
	Mtl *sm1 = NULL;

	for (int i = 0; i < MAX_NUM_MTLS; i++)
		{
		BOOL enabled;
		if (i==0) enabled = 1;
		else pblock2->GetValue(compmat_map_on,t,enabled,iv,i-1);

		if (enabled)
			{
			pblock2->GetValue(compmat_mtls,t,sm1,iv,i);
			if (sm1 != NULL) 
				{
				iv &= sm1->DisplacementValidity(t);		

				}
			}
		}

/*
	Mtl *sm1 = mapOn[0]?sub1:NULL;
	Mtl *sm2 = mapOn[1]?sub2:NULL;
	Texmap *mp = mapOn[2]?map:NULL;
	if (sm1) 	
		iv &= sm1->DisplacementValidity(t);		
	if (sm2) 	
		iv &= sm2->DisplacementValidity(t);		
	if (mp) { 	
		Interval ivm;
		ivm.SetInfinite();
		mp->Update(t,ivm);
		iv &= ivm;
		}
*/
	return iv;	
	} 
示例#23
0
Interval TriObject::ObjectValidity(TimeValue t){
	Interval iv;
	iv.SetInfinite();
	iv &= geomValid;
	iv &= vcolorValid;
	iv &= topoValid;
	iv &= texmapValid;
	iv &= selectValid;
	iv &= gfxdataValid;
	iv &= Object::ObjectValidity(t);
	
	if (!(validBits&chMask[SUBSEL_TYPE_CHAN_NUM])) iv.SetEmpty();
	if (!(validBits&chMask[DISP_ATTRIB_CHAN_NUM])) iv.SetEmpty();
	/*
	  // NS 3/27/00 Don't include the XTC, since we've taken care of it already (NUM_OBJ_CHANS-1)
	  for (int i=BITVALIDITY_START; i<NUM_OBJ_CHANS-1; i++)
		if (!(validBits&chMask[i])) {
			iv.SetEmpty();
			break;
			}
	*/
	return iv;
	}
示例#24
0
DWORD UVtex::GetActiveTexHandle(TimeValue t, TexHandleMaker& thmaker) {
#endif
	if (texHandle) {
		if (texHandleValid.InInterval(t))
			return texHandle->GetHandle();
		else DiscardTexHandle();
	}

	Interval v;
	Update(t,v);

	Bitmap *bm;
	bm = BuildBitmap(thmaker.Size());
	texHandle = thmaker.CreateHandle(bm);
	bm->DeleteThis();

	texHandleValid.SetInfinite();
	int i;
	pblock->GetValue(uv_uvchannel, t, i, texHandleValid);
	pblock->GetValue(uv_rtype, t, i, texHandleValid);
	pblock->GetValue(uv_gtype, t, i, texHandleValid);
	pblock->GetValue(uv_btype, t, i, texHandleValid);
	pblock->GetValue(uv_rcount, t, i, texHandleValid);
	pblock->GetValue(uv_gcount, t, i, texHandleValid);
	pblock->GetValue(uv_bcount, t, i, texHandleValid);
	float f;
	pblock->GetValue(uv_tintAmount, t, f, texHandleValid);
	pblock->GetValue(uv_rAmount, t, f, texHandleValid);
	pblock->GetValue(uv_gAmount, t, f, texHandleValid);
	pblock->GetValue(uv_bAmount, t, f, texHandleValid);
	Color c;
	pblock->GetValue(uv_tintColor, t, c, texHandleValid);
	BOOL b;
	pblock->GetValue(uv_clampUVW, t, b, texHandleValid);
	return texHandle->GetHandle();
}
Interval HLSLShaderMaterial::DisplacementValidity(TimeValue t)
{
	Interval iv; iv.SetInfinite();
	return iv;	
}
示例#26
0
文件: composit.cpp 项目: 2asoft/xray
void Composite::SetupGfxMultiMaps(TimeValue t, Material *mtl, MtlMakerCallback &cb)
{
	Interval valid;
	Texmap *sub[MAXTEXHANDLES];
	int texOp;

	IHardwareMaterial *pIHWMat = (IHardwareMaterial *)GetProperty(PROPID_HARDWARE_MATERIAL);
	if (pIHWMat) {
		// This is only true if Direct3D is in use
		if (texHandleValid.InInterval(t)) {
			pIHWMat->SetNumTexStages(numTexHandlesUsed);
			int nt = numTexHandlesUsed;
			if (numTexHandlesUsed == 1) {
				texOp = TX_MODULATE;
			}
			else {
				texOp = TX_ALPHABLEND;
			}
			for (int i = 0; i < nt; i++) {
				if (texHandle[i]) {
					pIHWMat->SetTexture(i, texHandle[i]->GetHandle());
					// Kludge to pass in the TextureStage number
					mtl->texture[0].useTex = i;
					cb.GetGfxTexInfoFromTexmap(t, mtl->texture[0], subTex[useSubForTex[i]]); 		
					SetHWTexOps(pIHWMat, i, texOp);
				}
			}
			return;
		}
		else {
			DiscardTexHandles();
		}

		int forceW = 0;
		int forceH = 0;

		int nsupport = cb.NumberTexturesSupported();

		nsupport = (nsupport > MAXTEXHANDLES) ? MAXTEXHANDLES : nsupport;

		numTexHandlesUsed = 0;

		for (int i = 0; i < MAXTEXHANDLES; i++) {
			texHandle[i] = NULL;
			sub[i] = NULL;
		}

		int nmaps = 0;
		for (i = 0; i < subTex.Count(); i++) {
			if (mapOn[i]) {
				if (subTex[i]) {
					sub[nmaps] = subTex[i];
					useSubForTex[nmaps] = i;
					if (++nmaps >= nsupport) {
						break;
					}
				}
			}
		}

		pIHWMat->SetNumTexStages(nmaps);
		for (i = 0; i < nmaps; i++) {
			pIHWMat->SetTexture(i, (DWORD_PTR)NULL);
		}

		numTexHandlesUsed  = nmaps;

		texHandleValid.SetInfinite();
		
		if (numTexHandlesUsed == 1) {
			texOp = TX_MODULATE;
		}
		else {
			texOp = TX_ALPHABLEND;
		}
		for (i = 0; i < numTexHandlesUsed; i++) {
			// Kludge to pass in the TextureStage number
			mtl->texture[0].useTex = i;
			cb.GetGfxTexInfoFromTexmap(t, mtl->texture[0], sub[i]);
			BITMAPINFO *bmi = sub[i]->GetVPDisplayDIB(t, cb, valid, FALSE, 0, 0);
			texHandle[i] = cb.MakeHandle(bmi);
			pIHWMat->SetTexture(i, texHandle[i]->GetHandle());
			SetHWTexOps(pIHWMat, i, texOp);
		}
	}
	else {
		if (texHandleValid.InInterval(t)) {
			mtl->texture.SetCount(numTexHandlesUsed);
			int nt = numTexHandlesUsed;
			for (int i=0; i<nt; i++) {
				if (texHandle[i]) {
					mtl->texture[i].textHandle = texHandle[i]->GetHandle();
					cb.GetGfxTexInfoFromTexmap(t, mtl->texture[i], subTex[useSubForTex[i]] ); 		
					SetTexOps(&mtl->texture[i],numTexHandlesUsed==1?TX_MODULATE:TX_ALPHABLEND);
				}
			}
			return;
		}
		else {
			DiscardTexHandles();
		}

		int forceW = 0;
		int forceH = 0;

		int nsupport = cb.NumberTexturesSupported();

		nsupport = (nsupport > MAXTEXHANDLES) ? MAXTEXHANDLES : nsupport;

		numTexHandlesUsed = 0;

		for (int i=0; i<MAXTEXHANDLES; i++) {
			texHandle[i] = NULL;
			sub[i]=NULL;
			}

		
		int nmaps = 0;
		for (i=0; i<subTex.Count(); i++) {
			if (mapOn[i]) {
				if (subTex[i]) {
					sub[nmaps] = subTex[i];
					useSubForTex[nmaps] = i;
					if (++nmaps>=nsupport)
						break;
					}
				}
			}

		mtl->texture.SetCount(nmaps);
		for (i=0; i<nmaps; i++) {
			mtl->texture[i].textHandle = NULL;
			}

		numTexHandlesUsed  = nmaps;

		texHandleValid.SetInfinite();
		
		for (i=0; i<nmaps; i++) {
			cb.GetGfxTexInfoFromTexmap(t, mtl->texture[i], sub[i] ); 		
			BITMAPINFO *bmi = sub[i]->GetVPDisplayDIB(t,cb,valid,FALSE,0,0); 
			texHandle[i] = cb.MakeHandle(bmi); 
			mtl->texture[i].textHandle = texHandle[i]->GetHandle();
			SetTexOps(&mtl->texture[i],nmaps==1?TX_MODULATE:TX_ALPHABLEND);
			}
		mtl->texture.SetCount(nmaps);
	}
}
示例#27
0
void CellTex::Update(TimeValue t, Interval& valid)
	{
	EnterCriticalSection(&csect);
	if (!ivalid.InInterval(t)) {
		ivalid = FOREVER;		
		xyzGen->Update(t,ivalid);
		texout->Update(t,ivalid);
/*	
		pblock->GetValue(PB_CELLCOL,t,cellCol,ivalid);
		pblock->GetValue(PB_DIVCOL1,t,divCol1,ivalid);
		pblock->GetValue(PB_DIVCOL2,t,divCol2,ivalid);
		pblock->GetValue(PB_VAR,t,var,ivalid);
		pblock->GetValue(PB_SIZE,t,size,ivalid);
		pblock->GetValue(PB_SPREAD,t,spread,ivalid);
		pblock->GetValue(PB_LOW,t,low,ivalid);
		pblock->GetValue(PB_MID,t,mid,ivalid);
		pblock->GetValue(PB_HIGH,t,high,ivalid);		
		pblock->GetValue(PB_TYPE,t,type,ivalid);
		pblock->GetValue(PB_FRACT,t,fract,ivalid);
		pblock->GetValue(PB_ITER,t,iterations,ivalid);		
		pblock->GetValue(PB_USECELLMAP,t,useCellMap,ivalid);
		pblock->GetValue(PB_USEDIV1MAP,t,useDiv1Map,ivalid);
		pblock->GetValue(PB_USEDIV2MAP,t,useDiv2Map,ivalid);		
		pblock->GetValue(PB_ROUGH,t,rough,ivalid);
		pblock->GetValue(PB_SMOOTH,t,smooth,ivalid);
		pblock->GetValue(PB_ADAPT,t,adapt,ivalid);
*/		

		pblock->GetValue(cellular_celcolor,t,cellCol,ivalid);
		pblock->GetValue(cellular_divcol1,t,divCol1,ivalid);
		pblock->GetValue(cellular_divcol2,t,divCol2,ivalid);
		pblock->GetValue(cellular_variation,t,var,ivalid);
		pblock->GetValue(cellular_size,t,size,ivalid);
		pblock->GetValue(cellular_spread,t,spread,ivalid);
		pblock->GetValue(cellular_lowthresh,t,low,ivalid);
		pblock->GetValue(cellular_midthresh,t,mid,ivalid);
		pblock->GetValue(cellular_highthresh,t,high,ivalid);		
		pblock->GetValue(cellular_type,t,type,ivalid);
		pblock->GetValue(cellular_fractal,t,fract,ivalid);
		pblock->GetValue(cellular_iteration,t,iterations,ivalid);		
		pblock->GetValue(cellular_map1_on,t,useCellMap,ivalid);
		pblock->GetValue(cellular_map2_on,t,useDiv1Map,ivalid);
		pblock->GetValue(cellular_map3_on,t,useDiv2Map,ivalid);		
		pblock->GetValue(cellular_rough,t,rough,ivalid);
		pblock->GetValue(cellular_smooth,t,smooth,ivalid);
		pblock->GetValue(cellular_adaptive,t,adapt,ivalid);
		
		
		smooth *= 0.7f;
		rough = 2.0f-rough;

		highMinuslow = high-low;		
		midMinuslow = mid - low;
		highMinusmid = high - mid;		
		if (type) {
			spread = spread/2.0f;
			}		
		var /= 50.0f;
		varOff = 1.0f-var * 0.5f;	

		
		NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
		}
	if (!mapValid.InInterval(t))
	{
		mapValid.SetInfinite();
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,mapValid);
		}
	}
	valid &= mapValid;
	valid &= ivalid;
	LeaveCriticalSection(&csect);
	}