Can anyone explain (and, preferably, attach a working c4d file) how to work with OSL Camera script "texture aperture cam"?
No matter what I do, I get the same black screen.
I follow the instructions, but it doesn't work for me [picture_of_a_sad_cat.jpg]
C4D OSL Camera Issue
Moderators: ChrisHekman, aoktar
You should use OSL Delayed UV projection in the ImageTexture node (I guess you already used that but I need to make sure). That's the only requirement.
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
- FullHPetroL
- Posts: 42
- Joined: Mon Apr 27, 2015 10:00 am
so, for now it appears to be useless, right?milanm wrote:You should use OSL Delayed UV projection in the ImageTexture node (I guess you already used that but I need to make sure). That's the only requirement.
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
If you use it as it is, then yes, that's true.FullHPetroL wrote:so, for now it appears to be useless, right?milanm wrote:You should use OSL Delayed UV projection in the ImageTexture node (I guess you already used that but I need to make sure). That's the only requirement.
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
The code can be easily changed, however, to use builtin OSL
texture()
function instead of _evaluateDelayed()
. That could work, but then you're facing another problem because the file paths will have to be absolute and if you save project with assets your aperture texture will not be included. Also you will not be able to take advantage of texture compression and other settings we have in the ImageTexture node.In that case you would have to change the
apertureTexture
input to a string value (file path) instead of color.Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Don't know what are you saying here as bug, would be great to point me that. BTW parameters are not magically appear in plugins. It has to implement for every types and cases. It's a complex part in plugin. Not a bug if I missed some cases.milanm wrote:You should use OSL Delayed UV projection in the ImageTexture node (I guess you already used that but I need to make sure). That's the only requirement.
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
- FullHPetroL
- Posts: 42
- Joined: Mon Apr 27, 2015 10:00 am
Aoktar, I thought I did smth wrong and couldn't get the result. And as the custom OSL script for camera was available, I concluded it had to work.aoktar wrote:Don't know what are you saying here as bug, would be great to point me that. BTW parameters are not magically appear in plugins. It has to implement for every types and cases. It's a complex part in plugin. Not a bug if I missed some cases.milanm wrote:You should use OSL Delayed UV projection in the ImageTexture node (I guess you already used that but I need to make sure). That's the only requirement.
BUT unfortunately it will not work because there is a bug in the C4D Octane plugin for color inputs in the camera shader. Because of that bug ImageTexture node will be ignored.
Cheers
Milan
So, I would like to point that this issue exists. Files are attached.
- Attachments
-
- OSL Camera Custom aperture.zip
- (118.9 KiB) Downloaded 157 times
@Ahmet
There is nothing to miss, OSL documentation is very clear about what inputs can be used. And there is not that many of them.
Color input in the camera shader doesn't work. You can see that the RGBSpectrum node is connected but it's missing in Octane. This camera will not render black if any non black color is connected on the color input:
As you can see it works in Standalone if we add any other color than black:
In Cinema 4D we get this:
Regards
Milan
There is nothing to miss, OSL documentation is very clear about what inputs can be used. And there is not that many of them.

Color input in the camera shader doesn't work. You can see that the RGBSpectrum node is connected but it's missing in Octane. This camera will not render black if any non black color is connected on the color input:
Code: Select all
shader OslCamera(
// Here is the color input
// In order for this camera to work you need to connect
// any color input here, RGBSpectrum, ImageTexture, FloatTexture... anything.
color ColorInput = 0,
output point pos = P,
output vector dir = 0,
output float tMax = 1.0/0.0)
{
float pa;
int res[2];
getattribute("camera:pixelaspect", pa);
getattribute("camera:resolution", res);
float aspect = pa * res[1] / res[0];
vector right = cross(I, N);
if (ColorInput != 0)
dir = I + right * (u - .5) + N * (v - .5) * aspect;
else
dir = 0;
}
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Here's fixed build
viewtopic.php?f=85&t=71065
viewtopic.php?f=85&t=71065
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
- FullHPetroL
- Posts: 42
- Joined: Mon Apr 27, 2015 10:00 am
Please, verify it is working, for It doesn't work for me.aoktar wrote:Here's fixed build
viewtopic.php?f=85&t=71065
- Attachments
-
- OSL Camera Custom aperture 2.zip
- (155.19 KiB) Downloaded 155 times