RedMax Posted March 28, 2017 Share Posted March 28, 2017 Hi I'm new to babylon.js and have worked with Unity3d before. I was used to write my own shader code there and the material still received lighting and shadows. What is the correct way to do it here? When I use the ShaderMaterial, only my shaders are used. I could probably copy&paste all the stuff from the default material in there, but I didn't have much success as I would have to set some defines and bind some stuff during the onBind call, if I understood it correctly. I could also write a whole new material. Then at least everything would be a little bit more clean, but I would still have to copy&paste a lot of things. Did I miss something entirely? What's with this ShaderBuilder I read a little bit about but doesn't seem to be bundled to BJS? What is the recommended way of creating a new shader with lights and shadows? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 28, 2017 Share Posted March 28, 2017 Hello and welcome! The best option if you want to get all features (including bones, shadows,etc..) would be to create a custom material. We have the material library for that http://doc.babylonjs.com/tutorials/how_to_create_a_material_for_materialslibrary I would suggest to start from the Simple Shader which is already set up and then add what you need 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.