1
$\begingroup$

enter image description here

I'd like to have dynamically changing materials in the Blender Game engine.

Is there any way for the game logic or a python script to change the properties of a node in a material?

For example, in the image, I would like to be able to change the red "value" input that connects to the color ramp.

(I know that the BGE can assign an overall color to an object, but I would like to do more complex things than just single colors. If I could input that object color to the node set-up, having those 3 floats might be enough to work with)

Thanks for any help you can offer.

$\endgroup$
  • $\begingroup$ Yes you can use a python script to change any value you can change by hand $\endgroup$ – WhatAMesh Aug 9 '18 at 14:07
1
$\begingroup$

I've found a hack: the "Lamp data" node gives you the distance from a specified lamp to each fragment. That gives you a float to control the material, and the position of the lamp can be controlled with the game logic. This is a fairly terrible solution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.