Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
skybox brightness

coa
Guest
Quote
2022-04-29 10:28:25

im trying to make a day/night cycle and i was wondering if there is a possibility to change the skybox brightness somehow?


Arcanjo
Guest
Quote
2022-04-29 12:45:19

There isn't brightness control in Coppercube.
You can change the texture of Skybox.


Robo
Guest
Quote
2022-04-29 13:28:26

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.


coa
Guest
Quote
2022-04-29 14:10:00

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


coa
Guest
Quote
2022-04-29 19:47:22

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


Arcanjo
Guest
Quote
2022-04-29 20:42:25

Great, it's done!


coa
Guest
Quote
2022-04-29 21:19:15

well i changed it to regular skybox I want more changes in the light on the skybox


just_in_case
Moderator
Quote
2022-04-30 05:38:07

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 :)



coa
Guest
Quote
2022-04-30 10:11:05

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?


coa
Registered User
Quote
2022-04-30 14:10:10

dont mind ive solved this with very easy and good solution


coa
Registered User
Quote
2022-04-30 14:41:26

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


veganpete
Registered User
Quote
2022-04-30 21:53:04

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:
🔎︎



coa
Guest
Quote
2022-05-01 09:17:51

thanks vp for you reply .. its basically the same as adding 2d overlay and changing the alpha

the problem is it darkens lights also


just_in_case
Moderator
Quote
2022-05-02 02:06:45

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.


just_in_case
Moderator
Quote
2022-05-02 02:20:36

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.





Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact