qqdarren Posted April 9, 2015 Share Posted April 9, 2015 I was playing around with animating specularColor and accidentally made it negative, which gave a black circle instead of a white one. (compared to no circle at all when I set to 0,0,0). And with a specularColor of -0.3,-0.3,-0.3 and changing the point light to purple, I get a green circle instead of a purple one. (See sphere4 in http://www.babylonjs-playground.com/#1FSFVV )I just wondered if this was a feature, that will stay supported, or a side-effect that could change? (I noticed that the documentation for the Color3 class just says they are "number", not 0.0 to 1.0 numbers, so it might be good to clarify the intention there?) No, I don't have a use-case for it... yet :-) Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 9, 2015 Share Posted April 9, 2015 link is wrong http://www.babylonjs-playground.com/#1FSFVV . Good idea to clarify before using undocumented behaviour. Quote Link to comment Share on other sites More sharing options...
qqdarren Posted April 9, 2015 Author Share Posted April 9, 2015 That link is still working for me. (I don't have to set anything to make my playground entries public, do I ?) Anyway, it was just the Materials start demo, with these lines added:light.specular = new BABYLON.Color3(1, 0, 1); //Purple light ...materialSphere4.specularColor = new BABYLON.Color3(-0.3,-0.3,-0.3);Then I added this at the end:var animDelta = 0.01;scene.registerBeforeRender(function () { materialSphere2.alpha += animDelta; if(materialSphere2.alpha <=0.0 || materialSphere2.alpha >= 1.0)animDelta = -animDelta; materialSphere2.specularColor.r = materialSphere2.specularColor.g = materialSphere2.specularColor.b = -materialSphere2.alpha;}); Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 9, 2015 Share Posted April 9, 2015 Your version of the link has a ')' on the end Quote Link to comment Share on other sites More sharing options...
qqdarren Posted April 9, 2015 Author Share Posted April 9, 2015 Ah, that was what you meant! Sorry. Just edited and fixed it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 9, 2015 Share Posted April 9, 2015 I can say this is on purpose (I do not want to spend CPU time checking values:)) Quote Link to comment Share on other sites More sharing options...
dbawel Posted April 10, 2015 Share Posted April 10, 2015 I've found the exact same result by mistake. I thought of reporting this as a bug, however, I view it more as a feature - since there might be a use for it - although I haven't found one yet. I never tried changing the color of my scene light and testing with negative specular values. This might be a case were there could be a use for allowing and using negative values in a scene; not only in the specular channel, but with diffuse and other color channels. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.