Jump to content
Sign in to follow this  
Aeryes

Issue with SetParam() on materials?

Recommended Posts

Hey modders!!!

 

I am having an issue setting params for materials found in the graphics folder. I keep getting an error when I try to load my script ingame that says "materialColors is an incompatible parameter".

 

static float VIGNETTE = 0.0;	

Material materialColors = GetGame().GetWorld().GetMaterial("graphics/materials/postprocess/glow");

// Function used to change the strength of the vignette effect.
// Intensity value between 0-100. 0 been least instense, 100 most intense.
void changeVignette(int intensity) {
	VIGNETTE = ((intensity * 0.01) - 5.0);
	materialColors.SetParam("Vignette", VIGNETTE);
}

 

Here is a sample from my code. The basic layout looks like this, where I define my materials and create my functions to change param values. However it will not work as expected and keeps giving me the error I mentioned above.

 

All help is much appreciated.

Share this post


Link to post
Share on other sites

I found this example in the Files:

	Material matColors = GetGame().GetWorld().GetMaterial("postprocess/glow");
	SetMaterialParam(matColors, "Saturation", 0.8);
	float color[4];
	color[0] = 0.5;
	color[1] = 0.8;
	color[2] = 0.7;
	color[3] = 0.6;
	SetMaterialParam(matColors, "OverlayColor", color);

Try to use this method

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×