- Home /
Unity Shaders in Native c++ plugin
Hey, I was wondering if there is any way to use Unity shaders when using the low level native rendering interface from a c++ and openGL plugin. I'm doing some rendering from a plugin and wish to integrate it with the lights in my scene. I would rather not have to re-implement all the complex lighting stuff in unity.
From what I can tell if I can't just easily tap into the unity shader pipeline from my native plugin, then I will need to retrieve a list of all the lights affecting my object, make them available to my GLSL shader, and then perform all the correct lighting calculations from my own custom GLSL shader. Any shortcuts around this? Is there a simple way of getting access to all the variables that unity makes available for "free" when writing GLSL shaders in editor?
Ideally I would like to just be able to write a typical ShaderLab shader and pass the GLSL compiled version into my native plugin and just call glUseProgram(program); and have everything magically work, but I'm guessing it's not going to be quite that easy.
for good question, -1 for not crosslinking. http://forum.unity3d.com/threads/141005-ShaderLab-shaders-in-native-OpenGL
Your answer
Follow this Question
Related Questions
clipping shader for OpenGL quad 0 Answers
How do I use advanced OpenGL blend mode ? 0 Answers
External terrain renderer 0 Answers
GLES20: vprog textures are used, but not supported. 1 Answer
How to use Unity3d shader to mask another two-pass shader? 0 Answers