fateriddle Posted November 5, 2018 Share Posted November 5, 2018 https://www.babylonjs-playground.com/#14KRGG#23 It is the waterSphpere example, except I comment out line 23: // var helper = scene.createDefaultEnvironment(); Then the outer sphere become transparent... I don't want to use createDefaultEnvironment in a real project, but how do I mimic what it provides to make this example works as intended? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 5, 2018 Share Posted November 5, 2018 scene.createDefaultEnvironment() is a convenience function for: new EnvironmentHelper(undefined, this); So, you just need to make sure you pass in only the options you want to keep. You are creating it with the default options: https://github.com/BabylonJS/Babylon.js/blob/master/src/Helpers/babylon.environmentHelper.ts#L194 So, you can either call with the options you would like to or work your way backwards from that file to get just the parts you need At least I think that is the best starting point. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 5, 2018 Share Posted November 5, 2018 I'm not sure if I well understand your question, but if you just want to use a custom environment texture (which is in any case needed when in PBR workflow), you just have to not use the helper and manually create your envTex: var hdrTexture = new BABYLON.CubeTexture("textures/environment.env", scene); hdrTexture.gammaSpace = false; scene.environmentTexture = hdrTexture; https://www.babylonjs-playground.com/#14KRGG#26 But if you want also use a custom reflection texture, you still need the environmentTexture but it's possible to add a reflectionTexture on your material: waterMaterial.reflectivityColor = new BABYLON.Color3(0.05, 0.05, 0.05); waterMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox2", scene); waterMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; https://www.babylonjs-playground.com/#14KRGG#27 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.