Getting a skybox material?


Is there a way to get the material of a skybox? So it can be changed based on time of day or enviornment.

So far I see, in the Material objcect SetShaderParameter.

I am trying to setup a way to change the sky look based on differerent conditions. The only think I can think of is two skyboxes with one having a clude layer with opacity and another that has the actual diffused slash color.


Looking at the documentation for Skybox ( … kybox.html), I see that it inherits this from Drawable:

Material * GetMaterial () const Return material.

So my bet is that you should try getting the material from the skybox object with the GetMaterial method like this:


[code]//Assuming skybox is your skybox reference.
Material* mat = skybox->GetMaterial();

//Do anything you want to mat…[/code]

For the script counterpart check out the Skybox documentation on the script API: … ass_Skybox


Feel free to ask for further details if I missed something. I’ll try to help all I can!

PD: I don’t know why Skybox.materials is a vector in the Script API (the property “material” seems to be write-only) but having only one material it should be on position 0. I haven’t tested it so correct me if I’m wrong.