Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Interior mapping a circular room?

Discussion in 'General Graphics' started by ridethefader, Sep 25, 2020.

  1. ridethefader

    ridethefader

    Joined:
    Jun 17, 2019
    Posts:
    44
    I set up material interior mapping with cubemaps (like Spiderman does it) and it looks great with any square room I use. Now I need to set up some interior mapping with cylindrical rooms and Im not sure how to do this. Is there a way to bake a reflection probe in a cylindrical way? If I bake the cylindrical room and apply this cubemap, its all distorted, which is expected. Im just not sure the best way to go about this using any room that isnt square.

    thanks
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    There are different ways to go about interior mapping, but the most common approach is to assume a box shaped room of some kind. Some even always assume a perfect cube, though there isn't actually a need to limit it to that, it makes things easier.

    Part of why the cube is because it maps well to the fact they're usually cube mapped based, but more importantly because cubes are very cheap to raytrace & get the traced UV for, which is actually what interior mapping is doing.

    If you want a cylindrical room, you just need to trace the inside of a cylinder instead of a cube. The cube map lookup UV is then the vector from that position of the cylinder interior to the center of the cube map relatively to where the original cylindrical room was captured and assuming the same height : radius aspect for the captured room and the raytraced shape.
     
  3. ridethefader

    ridethefader

    Joined:
    Jun 17, 2019
    Posts:
    44
    Thanks! Ill try this out.