Search Unity

HELP! Realtime window reflections???

Discussion in 'Editor & General Support' started by garyhaus, Jan 9, 2007.

  1. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Can someone help me with getting some wondows in a building to reflect the surroundings? I looked at what someone had done with water. That was horizontal. Need to reflect in windows. I tried the multi cam approach but haven't got it working. Anyone if you could help that would be greatly appreciated. The glass windows do not need to be transparent!!!

    Thanks,

    G
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    How many windows do you have and do they need to reflect actual geometry, or "reflect something abstract" (in that case just use a cube map and one of reflective shaders)?
     
  3. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Many windows. Was trying to see if this would work to make it look very realistic. I guess I could try the Cubemap way but was hoping to see the cars, trees, etc. reflecting. Could you run through the basic process for doing both? Thanks for the help for this Noob!

    Cheers,

    G
     
  4. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
  5. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Aras,

    Thank you for your help! I am having some difficulty understanding how to use the shader. I copied the code into a new text file and saved it as MirrorReflection.shader. I am not sure where to place the shader in the assets folder. I have tried a few different places. It won't let me attach/use the shader as an option under the material. I am not sure what I am doing wrong. Any further help ould be greatly appreciated.

    Cheers,

    Gary
     
  6. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    I think it's easiest if you select Assets->Create->Shader in the Unity menu and the open the newly created shader file from the Project view, and then paste the code into it.
     
  7. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    Look at the error console you can get by using Windows->Console. Is there an error in your shader script perhaps?

    d.
     
  8. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    No errors with either the script or the shader. I created the shader by the method described by Freyr. That seems to work. Now all I see on the windowis flat black. I have the material assigned to the window(and the script to the geometry). Thanks for the help so far everyone!!!

    Cheers,

    G
     
  9. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Try hitting Play button? The reflections don't show up until you're in the game mode.
     
  10. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Tried that, and did a build game to see if that would solve the problem. Rebooting now. Deleted old material and recreated it with the same issue of showing up flat black when played...
     
  11. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Got the material to work on one window. It seems to be reflecting the sky box and nothing else. the reflection is also upside down!!! Thanks for any further help.

    Gary
     
  12. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Can you send the Unity project you have via Report Bug.app? Maybe you're setting up something wrong, or maybe I did not explain it correctly on the wiki page...
     
  13. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Not sure how to do that... Sorry Aras. I will definitely send it to you once I know how

    :(


    Gary
     
  14. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Ok figured out how to submit the bug. I have done so. Thanks for all your help.

    Cheers,

    Gary Haus
     
  15. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I put an example package up on the page on the wiki.

    Cheers,
    -Jon
     
  16. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Ok downloading example now. Waiting for the bug report to finish submitting to test the package. Thanks so much everyone for the help so far.

    Cheers,

    G
     
  17. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Ok I submitted my project via the bug report system. Let me know if I can be of any further help to hopefully fix my issues.

    Cheers,

    G
     
  18. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Ok I have impported the package example and it works great! When I apply the material and script to my geometry it has the same effect as before. Upside down skybox with black at top and no reflecting geometry.... I am stumped. I hope you guys can figure it out over there at OTEE!!!

    Cheers,

    Gary
     
  19. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    I replied to your bug report