Page 1 of 1

PBR Override shader in Unity

PostPosted: Wed May 06, 2020 9:25 am
by gcn
Hello,
I have a material in Unity which uses a PBR Override shader, because Octane doesn't accept my own custom Unity surface shader.
Everything works fine and well in Octane, however it looks horrible in the Unity editor (and in Play Mode), the material given to an object looks bad as it has only a diffuse texture assigned.
I have then found the Unity surface shader code for the PBR Override, which is located in Assets/Plugins/Octane/octaneShader.shader. After copying my custom shader code to this octaneShader, I could have two different behaviours of the same material both in Unity and in Octane render.

After Octane plugin update my shader code in the octaneShader reverted back to original (almost empty code - with only a diffuse texture assigned), so I guess the octaneShader works as a blueprint (in case of more materials that use PBR Overide shader) and it is not for users to modify. I have tried to make my own PBR Override shader file (just copied the file and changed the shader name to something like "Octane/PBR Override/MyShader") but for some reason I failed to link that shader to my material.

So my question is: how can I use PBR Override without losing how my original Unity material looks like?
Right now I am using two completely unrelated materials (one using my custom shader and other using the PBR Override) and I have to manually switch between those two.

I cannot find anything regarding this matter in any documentation, but I found a forum post that discuss this problem, however old and with no reply - https://render.otoy.com/forum/viewtopic.php?f=129&t=63488

Thank you

Re: PBR Override shader in Unity

PostPosted: Wed May 06, 2020 11:59 am
by ChrisHekman
Good question. There is no real satifying way to solve this issue at the moment.
Your solution of changing the pbroverride shader is probebly the best solution for the moment. However as you noticed, it will be overwritten when you update.

I'll see if it is possible to visually improve the pbroverride shader by making it similar to the default unity shaders.
Until then, your solution of changing the shader is probebly the best route. Just make sure you keep a copy before you update.