6
$\begingroup$

As seen in the comparison below, before, it looks right in the camera view; however, the glossy baking result appears to be projected from the normals instead of POV. I have been able to find very little information on the wiki about this.

Is there any way to keep the glossy baking result the same as the rendered image (from specific POV)?

Notice the reflection on both the ball and the ground.

Before: Before

After: After

$\endgroup$
3
  • 4
    $\begingroup$ This was actually added as a feature a while ago, but later removed due to some bug reports about the other side of the object being black. $\endgroup$
    – gandalf3
    Dec 28, 2014 at 7:00
  • $\begingroup$ I see. Thanks for the info. I agree with you there, it is necessary to add them both as option. The current solution is hardly useful for baking strong glossy surface, which limits its own power. $\endgroup$ Dec 28, 2014 at 7:34
  • $\begingroup$ You might want to explain your use-case on the mailing list to see if any other users feel the same way (and if any devs want to add this). ;) $\endgroup$
    – gandalf3
    Dec 28, 2014 at 8:30

2 Answers 2

4
$\begingroup$

Blender uses the normal as the camera ray vector when baking. While it's not possible to change this, it is possible to change the surface normal.

The trick then is to calculate a surface normal that produces the same reflection vector from the camera ray as the original surface normal would have from a custom camera position. You could do this with either a bunch of Cycles nodes, or with a OSL script:

shader osl_reflection_normal(
  vector FakeCamPos = 10,
  int IsCameraRay = 1,
  output normal ReflNormal = N)
{
    if (IsCameraRay)
    {
        // Normal pointing from FakeCamPos to here
        normal fakeCamNormal = normalize(P - FakeCamPos);

        // Reflect fakeCamNormal across the surface
        normal fakeReflection = reflect(fakeCamNormal, N);

        // For some reason I points towards the camera? Otherwise we'd use -I
        normal incidenceNormal = normalize(I);

        // The average of the incidence normal and the fake reflection normal gives us a normal that reflects one to the other.
        ReflNormal = normalize(fakeReflection + incidenceNormal);
    }
}

You'll want to plot in the camera position for FakeCamPos, and supply the "Is Camera Ray" from a Light Path node. The output goes into the Normal input of the glossy shader.

$\endgroup$
1
$\begingroup$

This is currently unsupported.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .