luan_ngo Posted December 3, 2018 Share Posted December 3, 2018 Hi everybody, I've applied the sky material to a skydome and I'm quite happy with the results. But, I'm creating a game that includes aircraft flying quite high and am realizing that the skymaterial is attached to the camera.position.y rather than 0 or a specified mesh. So, when the camera is really high up, the horizon is also too high. Is there an easy way to make the skymaterial relative to another height position or 0? Here's a playground: https://www.babylonjs-playground.com/#E6OZX#218 Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2018 Share Posted December 4, 2018 Pinging @Luaacro who is the author of the sky material Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted December 4, 2018 Share Posted December 4, 2018 Hey @luan_ngo, Pull request just created: https://github.com/BabylonJS/Babylon.js/pull/5597 Updating the doc ASAP. Anyway, to keep your horizon at position 0 on Y, just setup the property .cameraOffset on the material which is a Vector3. Example: skyMaterial.cameraOffset.y = scene.activeCamera.globalPosition.y Don't hesitate if you encounter a bug! Sebavan 1 Quote Link to comment Share on other sites More sharing options...
luan_ngo Posted December 6, 2018 Author Share Posted December 6, 2018 Okay! I'll give this a try. Thank you. 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.