Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 ] Page 1 of 2 |
|
|||||
|
im trying to make a day/night cycle and i was wondering if there is a possibility to change the skybox brightness somehow? |
||||
|
There isn't brightness control in Coppercube. You can change the texture of Skybox. |
||||
|
Yes, of course you can change the brightness in CC. Change textures to Dynamic and then use JavaScript to change it how you like. "For the root scene node, you can use "FogColor", "Realtime Shadows" (to enable/disable shadow mapping), "AmbientLight", and "BackgroundColor"." So first get root scene node with: ccbGetRootSceneNode(); Then update with - ccbSetSceneNodeProperty(sceneNode, propertyName, r, g, b); r g b is a range from 0 - 255 for each one. |
||||
|
but setting skybox to dynamic texture makes it show edges very well and cant be used like that any way else to change the brightness |
||||
|
thanks to your suggestion Arcanjo i changed the texture of my sky sphere to get day/night cycle i used 3 different textures for the cycle |
||||
|
Great, it's done! |
||||
|
well i changed it to regular skybox I want more changes in the light on the skybox |
||||
|
If you want you can use the example shader from the official documentation and can apply it to your skybox and multiply/divide the final output color with a value to control the brightness of the skybox. However, this will give you the required results with controllable brightness amount but will disable fog rendering on the skybox as well. hope that helps :) |
||||
|
quote If you want you can use the example shader from the official documentation and can apply it to your skybox and multiply/divide the final output color with a value to control the brightness of the skybox. thanks for your reply what example shader are you talking about? |
||||
|
dont mind ive solved this with very easy and good solution |
||||
|
I found it was not so good solution to add a alpha 2d overlay I want to make lights show when in the night and the 2d overlay blocks light |
||||
|
Depending what effect you want, an easy method is to attach (child) a billboard infront of the active camera. Use transparent alpha material and apply a linear_gradient transparnecy.png (from light to dark) as the texture. Now, just change the y position of the billboard to make the entire scene lighter or darker as the transparent gradient moves up/down infront of the camera. *basically just mimicking the mechanics of a real-life camera aperture opening/closing. eg: |
||||
|
thanks vp for you reply .. its basically the same as adding 2d overlay and changing the alpha the problem is it darkens lights also |
||||
|
Shader usage will be best suitable and easy to implement if you can avoid the Fog issue with SKYBOX. Let me quickly create one for you. |
||||
|
Here is the link to the customized shader that allows you to supply a brightness value for an object. Simply select your skybox and provide a brightness value in the shader action by default it uses 0.5 as the brightness value you can change it to according to your needs. you can also use 2 skybox tricks as well. Download the extension from Google Drive :- https://drive.google.com/file/d/... hopefully, this will be helpful to you and won't require you to have any other object in front of your camera. |
[ 1 2 ] Page 1 of 2 |
|