Home Technical Talk

baking an accurate sphere map?

mod
Offline / Send Message
rooster mod
we're trying to use a sphere map to create a water reflection effect from a fixed camera

the camera in the scene is at a bit of an angle to the water and surroundings

what we're wondering is how we create the sphere map to accurately reflect the envoronment.. we've only ever used sphere map reflections to create a generic 'shinyness' and never to accurately reflect something, so we're at a bit of a loss how to match the reflection and generate the map itself

any ideas?

cheers!
rich

Replies

  • Mark Dygert
    Options
    Offline / Send Message
    Which app?

    I'm not familiar with sphere maps do you mean cube maps? Both max and maya have ways of rendering cube maps from a scene. I'm not sure how Maya does it, some Maya Guru can probably chime in on that but heres how to do it in max.

    Taken from the Polycount Wiki: http://wiki.polycount.com/Cube%20Map
    How to create a cubemap by rendering a 3ds Max scene:
    1. Setup a scene you wish to render into a cubemap.
    2. Place some type of object at the viewpoint you wish to render the cubemap from, for example a camera or a point helper or a geometric object. The object itself won't be rendered into the cubemap.
    3. Configure your rendering options.
    4. Load a Reflect/Refract map in any material.
    5. In the map, set Source = From File.
    6. Set the Size spinner to the resolution you want to render. If you're going to use the cubemap for a game it should be a powers-of-two number.
    7. Use the Render Cubic Map Files / To File: button to set the prefix name and bitmap format to render to.
    8. Press Pick Object and Render Maps to select the viewpoint object. The render cannot be cancelled once the object is picked, so save your Max file before rendering, in case Max freezes!
    9. The six bitmaps will automatically be loaded into the Reflect/Refect map, or you can convert them into a DDS cubemap with Dxtex or another tool.
    3ds Max can also display cubemaps in the viewport if you use the DDS cubemap format, and you use a DirectX shader.
  • rooster
    Options
    Offline / Send Message
    rooster mod
    cheers man,

    spherical environment maps are something else, simpler than cube maps- they are only accurate from one camera perspective (think lit sphere maps in mudbox, pretty similar) they look basically like if you put a shiny ball into the environment and took a picture of it

    I'm in maya 2008, i figured whatever technique i'd need would be universal but maybe not..

    I'm not even sure it's possible to use them accurately on a more or less flat plane, if anyone knows..
  • Whargoul
    Options
    Offline / Send Message
    Whargoul polycounter lvl 18
    Put a %100 reflective black sphere in the scene and frame it with a really long lens and render it. It's pretty close to baking one out :)
  • rooster
    Options
    Offline / Send Message
    rooster mod
    I'll give that a go, ta! what I don't get is how itll work on a plane tho..
    It simulates perfectly a sphere, right? and the further you get from a sphere the less accurate the reflection gets, so a plane is probably fubard?
  • Eric Chadwick
    Options
    Offline / Send Message
    Whargoul's way is good.

    SEM on the wiki

    Plane will work OK as long as it's bump-mapped. Without a bump, it'll probably just reflect a single pixel from the spheremap. You could also bend the plane's vertex normals outward, so it reflects more of the spheremap.
  • Eric Chadwick
    Options
    Offline / Send Message
    Oh, and you can also convert a cubemap into a spheremap really easily. HDRShop has an easily method for this. Depends on what capture methods you have in your game.
  • THE 5
    Options
    Offline / Send Message
    THE 5 polycounter lvl 14
    Does your maya have the Mentalray "Lume" shaders?
    There is one Lens shader in Max called "Wrap Around (Lume)", it creates a spherical map, where the center of the sphere is the position of your scene camera. Nice thing to save these as HDRI ;)
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    You could also use Max's panorama renderer. Its hidden under the utilities menu. It'll create all the renders and stictch them for you.

    I've used it a few times to bake lightprobes out of scenes,pretty handy if you want to do a matte render.
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    Since you are trying to make reflections on a flat water plane ... you might want to look 'up' when rendering the reflective sphere, and have your final render/realtime engine tilt the SEM 90 degrees compared to the default behavior. Because, if theres is say, a sun in the background of the scene supposed to reflected on the surface of the water, it would never be captured by a chrome sphere shot from the camera...

    Not sure if it makes sense but I hope it helped!
Sign In or Register to comment.