A minimal OSL integration example using Ray Tracing in One Weekend! #2163
jinhgkim
started this conversation in
Show and tell
Replies: 1 comment
|
At a minimum, you should submit a PR that adds the link to the section of our README that points to documentation and other external resources. But also, if you wanted to somehow convert this into an OSL testsuite item, you would be welcome to and it would probably be both good additional test coverage and yet another example of how OSL integrations into renderers work. (I don't have any preconceived notions of how it should be structured -- vendor a stripped down version? start the test by doing a git clone it if it's not already there?) Or not, it's also fine for you to have no interest in any of it being tightly coupled to the OSL tests. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
OSL already provides
testrenderto demonstrate how one could integrate OSL into a renderer. This is useful for someone who already has expertise in the domain. But for those with little knowledge, it can quickly be overwhelming: the complex concepts of a renderer are tangled up with the OSL integration, and it is easy to get lost along the way.For those who are just starting to learn the ray tracer, OSL, etc., there needs to be a more straightforward way to see this. (If you are looking at testrender, I'd assume you already know, or have at least heard of, "Ray Tracing in One Weekend" by Peter Shirley!)
So, I wrote an OSL backend for RTIOW (and for my own sake cuz I was confused!): https://github.com/jinhgkim/Path-Tracer. This serves as a stepping stone into understanding testrender, by first focusing on the OSL integration with a minimal example and seeing the structure first, how OSL and the renderer dance together. And then, as the next step, expanding further through testrender.
Currently only three closures are registered, matching the three RTIOW materials, so it can be compared against the C++ original version. So it won't have as much freedom as OSL provides. BUT, if you are writing your own renderer and trying to integrate OSL, or are just curious how an existing renderer and OSL work together, this will give you quick and easy to follow steps for the integration. Bonus if you already know RTIOW! You can skip the renderer side entirely and go straight to the OSL parts.
Hope it helps!
All reactions