Hello,
In the OSL language specification, we read :
Shader types include the following: surface, displacement, light, volume, and generic
shader. Some operations may only be performed from within certain types of shaders (e.g.,
one may only call displace()or alter Pin a displacement shader), and some global variables
may only be accessed from within certain types of shaders (e.g., dPdu is not defined inside a
volume shader).
First thing first: you have to use a Script node to make use of an OSL shader. Your code lacks an output socket for the displacement. You can do it as such:
Cycles has no real render-time displacement at the moment, at least none worth trying to use. Dicing and hole patching is broken. Displacement via the OpenSubdiv standard is coming at some point in the future.
Hello,
Actually i have a script that enables true Cycles displacement you just have to turn experimental features on and true displacement with subdivisions on and finally plug the script below into the displacement input of your material: