Search Unity

Camera Reticle receives Blur

Discussion in 'General Graphics' started by Dude_Mojo, Jul 14, 2016.

  1. Dude_Mojo

    Dude_Mojo

    Joined:
    Jul 14, 2016
    Posts:
    13
    Hey peeps im a unity noob with a simple problem. I followed a tutorial on how to make a simple reticle for your player character. But when I applied "Camera Motion Blur" to the camera for that snazzy effect it also causes the reticle in front of my camera to get blurry too. My reticle is on a quad that is floating in front of the camera so the blurring is to be expected. But being the unity noob that I am I don't know how to go about fixing this.


    Here is the code for my reticle:

    using UnityEngine;
    using System.Collections;

    public class Reticle : MonoBehaviour {
    public Camera CameraFacing;
    private Vector3 originalScale;

    // Use this for initialization
    void Start () {
    originalScale = transform.localScale;

    }

    // Update is called once per frame
    void Update () {
    RaycastHit hit;
    float distance;
    if (Physics.Raycast (new Ray (CameraFacing.transform.position,
    CameraFacing.transform.rotation * Vector3.forward),
    out hit)) {
    distance = hit.distance;
    } else {
    distance = CameraFacing.farClipPlane * 0.95f;
    }
    transform.position = CameraFacing.transform.position +
    CameraFacing.transform.rotation * Vector3.forward * distance;
    transform.LookAt (CameraFacing.transform.position);
    transform.Rotate (0.0f, 180.0f, 0.0f);
    transform.localScale = originalScale * distance;
    }
    }
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Anything that's in view from the camera will get the image effects on that camera applied to it. There are some ways to do this with opaque objects if you want to heavily modify the image effects, but it won't solve the issue of UI elements being blurred.

    The real solution is use two cameras with layers, one for the game view with image effects and the UI layer hidden, and a second with no image effects and only the UI layer enabled.
     
  3. Dude_Mojo

    Dude_Mojo

    Joined:
    Jul 14, 2016
    Posts:
    13
    ok thanks bgolus I will do