i work in BGE and i would like change the texture or the material of an object.

For exemple if i click on a pushbutton the texture of the transparent windows fade to texture of curtain.

  • $\begingroup$ do you want to fade from a curtain texture to a totally transparent material, or do you want to fade from a curtain texture to a window texture with the middle transparent? $\endgroup$ May 10, 2016 at 14:34
  • $\begingroup$ I just would like to for example change my rock texture on my cube to a tree texture on my cube. $\endgroup$ May 10, 2016 at 14:50
  • $\begingroup$ Oh, that is actually rather easy. it doesn't need transparency? $\endgroup$ May 10, 2016 at 14:51

1 Answer 1


Well, there might be different solutions - but here is one which worked for me. It involves Material nodes with three seperate materials. You need...

  • one for your initial material (window),
  • one for your second material (curtain) and
  • one which controls your fading.

The last one uses the objects color, which can be changed via Python. Here is an my minimal example using a blue and red material as inputs and a shadeless one for fading:

enter image description here

When running it, the materials fade within 10 seconds, driven by the timer.

  • $\begingroup$ No need to use python here. Animate a value on a lamp or camera, and use lamp data or camera data as an input on your mix node. $\endgroup$ May 10, 2016 at 23:09
  • $\begingroup$ Well, what you need is a possibility to feed the mix node whit a value from 0 to 1, that's for sure. Following your suggestion I took a look at the input nodes for camera and lamp Data. For the cam there are view vector, z depth and distance, for the lamp there is color, light vector, distance, shadow and visibility factor. Which one do you suggest to change, and how would be your way of doing it without Python? $\endgroup$
    – AeroLynx
    May 10, 2016 at 23:38
  • $\begingroup$ simply animate the value of a lamp's color or strength, have that animation play in BGE, and use that in a lamp data node as imput. $\endgroup$ May 11, 2016 at 0:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .