Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I like to enable fog on command with Javascript, for example : when a button is pressed: activate fog. The manual only speaks of the option ''fog color'. Is there a command to enable/disable all fog for the WebGL target and not just the color? It would greatly enhanced my scene! thanks in advance. I have already tried: var root = ccbGetRootSceneNode(); ccbSetSceneNodeProperty (root, "Fog", false); Neither 'True or 'False' seem to work whilst it is no problem at all to change the color??? |
||||
|
Edit: this also only workes on windows. Fog property seems to work only for windows target. You can set fog density to 0 for webgl as the scene starts: let node = ccbGetRootSceneNode() Then set it to a required value as player presses the button. |
||||
|
If you un minify copperlicht.js file, you can see that there is only FogColor property, as you already mention: |
||||
|
Lol, you can just directly modify fog density property. Just call: n.$.qa.Ih = 0; To disable fog n.$.qa.Ih = 0.007; To set density back. |
||||
|
Thank you OkeOke for your quick reply. I somehow found the solution for my scene by simply enabling fog and set the density to 0. Look at the difference this makes in this short video.https://www.youtube.com/watch?v=... |
|