5
$\begingroup$

I have a 360-degree panorama(rendered in Blender) and want to composite a glare effect onto it. The problem is that once it is viewed in a 360 photo view the effect seems distorted due to projection distortion. Is there any way to compensate for this?

Example:

This is a 360° equirectangular panorama of a simple scene of a sphere with a glare effect 360glare

If you then map it onto a sphere, then render that sphere, it looks like this enter image description here

Because the sphere is the same color as the background is it impossible to see, but if I map bright to red and dark to green to make it easier to see against the background and increase the contrast, I get something like this enter image description here

You can see that the effect pinches the glare effect towards the poles.

That blend file can be downloaded here

$\endgroup$
  • $\begingroup$ Interesting issue! Never thought of that. I'll give it some hard thought $\endgroup$ – Dr. Farquaad Sep 11 '18 at 1:30
  • 1
    $\begingroup$ If you look up a tutorial for after effect on editing 360 footage you can see what I mean. They use an effect the distort whatever they are compositing so it looks right when you project it. $\endgroup$ – Ben Sep 11 '18 at 11:59
  • $\begingroup$ I just applied glare to an Equirect export then applied that to a sphere object and the glare streaks looked correct. Where would I see pinching or distortion? I did notice that the glare doesn't wrap around past the UV seam of the object I'm mapping back to. That would be a serious issue. Its overcome in the compositor with the Blur node having Extend Bounds. $\endgroup$ – 3pointedit Dec 24 '18 at 4:03
  • $\begingroup$ Oops I guess the poles are pinching worst. Because I'm applying a flat alteration to a Equirect distorted image. Perhaps you could UV distort the glare based on a sphere unwrap? But then you'll be moving the location off the glare origin... hmmm. I think that the problem is Blender's compositor expects to work in flat space, so procedural blurs like Glare cannot disort to follow Equirect space $\endgroup$ – 3pointedit Dec 24 '18 at 4:41
2
+50
$\begingroup$

Lens flare depends on the orientation of the lens you are looking through in relation to the light source so it cannot be rendered into a panoramic image that is then viewed as if the orientation of the camera would be changing.

It would have to be an effect generated while viewing the image. So the answer seems to be:

No. There is no way to compensate for this at the stage where you are making the panoramic image.

It should be done at the stage where the image is viewed.

$\endgroup$
  • $\begingroup$ I am not talking about a lens effect I am talking about a glare effect. I could understand your confusion if you thought I was talking about a lens flare. Information on this node can be found in the blender manual here docs.blender.org/manual/en/latest/compositing/types/filter/… $\endgroup$ – Ben Dec 26 '18 at 2:02
  • $\begingroup$ It would be a lot easier to understand if you shared an image of how it looks. $\endgroup$ – Martin Z Dec 26 '18 at 9:04
  • $\begingroup$ @Ben "I am not talking about a lens [flare], I am talking about a glare effect", but the linked manual entry says: The Glare node is used to add lens flares [...]. Isn't this contradictory? $\endgroup$ – Leander Dec 26 '18 at 18:06
  • $\begingroup$ I understand the confusion now, it is on what I was using the glare node for. I was using under the fog glow setting which has an effect similar to a bloom effect. $\endgroup$ – Ben Dec 26 '18 at 20:09
0
$\begingroup$

I'd add in the scene some dedicated render layer with all needed mask shapes (ObjID, MatID). They will be distorted on rendered image correctly. And on compositing I could isolate the masks with "ID Mask" node, and use them e.g. for glare.
Sadly, AFAIK, the compositor nodes are not distortion-aware yet.

$\endgroup$
0
$\begingroup$

In this case from my previous experience with dome projection in general (same principles), I found out that there is mainly one way to do it depending the effect you want to add.

So the best way to achieve this is to have one more render pass as a final rendering, Blender wise to render twice your scene and add all the effects on the final rendering.

What I mean by that, DoF, Fog and other depth/camera position related effects will be done in the same stage where you rendering your pano (equirectangular map) and the rest pixel effects (such as bloom/glare, noise or any other seamless - texture like - effect is better to be done in the final stage or even better in real time (maybe BGE can help you on that). By rendering the sphere from a fixed point pin-hole camera (common camera) and adding your extra effects (pixel shader effects) you will avoid completely mangling with borders and margins.

An other way to do so is to use fish eye camera and render your whole scene as a disc and then projected again it on an hemisphere (>360 degrees), it is not perfect but it will also do the job if you dont really care about 100% accuracy and having a perfect sphere and you wont have to split the rendering procedure in two stages to achieve this.

$\endgroup$
  • $\begingroup$ So are you saying that if you apply the effect to a fisheye projection that there is no distortion when viewed? $\endgroup$ – Ben Dec 27 '18 at 14:51
  • $\begingroup$ it will be projected on a sphere with the proper mapping, right ? if it doeas then it will be not distorted as well. $\endgroup$ – cnisidis Dec 28 '18 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.