Jump to content

Changes to VolumetricLightScatteringPostProcess?


Recommended Posts

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





Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...