Home Technical Talk

Vray + UDK= Archviz

polycounter lvl 12
Offline / Send Message
HAWK12HT polycounter lvl 12
Any one know how to get Vray lightmass data into UDK for Realtime walkthrough without wasting millions of hours in rendering. :D

I know you can bake stuff in Vray onto the textures, but what about dynamic shadows and water, glass etc.

Replies

  • SPYFF
    Offline / Send Message
    SPYFF polycounter lvl 10
    Nice, my question is same! But for Ogre3d but i think the method is similar.
  • percydaman
    I don't think UDK allows for replacement of Lightmaps created from an external package.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Maybe you can bake out lightmaps, and you can overlay it onto your texture in the materials, but this needs a lot of baking with a big environment. A year ago I tried to bake lightmaps with Vray, but unfortunately it was not successful. So if anyone know how to do it, plz tell me :)
  • blankslatejoe
    Offline / Send Message
    blankslatejoe polycounter lvl 18
    Well, you COULD do this in older UE3 builds for certain...but you needed source access--this is how Beast got its lightmaps into UE3 for its integration, for example--it literally hijacked the lightmapping process and imported its own stuff in place of UE3's stuff.

    You *might* be able to manually import in some lightmaps if you have access to the old "generic browser" tab (check the various menus? If it's there, then look for a upk with the same name as the map) That would let you see the "package contents" of the actual level you had open--lightmaps and such. You could, in theory, re-import a new lightmap with the same autogenerated name as one that existed to do what you want. But it would be a massive headache to do manually.


    More problematic is that I seem to recall UDK actually mixing lightmaps together for a lot of things to save space--having fewer larger sheets. That would make doing a manual reimport process impossible...maybe those lightmap atlases were only for BSP and terrain though...I can't recall.
  • blankslatejoe
    Offline / Send Message
    blankslatejoe polycounter lvl 18
    Anyway, all that is a longwinded way of saying you're probably going to get a big headache from trying this, and then probably still give up from frustration.


    But goodluck!!
  • illo
    we do it at work, build the scene in max, texture, bake lighting/spec on top of the diffuse, import into udk. doesnt work for games worth shit, but if its just a camera and everything is static it works pretty well.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    ok folks this is what i have for you all (in theory) as I cant try on my laptop :D, well since Vray now have realtime rendering feature but still it takes ages for final render it came in my head that before all that RT stuff in Vray the other way around was to not render the actual scene but rotate camera at certain angles ( take 360 panorama of room) using only iradiance map calculations on half quality for fast calculations and save it on iradiance map file of vray. Well how about just bake that light information only on grey texture (light grey as light mass in UDK affects lighting depending on diffuse color of objects) and mix merge blend this diffuse texture with the actual textures of your objects and than bake generic light (UDK) in center of your room to see what happens :). I have a feeling it will work, but than u have to be make solid shaders for frosted glass and real water though in UDK plus artificial reflections.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    It should working with simple Vray lightmap bakes ;) I made a fading ao feature based on the lights in UDK (with custom lighting), so I can say, its easy to mix precomputed and real time lighting.For the shadows, you can use that I made with the fading ao, and for the color bleeding, you can use the opposite, or something like that. What you say about the frosted glass, I also made it :D Not perfect yet, but not that bad.
    glass:
    http://media.cmcdn.net/20477803/780x541.jpeg
    with various values:
    http://media.cmcdn.net/20477799/780x540.jpeg
    the fading ao:
    http://media.cmcdn.net/20478946/780x661.jpeg
    http://imageshack.us/a/img213/6812/fadingao.jpg

    Cubemaps are still the best/cheapest solution for reflections, but scenecapture is also not bad.
  • jesaro
    Offline / Send Message
    jesaro polycounter lvl 6
    Obscura wrote: »
    It should working with simple Vray lightmap bakes ;) I made a fading ao feature based on the lights in UDK (with custom lighting), so I can say, its easy to mix precomputed and real time lighting.For the shadows, you can use that I made with the fading ao, and for the color bleeding, you can use the opposite, or something like that. What you say about the frosted glass, I also made it :D Not perfect yet, but not that bad.
    glass:
    http://media.cmcdn.net/20477803/780x541.jpeg
    with various values:
    http://media.cmcdn.net/20477799/780x540.jpeg
    the fading ao:
    http://media.cmcdn.net/20478946/780x661.jpeg

    http://imageshack.us/a/img213/6812/fadingao.jpg

    Cubemaps are still the best/cheapest solution for reflections, but scenecapture is also not bad.



    you can explain a little more about the glass, is a blur through the object in realtime?????
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Yep, since everything is in udk, everything is happening in real time. Its working the scenetexture and with with 4 samples for the blur atm . If you are interested about the shader network, pm me. Im planning to make the 8 or 16 samples version. Maybe with option to choose the sample value in the instance.

    Anyway. I was thinking about these things, and I was lead up to maybe the best solution for this vray shadow thing. The idea is very similar to how the ibl is working. You need a "lightingmap" cubemap ( a very blurred, colored shadowmap(containing the colors that are caused by the color bleeding))that you render out with vray and you need to use this for the diffuse ibl.Then you need an another baked map, which is the shadowmap (black/white unblurred shadowmap), and you multiply this with the diffuse ibl, plus with an ao map. I recommend to keep these maps separately, because then you can use them as static and dynamic in the same time.I mean imagine that, the environment is static, so nothing is moving, but your character have a flashlight or weapon that is flashing when you are firing.So.When these lights are doing lighting things near to an environment piece, you need to hide the pre made shadows.If the maps are separated,then you can control them separately and you can make them fading (visible when they are not affected by any dynamic lightsource, and invisible when a light hit the surface) .For the specular, you use reflections (like in vray and like in the real life). This can be static (pre-made cubemaps) or dynamic (scenecapture actors), and the glossiness is the blur of the reflection.This can be pre-made (pre blurred cubemap) or real time (blurring the cubemap in real time).This is when you use pre-made cubemaps. And if you use scenecaptures, then you can blur it only in real time. So. After all of that, you have Vray GI/Color Bleeding,Vray shadows,ao and a very similar shader to Vray.

    Everything from these things could work very nicely if we could render out proper maps from vray.I'll try to play with baking with Vray.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Hmm...Watch this. If we want to use it with things like day-night cycle, then we could render out shadowmap samples for the bright hours (i think 8-16 samples would be enough) and we could use flipbook textures for the shadowmaps and ambient cube slots.Same amount of textures, still looks the same and now its working with a moving lightsource (its moving in your modeling program, but you dont need any real lighting in the game engine).
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I did a few tests with baking with Vray, and I can say its good to bake out relatively useful maps.Here are the first results.This is how it looks in real time in 3dsmax (merged layers, standard material)

    d0jz.jpg

    And here is how it looks in UDK with a controllable material for it.

    q2gf.jpg

    It needs more work, and probably better bakes, but it could looks almost the same in UDK as it looks on the Vray renders.We just need a shader for it and better bakes.
Sign In or Register to comment.