Use custom shader at runtime, standard shader in Editor?
I am building a VR app in unity. As of the time of writing, GoogleVR SDK's solution for lens distortion correction makes it almost impossible to hit a frame rate near 60fps on mobile devices, even in a nearly empty scene. The current solution is Brian Kehrer's vertex displacement shader approach outlined here .
Using the vertex displacement shader approach, i get great, high-fps performance in my scene on mobile devices, however with the custom shader applied, it becomes impossible to visually navigate the objects in Editor mode as their "actual" locations of their vertices are different than what is visually shown in the editor. it becomes a big distorted mess.
For the time being, I have been working on my project with no distortion correction at all, just using the standard shaders. when the app is ready to create demo builds, i will switch all the objects to use the custom vertex displacement shader, making the editor unusable and wasting tons of my time.
Is there a solution to where I can tell the editor to always use the standard shader, and use the custom shader at runtime? I see this similar question posted, but is using a pre-processor directive really the best way to manage this? looking for input from anyone who has worked with vertex displacement shaders
thanks!
maybe it's possible to create a shader that is the standard in editor and as a fallback for mobile the correct one there. never done it, but maybe a solution:
https://docs.unity3d.com/$$anonymous$$anual/SL-Builtin$$anonymous$$acros.html
Your answer
Follow this Question
Related Questions
Mesh (Reticle) with Overlay shader disappears at certain camera angles 1 Answer
Any workaround for 5.6 additional camera preview crash (in VR) 0 Answers
Vr Editor for 2018.2.1 0 Answers
How can I fix the particle system from not displaying correctly in VR?,How can I fix this? 0 Answers
Building Portal in VR in Single-Pass Stereo shader 3 Answers