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
http://udn.epicgames.com/Three/RenderToTexture.html#Saving%20static%20captures
Cubemapgen is great for blurring cubes. I put a tutorial here.
http://wiki.polycount.com/DiffuselyConvolvedCubeMap#AMD_Cubemapgen
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.
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.
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.
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?
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.