Search Unity

A question about combining the cameras

Discussion in 'Editor & General Support' started by ksam2, Jul 21, 2014.

  1. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Hi there guys, I have one more questions and will be very thankful if you help me with it

    I combined two camera with each other (one camera rendering the rome environment and other onerendering my character)
    But there is a problem!!! The cameras effects (Image effects) of both camera will combined too!

    My both cameras has it own effects and I don't want combining those with each other.

    Please help if you can. Thanks
     
  2. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Up
    Please help, I need it
     
  3. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    What you really mean? 1.disable all effects. 2. keep only one 3. or maybe keep blend them in different way. this obvious that all effects is blend with each other. this because camera apply post effect to the render target, but not to the objects that they actually render. So if you draw first camera to the frame buffer second camera will overlay its post effect over whole image. So if you explain what you really want may be we can help you
     
    ksam2 likes this.
  4. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Thanks for reply. I've created an outdoor place with some image effects that looks very good but for some reason my character's skin doesn't looks good in this place! So because of that I need to create a second camera for my character with different Image effects!!
    So now when I combining my two cameras (One for rendering my outdoor place and one for rendering my character) everything will be ruin because image effects of two cameras will combining too.

    Is there any way for passing that problem?
    Thanks
     
  5. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Thanks for reply. I've created an outdoor place with some image effects that looks very good but for some reason my character's skin doesn't looks good in this place! So because of that I need to create a second camera for my character with different Image effects!!
    So now when I combining my two cameras (One for rendering my outdoor place and one for rendering my character) everything will be ruin because image effects of two cameras will combining too.

    Is there any way for passing that problem?
    Thanks
     
  6. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Now i see 1 way:
    1. Render outdoor camera to texture RT1
    2. Render character camera to texture RT2
    3. Blend them together
     
    ksam2 likes this.
  7. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Thanks again but I really don't understand what's your mean by "render outdoor and character camera to texture RT1 and RT2" and blend them together
    Sorry but could you tell me just a little more about that?
    Thanks
     
  8. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    RT - RenderTexture.
    Create 2 render textures and assign them to each camera. To the second camera set clear color to (0.5,0.5,0.5,0).
    After second camera renders you will have two textures that will contains your outdoor and character separately. So you can write shader that will have 2 texture properties blend this textures together as you like and draw full screen quad with that shader or you can draw it with OnGUI() {GUI.DrawTexture() or Graphics.DrawTexture()} .