Basic exponential/height fog with directional light inscattering.
References:
The Henyey-Greenstein phase function
15 mayo 2013
03 mayo 2013
Unity - Dynamic Exposure
I wanted to have eye adaption, but the current one in Unity works only with Reinhard tonemap, and I dont really like it. So I made it outside to allow using any other tonemaper.
25 abril 2013
Unity - Ferrari
Model donated by Luis Carrera.
This time I implemented "Frostbite2 / UE4" lens dirtness style.
Fixes:
This time I implemented "Frostbite2 / UE4" lens dirtness style.
Fixes:
- Alpha blend writes in Z buffer
- View dependent opacity
- Added reflections mask (AO map)
- Alpha test support
21 abril 2013
Unity - Car Rendering
All together, layered BRDF and TriAce BRDF with view dependent roughness.
Model by Cesar Martinez and presentation based in the great Visual Shaker Car Tune.
Model by Cesar Martinez and presentation based in the great Visual Shaker Car Tune.
17 abril 2013
Skin Shader for Unity (Iteration 2)
I have optimized some steps, so it has lost some quality. On the other hand, I added IBL.
Turning off update lighting allows to stop the diffuse convolution. The web player is limited to 50fps, but in a 560Ti gpu it goes from 130 fps with lighting update enabled to 250fps if disabled.
Also, spent some time to correct the seams created by the texture space diffusion:
Turning off update lighting allows to stop the diffuse convolution. The web player is limited to 50fps, but in a 560Ti gpu it goes from 130 fps with lighting update enabled to 250fps if disabled.
Also, spent some time to correct the seams created by the texture space diffusion:

Layered BRDF
Also with IBL support:
References:
Exploring the Potential of Layered BRDF Models.Andrea Weidlich, Alexander Wilkie
Layered Materials in Real-Time Rendering. Oskar Elek
07 abril 2013
06 abril 2013
Screen Space shadow filtering
At the end, I figured out how to improve the shadows. I thought in a screen space blur, like a postprocess.
First I render the mesh only with shadows, save to texture and blur to use it as shadow in the final shader.
The first problem is obvious, edges must to be fixed:


First I render the mesh only with shadows, save to texture and blur to use it as shadow in the final shader.
The first problem is obvious, edges must to be fixed:

Then I needed to find those edges. How? With the differente between the blurred depth and the original.

The perfect filter would be a bilateral filter (smart filter in photoshop) but instead getting mad doing it, I just tried to apply the idea by my self. Its not perfect, but works for now.

05 abril 2013
Fog Volume
What started as an attempt on calculating volume thickness, ended up with this :D Very good exercise, my head is smoky :P
03 abril 2013
Skin Shader for Unity (Iteration 1)
Ive been waiting some years until I could start with the implementation of the nVidia approach to real time skin rendering described in the GPU Gems3 Chapter14. But at last! I have to thank Christopher Schiefer and Carlos Macarron for their support and patience.
I couldnt bake the shadows in the unwraped mesh, and probably its almost impossible or extremely hard. This is a huge problem and loses lots of realism :/
The texture space diffusion is working well, although those greens bothers me. For the sub surface lighting I have used very basic and old school stuff and made the thickness map in real time.
Advanced Techniques for Realistic Real-Time Skin Rendering
Real-Time Approximations to Subsurface Scattering
I couldnt bake the shadows in the unwraped mesh, and probably its almost impossible or extremely hard. This is a huge problem and loses lots of realism :/
The texture space diffusion is working well, although those greens bothers me. For the sub surface lighting I have used very basic and old school stuff and made the thickness map in real time.
Advanced Techniques for Realistic Real-Time Skin Rendering
Real-Time Approximations to Subsurface Scattering
30 marzo 2013
TriAce BRDF for Unity (Iteration 2)
Improvements:
- Specular modulated with shadows
- IBL. Replaces NdotL with convoluted cubemap
- Blurred reflections. Blur depends on roughness
- Added tweakable parameters at runtime to the GUI
- View dependent roughness
- Parallax version
- Alpha test version
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:
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:
TriAce BRDF + IBL + Blurred Reflections
Still under development, but here is some progress:
I had a problem when creating the IBL cubemap.. I was used to import .exr textures with texture type set as Lightmap, but this didnt work when using a cubemap object. So sadly I had to do it in runtime. Imported as standard texture, in DXT1 and enconded to RGBM inside the shader as described by Brian Karis.
I had a problem when creating the IBL cubemap.. I was used to import .exr textures with texture type set as Lightmap, but this didnt work when using a cubemap object. So sadly I had to do it in runtime. Imported as standard texture, in DXT1 and enconded to RGBM inside the shader as described by Brian Karis.
o.Irradiance=DecodeLightmap(RGBMEncode(texCUBE(IBL,worldNormal).rgb));
For the reflections Im still using the Latitude/Longitude Map. Mainly to avoid texture lookups. For now Im using MIP levels depending on the roughness, but I have to do some more research. There is still a huge problem with edge seams.
24 marzo 2013
HDR IBL for Unity
Yeah! Some friends wanted to see some hdr reflections in the shader, so I have started learning about it with the help of Christopher Schiefer:
The file format is .exr and is treated as a lightmap, so I have done this:
final.rgb=DecodeLightmap(tex2Dlod(LongLat_Map, float4 ( coords, 0.0, MIP ))).rgb;
Internally this is just Source.a*8*Source.rgb
Coordinates are obtained this way:
Where RoV is just to change between V or R. I have to fix this :P
Resources:
http://www.hdri-hub.com/hdrishop/freesamples/freehdri/item/117-hdr-041-path-free
http://http.developer.nvidia.com/GPUGems/gpugems_ch17.html
The file format is .exr and is treated as a lightmap, so I have done this:
final.rgb=DecodeLightmap(tex2Dlod(LongLat_Map, float4 ( coords, 0.0, MIP ))).rgb;
Internally this is just Source.a*8*Source.rgb
Coordinates are obtained this way:
Where RoV is just to change between V or R. I have to fix this :P
Resources:
http://www.hdri-hub.com/hdrishop/freesamples/freehdri/item/117-hdr-041-path-free
http://http.developer.nvidia.com/GPUGems/gpugems_ch17.html
Specularity is everything
After making maps for roughness and normal reflectance, I am more conscious than ever of its importance. It gives us the needed information to make our brain interpret what kind of surface are we seeing. We can even imagine its touch. Indeed, I think a good specular map is even more important than albedo.
I rescued this model I made a while ago and those are the F0 and roughness maps:
I rescued this model I made a while ago and those are the F0 and roughness maps:
More detailed information about Fresnel Reflectance and Roughness can be found in:
Suscribirse a:
Entradas (Atom)











.jpg)
.jpg)
.jpg)


















