Search Unity

Cube Map from Render Texture

Discussion in 'Shaders' started by Jonathan Czeck, Nov 17, 2005.

  1. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I am toying with the idea of a real time reflection on my main character while it is in one of its special golden modes. I would like to use something like the normal Diffuse Reflection shader, except give it a new cube map each frame. I currently just have a canned cube map which is basically some gold Cloud filter and noise and levels. Perhaps this would have to be combined with the real time reflection to give a sense of "gold" material.

    Can anyone offer some direction?

    Thanks,
    -Jon
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    At the moment, Unity does not support render-to-cubmap...

    What I've seen a number of games do is one of the following:

    * use a 2D texture with a very wide field of view rendered somewhere between the object that should have the reflections and the main camera. This can also be varied (= if the game is mainly top-down, render with a camera above the scene)

    * Grab a portion of the screen somewhere the main object is not. Burnout3 uses this to great effect to do reflections for the player car.

    You could also implement dual-paraboloid reflection mapping - that is essentially 2 2D textures getting the full 360 deg FOV using some funky projection matrix math (IIRC).

    In either case, You then use a vertex program to calculate some texture coordinates that look 'good enough'.

    Which game is this for?