Home Technical Talk

3ds Max, V-Ray, rendering cubemap = seams?

I'm seeing seams in the lighting when I try to render cube maps in V-Ray. The cubes are for architectural vis for a client.

Does anyone know of a better workflow for this?

I've animated a camera to point in the six cube directions, and then render six frames. But I get this, as shown in Cubemapgen, with a stripped-down test scene:

oXSrbsF.jpg
r5Xubcd.jpg

I solved it (kind of) by doing a pre-calculation pass with a camera animated to rotate 360, pointing 45 degrees downwards, then again straight out, then again 45 upwards. Then I use that cache to render the six views. But this workflow is a pain to do, seems like there must be a better way?

BTW I'm using 3ds Max 2012 and V-Ray 2.4, since my client requires these older versions to work with their setup. Maybe the latest V-Ray has a new tool for this?

I couldn't find any answers in extensive searching. :( Also going to ask on the V-Ray official forum, but thought I'd ping the Polycount hivemind as well.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Dunno if it will solve the problem or not, but I bake cubemaps very differently. I place a box to a place that I want (can help with parallax corrected cubemaps), flip the faces, uv the box in any way, and for baking, I set the cage to be inside the box. It will look outwards from the cube, so the cubemap will be captured. It worked so-so for me, its not the best way with parallax corrected cubes, but I never got seams.

    I did this with mental ray and scanline by the way, but it should work with v-ray too. I also used cubemap gen for filtering by the way.
  • Eric Chadwick
    Options
    Offline / Send Message
    Update on this problem.

    Obscura thanks for the idea, but doesn't work in my case. The GI is being calculated independently for each face, which creates seams along the edges. Also, since I need to output six separate bitmaps, baking won't work because it makes 1 image.

    What I've tried so far:

    1. Rendering from six cameras. Nope, GI seams.
    2. Rendering from a Reflect/Refract map. Nope, GI seams.
    3. Rendering from a V-Ray camera set to Box. GI seams are solved, but outputs a vertical cube cross.

    How to convert a cubecross into six images?

    3a. Flexify 2 crashes Photoshop when I try to export the faces.
    3b. Cubemapgen adds 1-pixel seams when I convert to faces. I can't use edge fixup because I need perfect edges, this adds a blurry edge.
    3c. Lys can only export a cubecross layout.
    3d. 3ds Max can convert any pano into cube faces (using Reflect/Refract map) but it adds seams when mapping a cube cross onto a cube (can't set UVs to Clamp!).
    3e. ImageMagick (I am messing with this now)

    I need an automated solution, because I'm making a bunch of cubemaps.

    Anyone have any ideas?
  • Eric Chadwick
    Options
    Offline / Send Message
    OK, I tried rendering a Spherical camera in V-Ray, which creates a nice seamless equirectangular pano.

    But I have to convert it into six faces. Which exposes how crappy the poles really are.

    So, I'm still searching for a way to convert the cubecross into cube faces. :( I know I can use Photoshop, but that's basically a one-off solution, not batch-able. Hmm, maybe I can make an Action.

    d0DFwEl.jpg
  • EarthQuake
    Options
    Offline / Send Message
    Maybe https://www.knaldtech.com/lys/ can help here? It can take the pano and convert it to a variety of formats, and even do mip blurring etc.
  • Eric Chadwick
    Options
    Offline / Send Message
    Nope unfortunately, only exports cubecross, not cube faces. Andy said he'd add it to the wishlist.
  • EarthQuake
    Options
    Offline / Send Message
    Ahh I see, must have misread, thought you wanted to go the other way. It should be simple enough to record an action in photoshop that does this though.
  • Eric Chadwick
    Options
    Offline / Send Message
    Thanks man. I just figured out a very clean method, right in 3ds Max.

    Loaded the cubecross in the Material Editor and animated the UV offsets, then right-clicked to Render, frames 0-5. It makes a perfect seamless set of cube faces, yay! And it's easy to re-use with any other cubecross, at any resolution, just load another bitmap and Render.

    I wonder if the Photoshop Action would've had to be resolution-dependent? Crop 1024 pixels here, crop another 1024 there, that kind of thing? Oh well, something to test some other weekend.

    Also tried the cubemapshuffler from Nvidia. Which is ancient, and broken.

    Thanks again.
  • EarthQuake
    Options
    Offline / Send Message
    Yeah the PS thing would probably need actions for different resolutions.
  • kio
    Options
    Offline / Send Message
    kio polycounter lvl 16
    if you drop me an example image i could give you a little ps script - its working already - but i would like to verfiy it with some real data first ;)

    on a sidenote I stumpled over this interessting thingie: https://github.com/dariomanesku/cmft
  • Eric Chadwick
    Options
    Offline / Send Message
    Great! Here are two sizes for you.

    I'm not sure which way the script should name the output, whether 3ds Max style (_BK, _DN, _FR, _LF, _RT, _UP) or DirectX style (_Xpos, _Xneg, _Ypos, _Yneg, _Zpos, _Zneg) or Cubemapgen style (_c00, _c01, etc.).

    buCYwji.jpg
    Xe7gqoq.png
  • abcdethan
    Options
    Offline / Send Message
    abcdethan polycounter lvl 4
    I have been using flexify2 to generate cubemap faces from a latlong image. It works 90% of the time. At some point it does crash after several versions of updated the psb file (yes it is that large). I'm not sure how it decides to eventually crash photoshop.

    So I am also looking for a good cubemap generator. It msut be able to export 32 bit exrs.
  • kio
    Options
    Offline / Send Message
    kio polycounter lvl 16
    okay you can try this one here:
    https://gist.github.com/BenjaminSauder/d739e4566d6ca9a9f3c7

    it might be a bit rough around the edges - the horizontal layout will probably be wrong as i didnt spend the time to get the correct mapping and rotations..

    Open a file in ps, run the script, it outputs the images next to the file with a suffix (_up, _down, _front, _back, _left, _right)

    just give me some feedback as it probably will be quite easy and quick to fix.
  • Eric Chadwick
    Options
    Offline / Send Message
    abcdethan wrote: »
    I have been using flexify2 to generate cubemap faces from a latlong image. It works 90% of the time. At some point it does crash after several versions of updated the psb file (yes it is that large). I'm not sure how it decides to eventually crash photoshop.

    You should report it as a bug to Flaming Pear. I let him know yesterday that it was crashing in CC 2015, and he said he would get right on it. Very prompt response.

    I tried converting latlong V-Ray renders into cube faces, but always got stretchy poles. I didn't notice them if the sky was blue and the ground was a plain color. But if there was any texture there, the cubemap up/down faces would be pinched and ugly in their centers.
  • Eric Chadwick
    Options
    Offline / Send Message
    kio, this works great! No seams in the output.

    Only mistake is left and right are swapped somehow.

    It would be nice if the names were to the 3ds Max standard, because Max will auto-load all six if you feed it the _UP first, but it won't auto-load them with your naming convention (have to load each one individually).
  • kio
    Options
    Offline / Send Message
    kio polycounter lvl 16
    ah okay - ive updated the script:
    https://gist.github.com/BenjaminSauder/d739e4566d6ca9a9f3c7

    you can now easily change the naming at the top of the script. and I corrected left/right sides ;)

    sadly i found no way to supress the saveoptions dialog for exr :(
Sign In or Register to comment.