Ejemplo n.º 1
0
// --- Methods inherited from Tex3D ---
void Speckle::ReadSXPData(const TCHAR *name, void *sxpdata) {
	SpeckleState *state = (SpeckleState*)sxpdata;
	if (state != NULL && (state->version == SPECKLE_SXP_VERSION)) {
		SetColor(0, ColorFromCol24(state->col1), TimeValue(0));
		SetColor(1, ColorFromCol24(state->col2), TimeValue(0));
		SetSize(state->size, TimeValue(0));
	}
}
Ejemplo n.º 2
0
// --- Methods inherited from Tex3D ---
void Splat::ReadSXPData(TCHAR *name, void *sxpdata) {
    SplatState *state = (SplatState*)sxpdata;
    if (state != NULL && (state->version == SPLAT_SXP_VERSION)) {
        SetColor(0, ColorFromCol24(state->col1), TimeValue(0));
        SetColor(1, ColorFromCol24(state->col2), TimeValue(0));
        SetSize(state->size, TimeValue(0));
        SetThresh(state->thresh, TimeValue(0));
    }
}
Ejemplo n.º 3
0
// --- Methods inherited from Tex3D ---
void Smoke::ReadSXPData(const TCHAR *name, void *sxpdata) {
	SmokeState *state = (SmokeState*)sxpdata;
	if (state != NULL && (state->version == SMOKE_SXP_VERSION)) {
		SetColor(0, ColorFromCol24(state->col1), TimeValue(0));
		SetColor(1, ColorFromCol24(state->col2), TimeValue(0));
		//SetSpeed(state->speed, TimeValue(0));
		SetPhase(0.0f, TimeValue(0));
		SetSize(state->size, TimeValue(0));
		SetIter(state->nits, TimeValue(0));
		SetExp(state->power, TimeValue(0));
	}
}
Ejemplo n.º 4
0
// --- Methods inherited from Tex3D ---
void Water::ReadSXPData(const TCHAR *name, void *sxpdata) {
	WaterState *state = (WaterState*)sxpdata;
	if (state != NULL && (state->version == WATER_SXP_VERSION)) {
		SetColor(0, ColorFromCol24(state->col1), TimeValue(0));
		SetColor(1, ColorFromCol24(state->col2), TimeValue(0));
		SetNum(state->count, TimeValue(0));
		SetSize(state->size, TimeValue(0));
		SetLenMin(state->minperiod, TimeValue(0));
		SetLenMax(state->maxperiod, TimeValue(0));
		SetAmp(state->amp, TimeValue(0));
		SetPhase(0.0f, TimeValue(0), TRUE); 
		}
	}
Ejemplo n.º 5
0
// --- Methods inherited from Texmap ---
RGBA Smoke::EvalColor(ShadeContext& sc) {
	float d;
	Point3 p, dp;

	if (gbufID) 
		sc.SetGBufferID(gbufID);

	xyzGen->GetXYZ(sc, p, dp);

	if (size == 0.0f) 
		size = 1.0f;

	d = SmokeFunc(p/size, iter);

	// If we have sub-texmaps and they are enabled, get the colors from 
	// the sub-texmaps, otherwise get them from the color swatch
	RGBA c0 = (mapOn[0]&&subTex[0]) ? subTex[0]->EvalColor(sc): col[0];
	RGBA c1 = (mapOn[1]&&subTex[1]) ? subTex[1]->EvalColor(sc): col[1];

	Col24 c;
	Col24 col1 = Col24FromColor(c0);
	Col24 col2 = Col24FromColor(c1);

	lerp_color(&c, &col1, &col2, d);
	return ColorFromCol24(c);
}
Ejemplo n.º 6
0
// --- Methods inherited from Texmap ---
RGBA Water::EvalColor(ShadeContext& sc) {
	float d;
	float q[3];
	Point3 p, dp;

	if (gbufID) 
		sc.SetGBufferID(gbufID);

	xyzGen->GetXYZ(sc, p, dp);

	q[0] = p.x;
	q[1] = p.y;
	q[2] = p.z;
	d = ScalarWave(q);
	if (d>1.0f) d = 1.0f;

	// If we have sub-texmaps and they are enabled, get the colors from 
	// the sub-texmaps, otherwise get them from the color swatch
	RGBA c0 = (mapOn[0]&&subTex[0]) ? subTex[0]->EvalColor(sc): col[0];
	RGBA c1 = (mapOn[1]&&subTex[1]) ? subTex[1]->EvalColor(sc): col[1];

	Col24 c;
	Col24 col1 = Col24FromColor(c0);
	Col24 col2 = Col24FromColor(c1);

	lerp_color(&c, &col1, &col2, d);
	return ColorFromCol24(c);
	}
Ejemplo n.º 7
0
// --- Methods inherited from Texmap ---
RGBA Stucco::EvalColor(ShadeContext& sc) {
	float f;
	Point3 p, dp;

	if (gbufID) 
		sc.SetGBufferID(gbufID);

	xyzGen->GetXYZ(sc, p, dp);

	if (size == 0.0f) 
		size = 0.0001f;
	p /= size;

	float scl = compscl(dp, size);
	f = Func(p, scl);

	// If we have sub-texmaps and they are enabled, get the colors from 
	// the sub-texmaps, otherwise get them from the color swatch
	RGBA c0 = (mapOn[0]&&subTex[0]) ? subTex[0]->EvalColor(sc): col[0];
	RGBA c1 = (mapOn[1]&&subTex[1]) ? subTex[1]->EvalColor(sc): col[1];

	Col24 c;
	Col24 col1 = Col24FromColor(c0);
	Col24 col2 = Col24FromColor(c1);

	lerp_color(&c, &col1, &col2, f);
	return ColorFromCol24(c);
}