≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Dynamic lighting for sky boxes
Posted by:
(you are not logged in)
Enter the missing letter in: "Intern?tional"
(you are not logged in)
Text:
[quote][b]Robo[/b] wrote: I found a good way to dynamically change skybox lighting after quite a bit of trial and error. You can now dynamically adjust Ambient & Emissive (glow) on textures like skyboxes etc. You have to convert an RGB value into HEX as below to run: at every 50ms intervals or so run with variable ambient as 'amb' : var node = ccbGetSceneNodeFromName("SkyBox"); if (amb > 50) { amb = (amb - 1); var rgbToHex = function (rgb) { var hex = Number(rgb).toString(16); if (hex.length < 2) { hex = "0" + hex; } var color = (hex+hex+hex); ccbSetSceneNodeMaterialProperty(node, 0, "Ambient", color); ccbSetSceneNodeMaterialProperty(node, 1, "Ambient", color); ccbSetSceneNodeMaterialProperty(node, 2, "Ambient", color); ccbSetSceneNodeMaterialProperty(node, 3, "Ambient", color); ccbSetSceneNodeMaterialProperty(node, 4, "Ambient", color); ccbSetSceneNodeMaterialProperty(node, 5, "Ambient", color); ccbSetCopperCubeVariable("skyAmb", amb); return hex; }; rgbToHex(amb); } This will darken a skybox and can also do the same by replacing "Ambient" with "Emissive". I tried very hard but unable to adjust the alpha also this way...might not be possible....post an update anyone who figures that out.[/quote]
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