Jump to content

GodRay - always on top


TomaszFurca
 Share

Recommended Posts

Hi again, TF.  Did you do a forum search for Godrays and possibly read... that they are a 2D effect? 

I'm no expert, but I will tell you what I MIGHT know.   Because godrays are 2D (a post-processing effect), they don't do 'depth sorting'.

You could use a partially transparent cylinder for your beam of light, instead.

I once used semi-transparent cones with fire texture applied... to simulate volumetric spotlights.

http://playground.babylonjs.com/#2IGNZ2#4

You might wish to do something similar.  Godrays work best when the beams are sort-of aimed/aligned directly toward the camera, and their emitting material is not occluded/blocked.

Likely, I am not explaining that very well.  Godrays are a 2D post-process, so they have some limitations.  Glow layers and highlight layers have these same limitations, I believe.

Perhaps others can explain it better/more-detailed than I, if wanted.

Link to comment
Share on other sites

Thanks a lot :). I did it using Fresnel - some tweaks is needed and it would be fine :) .

If someone need it:

        let fakeGodRay = BABYLON.Mesh.CreateCylinder("test", 25, 1, 10, 64, 1, scene);
        fakeGodRay.position = new BABYLON.Vector3(0, 14, 0);

        fakeGodRay.material = new BABYLON.StandardMaterial("fakeGodRaymat", scene);
        fakeGodRay.material.emissiveFresnelParameters = new BABYLON.FresnelParameters();
        fakeGodRay.material.emissiveFresnelParameters.leftColor = BABYLON.Color3.Black();
        fakeGodRay.material.emissiveFresnelParameters.rightColor = BABYLON.Color3.White();
        fakeGodRay.material.emissiveFresnelParameters.bias = 0;
        fakeGodRay.material.emissiveFresnelParameters.power = 4;
        fakeGodRay.material.emissiveColor = new BABYLON.Color3(0.9, 0.9, 0.3);
        fakeGodRay.material.useEmissiveAsIllumination = true;
        fakeGodRay.material.alpha = 0.2;
        fakeGodRay.material.alphaMode = 1;

 

FireShot Capture 153 - Slavs - http___localhost_3000_.png

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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