I’ve been exploring the Unity toolkit pipeline for BabylonJS. I’ve got builds working but I cannot figure out how to create a custom shader. I’m trying to create a custom splatmap shader and have no idea what I’m doing wrong.
I tried to follow the WaterMaterial example here (Shader Materials - Babylon.js Documentation) but I couldn’t get this to work. When creating a Shader Controller I get the following errors:
error TS2551: Property 'WaterMaterial' does not exist on type 'typeof BABYLON'. Did you mean 'ShaderMaterial'? error TS2339: Property 'initializeInstance' does not exist on type 'WaterMaterialController'. error TS2339: Property 'getScene' does not exist on type 'WaterMaterialController'.
I’m guessing that I have to import the Water shader separately, but I have no idea how that works in a Unity Toolkit project.
- What are the steps to setup a new shader inside Unity?
- Is the shader converted to WebGL automatically or do you have to make the WebGL version separately?
- Is the WebGL version added to the Unity project, or is it manually added to the HTML afterwards?
I’ve got a lot of questions so any help or tips would be appreciated.