Re: Implementing a Shader System back
Board:
Board index
Raytracing
General Development
(L) [2014/03/06] [tby fpsunflower] [Re: Implementing a Shader System] Wayback!I wrote a simple example renderer for OSL called "testrender" which is part of the package. Its intended to serve as a minimal example of adding it to your renderer, including how to associate your own BSDFs to closures.
[LINK https://github.com/imageworks/OpenShadingLanguage/tree/master/src/testrender]
This may be an easier starting point than cycles.
(L) [2014/03/06] [tby janzdott] [Re: Implementing a Shader System] Wayback!Thank you fpsunflower.  I think I understand it now.  Though I'm having a really hard time getting OSL set up.  I wasn't able to compile the libraries on Windows because the makefiles spewed out tons of errors, but I downloaded the lib files from Blender's website.  Then I downloaded OpenEXR.  OSL wants the Imath headers, but there are no Imath headers at all in OpenEXR.  Any chance you'd be able to help me out?
Edit:  Nevermind.  I downloaded the OpenEXR source from their website, which doesn't have Imath, even though the website says it does.  The source on GitHub does have it.
(L) [2014/03/09] [tby stefan] [Re: Implementing a Shader System] Wayback!Imath is part of IlmBase:
 [LINK http://openexr.com/downloads.html]
(L) [2014/03/15] [tby syoyo] [Re: Implementing a Shader System] Wayback!I'm settled to use OpenCL C based language for the shader system.
[LINK https://www.youtube.com/watch?v=_sGOrOAi2n4]
It leverages clang/LLVM JIT library so its very easy to embed full-spec language into the renderer.
Still you have to implement some ray tracing specific builtins, such like trace(), noise(), etc. but its very simple work compared to implementing custom language & compiler from scratch.
back