30 marzo 2013

Blurred reflections workflow for Unity

At the end I decided to use convolved cubemaps to avoid doing ninja filters over the lattitude longitude map. The process is extremely tedious!!
So the first step is getting an HDR map. For example here
Now we have to convert it to vertical cross format using HDRShop:

Then, using CubeMapGen or its modified version by Sébastien Lagarde we can filter it.

Once we have the result we want, save the mip chain, because we need them to create a .dds with mipmaps. I cant understand why exported .dds from this tool doesnt include the mipmaps :/

Now we need two more tools, gimp and gimp dds. Now import one by one each image with its mipmaps.
First, Import as layers:

Select all the mips for each image:

Now just export as dds and repeat 5 more times :D
Once in Unity, create a cubemap and assign the images in this order:

And at last, we can use it. At this point Im doing this:

float3 Reflection=DecodeLightmap(RGBMEncode(texCUBElod(Environment, float4 ( worldRefl, nMips- (1-o.Gloss)*nMips )).rgb));

The result:

No hay comentarios:

Publicar un comentario