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

Problem with Texture baking Vray

Discussion in 'Formats & External Tools' started by vahi2008, Sep 8, 2011.

  1. vahi2008

    vahi2008

    Joined:
    Oct 1, 2010
    Posts:
    321
    I am having a problem while baking textures with Vray... I have done unwrapping using Flatiron. When I render my scene using Vray renderer in 3DS Max my result is very good. But when I bake textures using Vraycomplete render map from render to texture option in 3Dsmax my result is blocky... It has patches of shadows and so much noise on the baked textures. Can anyone help me on that? What settings should I keep for Vray renderer for texture baking.....

    i have attached both results of my rendering and baked result.

    Baked result
    http://www.image-share.com/ijpg-910-132.html


    Rendered result
    http://www.image-share.com/ijpg-910-133.html
     
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    How high is the resolution on your baked texture? It needs to be quite high, also use vraytotalrawlightingmap and use it as a lightmap in Unity rather than baking the diffuse vraycompletemap, you can get away with lower resolutions as the map is blended with the diffuse textures (which can be tiled and sharp) colour of your 3D objects, if you dont need your GI and shadows to be super sharp then its probably best to do it this way

    Also the quality of your indirect illumination becomes very important so make your first bounces (usually an irradiance map) high quality and use a brute force method rather than light cache for secondary bounces.

    Also flatiron's initially convenient but starts becoming a pain in the butt cause as far as I could tell it doesnt save your render to texture options, i just use max's own unwrap uvw modifier for unwrapping and max's own render to texture dialogue
     
    Last edited: Sep 8, 2011
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    First of all, are you trying to bake *everything*?

    If you are, what shader are you using in the unity scene? If you want to bake everything and not use any lighting at all, you should use a self illuminated shader.

    What file format are you using for the exported map? Tonemapping? Vray has its own camera that does some post processing and tonemapping to the image, which I don't think is being used by the texture baker (not sure though, haven't used max or vray in quite a while).

    Also, the reflective materials are obviously not going to be baked properly. Only the diffuse aspect of each material is going to be baked.

    As for the result being noisy, it could be a number of things... You probably need a bit better settings for Vray (which I really can't help there, it's also not really unity related). But you can try setting your maps to truecolor and see if that helps.
     
  4. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    On these points, the first relates to vray's use of linear colour space, or a gamma setting of 1.0, whereas we're generally used to using a gamma setting of 2.2-2.5 which is a monitor's gamma. It doesnt look like he's having any problems with gamma however, incorrect gamma generally results in overbright images with very little contrast or on the other end, really oversaturated overcontrasty images because you're trying to overcome a gamma setting that is too dark

    Generally using the vray framebuffer and having your gamma setting to 2.2 in max and 2.2 in your colour mapping in vray settings should give you a correct visual feedback and results

    On the second, truecolour wont really help for this although i've found 16bit lightmaps seem sorta dull and lacking range, so i'd suggest 32bit targas as at least in the EXRs produced by max they're a right pain to work with (For me at least). I had a think and I think the noisiness is probably much to do with the shadow quality of the lights, if youre using vray lights you probably want to bump the shadow subdivisions much much higher, I think the global subdivision multiplier in the vray settings affects this too

    The default subdivs for a vray light is 8, I think, and I usually have mine at around 48 or 64 or even higher in a baked scene as the noise really shows when the texture is being wrapped round a whole scene
     
    Last edited: Sep 8, 2011
  5. Pixelstudio_nl

    Pixelstudio_nl

    Joined:
    Jun 22, 2009
    Posts:
    179
    what size of maps are you using ?
     
  6. makan

    makan

    Joined:
    Jan 8, 2011
    Posts:
    342
    I think you should bake the diffuse and normal and spec separately rather than using complete map, and i think you should write a shader on unity with shaderlab for using all of them...
     
  7. Ingsoc75

    Ingsoc75

    Joined:
    Apr 14, 2011
    Posts:
    13
    Yeah having the same issue baking out of Max but I'm using Mental Ray (2012). I've baked out lightmaps in Max at very high resolutions but it just does not look good in Unity (that is when I use a legacy lightmap diffuse shader and put my baked lighmap in the lightmap slot).
     
  8. KC1302

    KC1302

    Joined:
    Jan 11, 2014
    Posts:
    94
    The iso, framebuffer settings on the Vray psysical camera don't seem to translate to the final baked textures. Can anyone confirm that?
     
  9. pepperj

    pepperj

    Joined:
    Jul 15, 2013
    Posts:
    1
    Yeah, I could be wrong, but I believe it is wise to just not use the vray physical camera when baking. I don't think the settings translate. Also, to join in on the original post, a problem could be with flat iron and the gamma control. The flat iron people recommend turning it off.
     
  10. bcoyle

    bcoyle

    Joined:
    May 22, 2013
    Posts:
    57
    confirmed. the way around this is:

    Rendering / Exposure Control...

    set exposure control to 'VRay Exposure Control' - there's a mode that lets you pick a camera in the scene to match settings from. That ought to set you up for baking.