PBS + custom hlsl code
Posted: Tue Jun 05, 2018 5:14 pm
I've been looking into thing the last days, and I wanted to confirm a couple of things before I continue.
I've implemented the custom fog found here:
viewtopic.php?f=25&t=83081#p518819
That one works very well, and I learned some things about the PBS system doing this.
Now the next thing I want to do is to get some custom hlsl shaders into the pbs system.
Now what I've done now is to create 'pieces' for the code and variables and all that (vertex\pixel shader), and made sure they are set where they should in the 'pieces' definitions, but I was kinda expecting that I then can create a 'standard' pbs material in code, then add those 'pieces' to that one through c++,and by doing that the PBS is extended with the custom pieces. So that when the material is applied to a mesh it will also include the custom vertex shader code in the pbs shader.
But it seems the 'addpiece' is private and not accessible in the pbs material.
So - am I thinking wrong doing it this way? Do I need a full custom PBS class for doing what I want?
I've been looking at the terra example, but that one has a full custom PBS class, and that feels a bit overkill for what I want to do.
I've implemented the custom fog found here:
viewtopic.php?f=25&t=83081#p518819
That one works very well, and I learned some things about the PBS system doing this.
Now the next thing I want to do is to get some custom hlsl shaders into the pbs system.
Now what I've done now is to create 'pieces' for the code and variables and all that (vertex\pixel shader), and made sure they are set where they should in the 'pieces' definitions, but I was kinda expecting that I then can create a 'standard' pbs material in code, then add those 'pieces' to that one through c++,and by doing that the PBS is extended with the custom pieces. So that when the material is applied to a mesh it will also include the custom vertex shader code in the pbs shader.
But it seems the 'addpiece' is private and not accessible in the pbs material.
So - am I thinking wrong doing it this way? Do I need a full custom PBS class for doing what I want?
I've been looking at the terra example, but that one has a full custom PBS class, and that feels a bit overkill for what I want to do.