Terrain shader parameter


Are there the world parameters sunColor, sunIntensity and sunDirection, which I could set as fragment shader parameter? If yes, how to do that?


I have not yet looked. This might prove useful.



Darn, I’ve needed one of those for a long time.


Thanks for the hint. :wink: I have not thought, that I would need Javascript. Is the following solution possible?

  1. Set the property ParentID of the terrain to the entityID of the skybox zone.

  2. Write the URL of the following script into the field “script url” of the terrain:
    var sunProperty = Entities.getEntityProperties(this.ParentID, ["color", "intensity","direction"]);

  3. Set the field “user data” of the terrain to:
    { "ProceduralEntity":{ "shaderUrl":"<url>", "uniforms":{ "sunColor":sunProperty.color, "sunIntensity":sunProperty.intensity, "sunDirection":sunProperty.direction }, } }