Possible to use the OSL Baking Camera in C4D?

Sub forum for help and tutorials.

Moderators: ChrisHekman, aoktar

Post Reply
vfxaaron
Licensed Customer
Posts: 3
Joined: Tue Jan 10, 2017 12:55 am

Hello there!

I have been developing an OSL camera shader for a projection mapping project. Within Octane standalone, I can access the OSL Baking Camera type, but via the C4D plugin (Octane and plugin v4.04) the OSL Baking Camera isn't available.

The OSL Camera type is available in C4D, and I currently have a workaround. However, the shader could be greatly optimized and quality increased if we could access the OSL Baking Camera from C4D. Currently we're baking world position maps to UVs as 32-bit EXR, then accessing that info via the OSL camera, but accessing geometric info directly via the OSL Baking Camera would be amazing!

Incidentally, I tried using the Baking Camera OSL sample code (link:https://docs.otoy.com/osl/camera/) on a Standard OSL camera, but to no avail. It can't seem to access _findBakingPrimitive(), which makes sense.

Thank you,
Aaron
User avatar
aoktar
Octane Plugin Developer
Posts: 16063
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

Yes but when I implement it. I think it's not a part of V4. So it will be in 2019 version
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
vfxaaron
Licensed Customer
Posts: 3
Joined: Tue Jan 10, 2017 12:55 am

Thank you for responding. In the meantime, is there any other way in OSL to access/query world position of a point on an object's surface, from a 2D coordinate in that object's UV map?

Unfortunately, the workaround we have isn't quite working. We're baking the world position in UV space to an EXR, then reading from that EXR to get the data we would be getting from the OSL baking camera, in a normal OSL camera. The problem is that we're getting some heavy pixelation / slicing from this approach. It seemed like this was happening because the numbers we were dealing with are very large, but scaling the scene down and normalizing the position bake to the object's bounding box (only 0.0 - 1.0 values in a 32-bit EXR) haven't helped. Messing with ray epsilon also didn't make a difference.

Please let me know if you have any advice. My next test will be to export a scene to Octane Standalone, then try using the OSL Baking Camera. This wouldn't be ideal for our pipeline though, as it would mean all artists on the project would need to convert and render their scenes with Standalone instead of straight from C4D.

Thank you!
Post Reply

Return to “Help / Tutorials”