|Thorsten Mueller (Unknown)||28.01.2010 07:15|
i want change the material of a mod component (node) during the game is running. How is it possible? Can i change the texture which is added to the matrial? Whats's about the parameters of the material (ambient color, diffuse color ...)?
|Stefan Geiger - GIANTS Software||01.02.2010 11:41|
|Unfortunately it is not yet possible to change the material of a node with a script command. However you could use different i3d/nodes and change the visibility flags or you could use a custom shader to switch between different textures. There is a setShaderParameter function which allows you to change the values of the custom shader parameters.
We will extend the functionality of the scripting interface in future releases of the engine, which includes changing all material parameters and changing the material assignments of the shapes.
|Thorsten Müller (Unknown)||02.02.2010 06:18|
Can you type a small example, how use the funtion 'setShaderParameter' to toggle between two textures. Which code must i implement for the custm shader?
|Stefan Geiger - GIANTS Software||04.02.2010 16:17|
|You can check the custom shader xml files for the sky. (data/sky/skyShader.xml)
There are 4 textures to be exchanged. You can change it to use only two texture.
There is a parameter "partScale" which is used to blend between the textures.
From lua you just need to set this value accordingly.
setShaderParameter(shapeId, "partScale", 1,0,0,0, true);
Uses the first texture only.
setShaderParameter(shapeId, "partScale", 0,1,0,0, true);
Uses the second texture only.
|Thomas Nagels (Unknown)||06.07.2014 21:36|
|I know I am reviving an old topic, but is the exchange of a texture possible yet? I am making a folding barrier and want to include a lot of signs, and it is a pain to have to add them all manually to the model...
Note: Log in to post. Create a new account here.