1
$\begingroup$

I am making a bar music visualizer in cycles with a group of bars. When I render out a single frame, the visualizer appears blurry and distorted around the edges. This happens after compositing. I'm thinking it has something to do with the objects themselves.. Kindly advise me on this. (I have attached my blend file to this) Here is the blend file

This is the blurry rendered result This is the clear render preview.

I am trying to achieve the second one, however the background image in the render result is always blurry.

$\endgroup$
  • 2
    $\begingroup$ Your compositing nodes do apply both fog glow and fast gaussian blur to the bars, so why does it surprise you that they get blurry and distorted? Or to put it differently, what is it you're trying to achieve with the compositing nodes? $\endgroup$ – user27640 Jun 27 '17 at 15:18
  • $\begingroup$ I am trying to get a glowing effect to the visualizer, but I would prefer it to not render blurry. Any tips? $\endgroup$ – Amrit Gill Jun 27 '17 at 16:16
1
$\begingroup$

First of all, the ID Mask doesn't return a part of the image, but rather a greyscale value that is meant to be used to mask parts of the original image, e.g. by use of a Set Alpha node or an Alpha Over node. The following node setup is a template for adding glow and blur to parts of an image. It can be adapted to more specific needs, but in your case I think it'll work well as it is (click to enlarge).

enter image description here

The first Mix node mixes the original image with black, making it black where the mask is black and the original colour where the mask is white, and a blend of the two where, if at all, the mask has any shades of grey.

I changed the Glare node. I set the quality to High. Then I set the Mix to 1.000. This makes the node output the processed image only. 0.000 means a 50/50 mix between the original and the processed images, and -1.000 means original image only. By turning the Threshold down to 0.000 all pixels are affected. Higher values makes pixels with intensity below the threshold pass through unaffected. Note that the effect of the Glare node will be less visible if you render a larger image.

I also changed the Blur node. I set it to Gaussian rather than Fast Gaussian, and increased the amount slightly and turned the Size up to 1.000.

I also did turn down the emission strength in the material for the bars to 1.000. That, however, is just personal taste.

And this is the result I got (click to enlarge, the reason the background is pink, is that I don't have the image you used to texture it).

enter image description here

$\endgroup$
  • $\begingroup$ I copied exactly what you did and mine is still blurry. Also when I put the image layer into the mix it creates a glare that I don't want. I don't get how to unblur the edges of the visualizer. $\endgroup$ – Amrit Gill Jun 28 '17 at 11:31
  • $\begingroup$ @AmritGill The bars are a little blurry even before compositing. This is actually light bounces from the bars onto the plane, since the bars are emissive and the plane is diffuse. Could you try changing the shader of the plane to emission, using the image as texture and set the strength to exactly 1.000, then turn off the background light (set the colour to pitch black and/or the strength to 0). $\endgroup$ – user27640 Jun 28 '17 at 11:50
  • $\begingroup$ @AmritGill Another thing. The bars do have some depth, albeit a small one. That may add some blurriness around the edges, as your view does have perspective. Considering how small the depth is, it's hardly adding anything at all, apart from the blurriness. I'd use flat planes if I were you. $\endgroup$ – user27640 Jun 28 '17 at 18:32
0
$\begingroup$

Here's an alternative, that I did because of your comment to my other answer. Firstly disable background lights by setting the world colour to black, and set the background to transparent.
(Click on the images for larger view).

enter image description here

Secondly, unless you absolutely require the bars to be three dimensional, use planes instead of cubes. Use an emission shader. In this example, I have given it a strength of 1.000, and set the colour to all white, but that's a matter of personal preference. Whatever rocks your boat should be fine. Set the Pass Index to something other than 0.

enter image description here

Don't use a plane for the background image. Instead add that image in the compositor. Following is the compositing I did.

enter image description here

  1. The ID Mask node outputs a greyscale mask (set the Index value to the same as the Pass Index in the bars' material).
  2. The Mix node uses that mask to extract all pixels with the Index specified in the ID Mask node. All other pixels will be black.
  3. The Set Alpha node uses the ID mask as a transparency mask.
    The reason I do both 2. and 3., is that without 2., the entire image is processed by the following nodes, even the transparent parts, and without 3., the parts that should be transparent will be opaque.
  4. The Glare node set to Fog Glow and High quality. Threshold set to 1.000 means only the processed image is passed to the next node. 0.000 means a 50/50 mix of the source image and the processed image, and -1.000 means only the source image. Threshold of 0.000 means all pixels are affected. Higher values makes pixels with intensity below the threshold pass unaffected.
  5. The Blur node set to Gaussian. Amount is set to 16 pixels for both X and Y, and the Size is set to 1.000. Use Relative if you prefer, and play with the values until you're happy with the result.
  6. Add the processed image and the original image.
  7. Alpha Over the output from 6. on your background image. The Image node is available under Add -> Input -> Image or ShiftA -> I -> A.

This is the result (some of the bars go downwards, because I simply used Randomize Transform, and I didn't think it necessary fix the downward ones).

enter image description here

And the .blend for the above example (the background image I used is packed in the .blend, but the particles were not baked; the image above was rendered at frame 48).

I found the background image on Pixabay. I cropped it slightly, and here's a link to the original.

$\endgroup$
  • $\begingroup$ No problem. I had fun doing it. :) $\endgroup$ – user27640 Jun 28 '17 at 23:50
  • $\begingroup$ @AmritGill By the way, if this did solve the problem, consider marking it as accepted by clicking the check mark near the top on the left side, so that other people with the same or similar problems will know. $\endgroup$ – user27640 Jun 29 '17 at 0:31
  • $\begingroup$ Hey man sorry to bother you again but I had a quick question. I noticed when I viewed the scene in the 3-D view (rendered viewport), it was exactly what I wanted. However when I rendered the image it becomes blurry again. How can I get the rendered image to be an exact duplicate of the viewport preview? $\endgroup$ – Amrit Gill Jun 30 '17 at 0:09
  • $\begingroup$ @AmritGill The render preview and the final render are rendered differently, and the preview doesn't take compositing into account. Could you share both the final composited image and a screenshot of your render preview. If it helps, also draw some pointers (circles, arrows or whatever) on the images to show the problems. It's perfectly possible that either I've not fully understood the problem, or you've not fully understood the solution. Either edit your question to include the images or upload them to imgur and post links to them in a comment here. $\endgroup$ – user27640 Jun 30 '17 at 0:39
  • $\begingroup$ Hi Duane. Here is the render preview image imgur.com/a/nK36x Here is the rendered image imgur.com/a/qQvuu I think you will see the difference between the two images. I feel like what I am trying to achieve is quite simple. A clear visualizer with a background image. However, the rendered result is always showing up blurry for some reason. $\endgroup$ – Amrit Gill Jun 30 '17 at 2:22

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.