July 30, 2010

Maya - Create a Cubemap

This is inspired from my participation on a recent Polycount thread.

Its pretty straight forward to make your own cubemaps from Maya, you just need 6 cameras rotated around a shared point. The cameras each render out a square image representing one of each side of the cube. You can easily stitch these images together using an interactive program like ATI's CubeMapGen for realtime use, or build out a cube-cross in Photoshop. You just have to take care as to the placement and rotation of the images in the stitch.

There is one trick to this in Maya; although its pretty intuitive to set the Angle of View of the cameras to 90 degrees, you also have to set the Camera Aperture x and y to 1.0.

You are not restricted to staying in the cubemap format either, just run the result through HDRShop and you can convert to a variety of other formats like latlong and angular probe.

Here is a test image from CubeMapGen showing that the cubemap is seamless (some minor blurring in the reflection of the sphere is actually due to the realtime shader in the viewport and not sampling issues in the textures).


Download Test Scene (Z axis are inverted compared to Maya because thats what CubeMapGen expects)

July 8, 2010

lcNextGenShader_1.4.5.fx – Maya HLSL realtime shader

Note: Even with this update I still recommend my lcUberShader.cgfx over this; cgfx seems a bit more stable than hlsl in the Maya viewport and cgfx shaders can be rendered through the hardware render buffer too!

I noticed that the old lcNextGenShader_1.2.fx was getting alot of hits even with updated versions and the better cgfx shader available. So i decided to update it and make it easier to maintain.

Pretty much I took the code from my lcUberShader_1.4.cgfx and transplanted it into an HLSL shader. Its missing some things from the cgfx version, lit-sphere shading, toon-ramp shading and the skin shader are removed. They where not working and I don’t think its currently worth the effort to get them working. Everything else is identical to the cgfx version and is a robust general use shader. This OLD post gives some example images from the cgfx version - blog.leocov.com/2010/03/lcubershader12cgfx.html

I’m currently investigating cross compatibility with 3dsMax – so stay tuned Max users.


July 4, 2010

lcUberShader_1.4.cgfx – maya realtime shader



Gloss Blurring Amount: – this attribute controls the blurring on the cube map reflections – previously it was default = 1.0, now it is default = 0.0. At 0.0 there is no blurring on the cubemap, even with a specular.a gloss map, but the added benefit is that if you don't have a specular.a gloss map you can still blur your cubemap, whereas before it was not possible.

Shadow Map Texture: - this is for a baked shadow map, and can use its own UV set, by default its the same UV set but you can change this under the shaders ‘Vertex Data’ rollout. Just set TexCoord2 to use something different. This is helpful because you can bake the shadows on a texture sheet that combines all your objects into one UV layout. This avoids the labor of multiple bakes.


Maya 2011: – added an empty dummy technique to the end of the techniques list, this is a temporary hacky fix for a problem in Maya 2011 where the radio buttons don’t work properly for technique selection.