Creating light-cookie-cubemap for pointlight..

Hi, as i need to use a lightcookie on my pointlight, i have to generate a cubemap for it (for spot- and directional-lightcookies you can use a 2D-AlphaTexture). I duplicated the "square"-Texture from the "standard assets folder" and changed on its importsettings every property (tested spheremap, cylindrical, simplespheremap and nicespheremap) but nothing worked well. I want to create a pointlight with a lightcookie to simulate a "oil-light or paraffin-lamp" with a kind of fence-texture for 360 degrees.

Does somebody know how to do that?

thanks, yosh

Yes, its simple if you know 3D Studio Max or other kind of 3D IDE.

  • You need an object like an oil-lamp.
  • Place it in the center of the 3D Studio scene.
  • Put a point light in the center of this scene and make sure this light is in the center of the oil-lamp mesh too.
  • Put a Cube that cage all the geometry of the oil-lamp in the center of the scene too.
  • Convert this box to Edit Poly and invert the faces, so every face will face inside the cube.
  • For every face of the cube, you need to detach it from the box object, so every face will become independet.
  • Assign a white material to every face.
  • Render to texture the lightmap information of every face. You will have 6 textures, one for every direction.
  • Import to unity and make a cubetexture with this 6 textures.

TIP: Unreal Engine 3 uses 2 cubetextures for every light cookie, one normal and other blurred, then, it interpolates the color of these two cubetextures between distance, and you will have a very nice softshadow, it will be a fake, but its very nice :)