- Home /
CG compiled to GLSL: hyperbolic functions not found.
I'm using tanh (extensively for neural net simulation) from a CG shader. Under Unity 4 on my Macbook Pro this was fine unless I included #pragma glsl in which case hyperbolic functions would report an error of "no matching overloaded function found". But now under 5.0 on OpenGL shaders are always compiled into GLSL even without the pragma. To quote the update notes:
"On desktop OpenGL, shaders are always compiled into GLSL instead of ARB_vertex/fragment_program target now. You no longer need to write "#pragma glsl" to get to features like vertex textures or derivative instructions. All support for ARB_vertex/fragment_programs is removed."
I can see that the shaders are still compiling for D3D but not for OpenGL or OpenGL ES. How do I go about getting hyperbolic functions to compile into glsl in Unity?
Your answer
Follow this Question
Related Questions
Grabpass refraction masking 0 Answers
Difference between pos.z and pos.w? 0 Answers
How to prevent shader optimizations? 1 Answer
Cg Language incompatibility Desktop VS GLSL Android 0 Answers
Unity5 CG Shader get model position. 1 Answer