Home Unreal Engine

Ambient cube maps UDK

Gestalt
polycounter lvl 11
Offline / Send Message
Gestalt polycounter lvl 11
I'm setting up a customlighting material and I would like to use an ambient cube map for the diffuse lighting. Does anyone know if there is a way to export a cube map from UDK into something like xNormal for generating the ambient map? If there's a way to make the map in UDK with decent results that would be helpful to know as well.

Replies

  • Eric Chadwick
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    Thank you so much for the response. I have the map as a texture in a package, but do you know how I could export it out of UDK (maybe a dumb question)? Also the Cubemapgen info you linked looks great and very helpful, so thanks for that!
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Is there a reason you need to get it out of UDK? is it primarily just to blur the values?

    And yes you can export the cube maps, or rather, their constituent sides. Just find the source textures that make up the cubemap, then export those as normal.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I'd like to export it so that I can blur the maps while having control and not having seams.
    I'm not sure if UDK has a feature for bluring cube maps (with decent control) or not.
    As far as export, I originally tried to export the cube map texture itself but it seems there isn't an export option for it (there was an error). I'll try just exporting the images and see how that goes.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    You can drop LOD values, but as far shader side goes for simplicity, nope.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Gestalt: It doesn't really have one built in... sigh one more thing I need to finish. I have a cubemap blurring routine that can be controlled per pixel even, I need to get back to finalizing it.

    And no you can't export a cubemap as the actual cubemap is a sort of virtual construct.

    anyway, for the lighting term, just be sure to use the normals to project into the cube rather than a reflection vector, though you likely know that bit.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    anyway, for the lighting term, just be sure to use the normals to project into the cube rather than a reflection vector, though you likely know that bit.

    Actually I'm pretty new to a lot of things. Right now I have a reflection vector going into a vector transform which is going into the blurred cube map to be multiplied with the diffuse texture. Could you explain what you mean about using the normals there?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Sure. The reflection vector is based on the camera vector reflected around the normal. Which is what you want for reflections. You want to know what color is out in the world at the equal, and opposite, angle to your view of a surface.

    For lighting you want to feed your surface normal into the vector transform, so that you get what the surface sees in the world rather than what the camera does.

    Think of putting a camera on a turntable around a static rubber ball which has a single light pointed at it. As the camera moves the brightness of the ball will stay towards the light.

    Now picture the same setup but with a mirrored ball. The light will show up from multiple angles and move along the surface of the ball in relation to how the camera is placed.

    For diffuse lighting based on a cubemap, you want the former rather than the latter.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    That makes sense that the diffuse wouldn't shift around with the camera. Thanks!
  • R.White
    Options
    Offline / Send Message
    An easy way to get blurred cubemaps in the UDK is to apply a post process chain to the cubemap capture actor. Then you can adjust the depth of field values until you get the cubemap as blurry as you want.
Sign In or Register to comment.