In following rib file I use an indirect light with point light but I don't see the effect of indirectdiffuse in the image. Any help is appreciated. this is the rib file:
Hi Mosari, I apologize about the late response to this.
The usual way to do global illumination is using photon mapping. In order to do that, you need to have a photonmap generation pass. The basic structure is:
Now you can use ambientindirect in your second pass.
For the best results, you need to do 3 passes:
1- Generate the photon map
2- Use the photon map to generate an irradiance cache
3- Use the generated irradiance cache to generate the image
In typical production, you can have many more passes. A good documentation on global illumination using RenderMan interface is the PrMan application notes. I tried looking for it online, but could not find it.
Okan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In that thread I wanted to know the mechanism of indirectdiffuse function.
I have seen the Prman application note about GI and something I want to
understand is the compatibility of the function in Pixie with the Prman version. In Prman, indirectdiffuse call the shader or Cs primitive at rayhits and return the color value and if the samples were more than 1
it return the average color.
Now suppose this scenario : in cornel box with matte shader we create a point light and an indirect light. Regarding Prman, because of point light, when ray hits the side it should return the diffuse color of that side (red,blue,..) and it works, but when I test this scene with Pixie indirectdiffuse always return black. This is not the case about occlusion because it works just like Prman version.
In Pixie docs about indirectdiffuse there is a sample that you have said that the seen has been rendered with only ambient indirect light. Could you share the rib file of that sample please.
Thank you again
Mostafa
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In following rib file I use an indirect light with point light but I don't see the effect of indirectdiffuse in the image. Any help is appreciated. this is the rib file:
Orientation "rh"
Sides 2
ArchiveBegin "bottomnurbsCubeShape1"
NuPatch 4 4 0 1 4 4 0 1 "Pw"
ArchiveEnd
ArchiveBegin "pCubeShape1"
PointsGeneralPolygons "P" "N" "facevarying float s" "facevarying float t"
ArchiveEnd
ArchiveBegin "topnurbsCubeShape1"
NuPatch 4 4 0 1 4 4 0 1 "Pw"
ArchiveEnd
ArchiveBegin "rightnurbsCubeShape1"
NuPatch 4 4 0 1 4 4 0 1 "Pw"
ArchiveEnd
ArchiveBegin "frontnurbsCubeShape1"
NuPatch 4 4 0 1 4 4 0 1 "Pw"
ArchiveEnd
ArchiveBegin "backnurbsCubeShape1"
NuPatch 4 4 0 1 4 4 0 1 "Pw"
ArchiveEnd
FrameBegin 1
Display "perspShape defaultRenderLayer Frame : 1" "framebuffer" "rgba"
Format 640 480 1
Projection "perspective" "fov"
Clipping 0.1 1000
PixelSamples 3 3
PixelFilter "box" 2 2
Exposure 1 1
Transform
WorldBegin
ShadingInterpolation "smooth"
Attribute "visibility" "integer diffuse"
Attribute "visibility" "integer specular"
Attribute "visibility" "integer transmission"
Attribute "trace" "bias"
TransformBegin
Transform
LightSource "ambientindirect" 1 "uniform float numSamples"
LightSource "pointlight" 2 "float intensity" "from"
TransformEnd
AttributeBegin
Attribute "identifier" "name" "nurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "topnurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "topnurbsCubeShape1"
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "topnurbsCubeShape1"
AttributeEnd
AttributeEnd
AttributeBegin
Attribute "identifier" "name" "bottomnurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "bottomnurbsCubeShape1"
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "bottomnurbsCubeShape1"
AttributeEnd
AttributeEnd
AttributeBegin
Attribute "identifier" "name" "rightnurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "rightnurbsCubeShape1"
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "rightnurbsCubeShape1"
AttributeEnd
AttributeEnd
AttributeBegin
Attribute "identifier" "name" "frontnurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "frontnurbsCubeShape1"
Color
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "frontnurbsCubeShape1"
AttributeEnd
AttributeEnd
AttributeBegin
Attribute "identifier" "name" "backnurbsCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "backnurbsCubeShape1"
Color
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "backnurbsCubeShape1"
AttributeEnd
AttributeEnd
AttributeEnd
AttributeBegin
Attribute "identifier" "name" "pCube1"
ConcatTransform
AttributeBegin
Attribute "identifier" "name" "pCubeShape1"
Surface "matte" "uniform float Kd" "uniform float Ka"
ReadArchive "pCubeShape1"
AttributeEnd
AttributeEnd
WorldEnd
FrameEnd
Mosari
Hi Mosari, I apologize about the late response to this.
The usual way to do global illumination is using photon mapping. In order to do that, you need to have a photonmap generation pass. The basic structure is:
Hider "photon" "emit"
Attribute "photon" "globalmap" "global.gpm"
Attribute "trace" "maxspeculardepth" 5
Attribute "trace" "maxdiffusedepth" 5
WorldBegin
…
WorldEnd
Now you can use ambientindirect in your second pass.
For the best results, you need to do 3 passes:
1- Generate the photon map
2- Use the photon map to generate an irradiance cache
3- Use the generated irradiance cache to generate the image
In typical production, you can have many more passes. A good documentation on global illumination using RenderMan interface is the PrMan application notes. I tried looking for it online, but could not find it.
Okan
Hi Okan and thank you for reply
In that thread I wanted to know the mechanism of indirectdiffuse function.
I have seen the Prman application note about GI and something I want to
understand is the compatibility of the function in Pixie with the Prman version. In Prman, indirectdiffuse call the shader or Cs primitive at rayhits and return the color value and if the samples were more than 1
it return the average color.
Now suppose this scenario : in cornel box with matte shader we create a point light and an indirect light. Regarding Prman, because of point light, when ray hits the side it should return the diffuse color of that side (red,blue,..) and it works, but when I test this scene with Pixie indirectdiffuse always return black. This is not the case about occlusion because it works just like Prman version.
In Pixie docs about indirectdiffuse there is a sample that you have said that the seen has been rendered with only ambient indirect light. Could you share the rib file of that sample please.
Thank you again
Mostafa