heyzxz Posted August 11, 2017 Share Posted August 11, 2017 Hi there, I'm creating some customized materials in the materials library followed this tutorial. For each material, my work flow is something like this: 1. Create a folder in 'materialsLibrary/src/', then put 1 'ts' and 2 'fx' files in that folder(babylon.xxxMaterial.ts, xxx.vertex.fx, xxx.fragment.fx). Which is exactly followed the tutorial. 2. Once I finish, I run '$ gulp materialsLibrary' to convert all of the 3 files into one js file, then I copy&paste this js file directly into my project. My problem is: I use customized shaderIncludes in the shader codes. To make it work, I have to put these shaderIncludes in the place where the builtin includes are, but when generating the output file, these includes can't be added into the js file, so I have to also copy these includes manually into my project. Not very sure if this is the correct way to handle customized includes, is there a better way? You may ask why I need customized includes, because I want to use UBO, so I followed the variable declaration logic which the builtin shaders did( three declaration files as includes: xxxVertexDeclaration.fx, xxxUboDeclaration.fx, xxxFragmentDeclaration.fx) Quote Link to comment Share on other sites More sharing options...
heyzxz Posted August 11, 2017 Author Share Posted August 11, 2017 Aha, I found the solution... bowald 1 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.