Beispiel #1
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 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;
}
Beispiel #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;
}
Beispiel #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 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;
}
Beispiel #4
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;
}
Beispiel #5
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;
}
Beispiel #6
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;
}
Beispiel #7
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;
	}
Beispiel #8
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;
}
Beispiel #9
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;	

		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}		
		}
	valid &= ivalid;
	LeaveCriticalSection(&csect);
	}