georage Posted January 16, 2017 Share Posted January 16, 2017 Hello friends. Long time no see. I have returned and updated to 2.5 (from 2.4) and it seems something has changed with godrays (aka VolumetricLightScatteringPostProcess). I get this error. "VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead" Any clues about that? I had some rather dandy looking stars in 2.4! I can't make a playground either ... gives me an error Compilation error Line 4:16942 - Cannot read property 'precision' of null I blame myself for not playing with this for a while but any help is appreciated. -- George Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 17, 2017 Share Posted January 17, 2017 Hi George! Welcome back. Do you see in your code... something similar to this: var godrays = new BABYLON.VolumetricLightScatteringPostProcess('godrays', 0.8, camera, someMesh, 90, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false); Just make sure someMesh.material.diffuseColor is set (to a Babylon.Color3 value, of course). Then you can remove all the useDiffuseColor things. I lightly tested this... in a @Nabroski playground... http://www.babylonjs-playground.com/#14FG1S#6 At the end of line 34, this PG HAD a useDiffuseColor setting, which I removed. In lines 29/30, I force a new material onto one of the skulls... then we see if the godrays flash is in THAT color. It is. One of the skulls has a CYAN flash, so we know that the godrays generator is using the mesh.material.diffuseColor for it's VLS color. With me? Whatever material.diffuseColor is on the star itself, that will be the color of its godrays (in theory). At least I THINK that's how it works. I hope this helps. Good luck. Write back when ya get a chance. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
georage Posted January 17, 2017 Author Share Posted January 17, 2017 cool. thanks for the help. ALL IS WELL. http://babylonjs-playground.com/#AX6IZ#1 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.