Hi, it seems in my code is something wrong. For demonstration purposes I have setup a simple scene and a shader that outputs its results in a variable that is written into a seperate file. But this files looks not really correct, the floor should be black, instead it gets a random pattern. Please have a look at this page to see what I mean:
I have had this problem in the past.
If my memory serves me correctly, it is caused because the shader on the floor is not setting the variable that is being output to the secondary file. Since it is not explicitly set, the renderer seems to guess, causing strange patterns. The fix should be to add a line such as this to the floor's shader:
float secondary_output_variable = 0;
It's been a while, so we will see if I am remembering correctly.
I hope that helps.
Thanks, I'll try that. But if I have a lot of shaders, this procedure is a little bit expensive. Is this a problem with the renderer or is this not a bug but a feature?
That's a very very good point.
Which reminds me, I read someone once recommend using a volume shader to 0 out all the AOVs. (Dan Maas SIGGRAPH '06 course 25. http://www.renderman.org/RMR/Publications/sig06.course25.pdf)
_Easy rendering of “global” AOVs using atmosphere shaders
RenderMan recently added a great new feature called Arbitrary Output Values (AOVs) that let you output any
shader variable as a separate image along with the main rendering.
Let’s say you want to output some “global” quantity, like xyz coordinates, from all the objects in your scene. But
it’s a big job to go and modify each one of your surface shaders to add the AOV.Wouldn’t it be great if there
were some kind of auxillary shader you could add to every surface, so you wouldn’t have to modify each one?
It turns out there is: an atmosphere shader! Remember, in RenderMan an atmosphere shader runs right on every
affected primitive right after the surface shader, and it has access to all the surface quantities like P, Oi, and Ci.
So just write a single atmosphere shader to output your AOV and apply it to the entire scene. If your AOV isn’t
among the pre-defined global variables, you can probably obtain it by message-passing from the surface shader.
Note that if you want to assign a particular non-zero value to areas of the image where no foreground objects
appear, you’ll have to surround the scene with a large surface to give the atmosphere shader something to
operate on (I use a large, inward-facing Sphere primitive with an opacity of 0.0001)._
I'm not sure if that addresses your concern. I hope it helps.
Yes, I read this pdf. And a volume shader assigns a value to all objects and this way it should work fine. I'll try that.
Log in to post a comment.