TomaszFurca Posted March 18, 2018 Share Posted March 18, 2018 Hi, Today I want to do LVLUP effect on character, but i have problem with godray effect, when player cover mesh with godray. Is possible to set GodRay to visible always on top? I think about no cover godray for any other object. Slavs (9).webm Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 19, 2018 Share Posted March 19, 2018 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. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted March 19, 2018 Share Posted March 19, 2018 By using 3D object as Wingnut says, you can deal with a mix of alphaMode = add and emissiveColor. Here a little example. You can also search for techniques and inspiration in few Sketchfab scene. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted March 19, 2018 Author Share Posted March 19, 2018 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; Wingnut and GameMonetize 2 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.