11 noviembre 2016

Unite 2016: GPU instancing demo

Recently, I worked on a demo that demonstrates GPU instancing on Metal API. I had 10 days to make all the art, shaders and scene setup. C# was provided by Unity.

The demo was shown at the Unite 2016 event:

Local captures:

Protoplanet sculpt:

Asteroid sculpt:

15 agosto 2016

Arid Environment Set for UE4.

It's been a year since we climbed that high mountain searching for rocks to scan. Today we are happy to show you a scene that we have built using the collected data.

I asked my bro to build something simple with the rocks I just imported into the editor, just to let him learn a bit of the Editor basics.

I began to do some tests by myself. In the meantime, he trained hard. Weeks later I started to think that we could maybe work in the scene together, so I created a level for him, moved the project to Dropbox and shared it with him, so we would be able to work on it at the same time.

I asked him to build an exterior area, so he designed and built it. Later I added all the detail.



Some time ago I bought an HTC VIVE device, so it was a must to try it here. I learned the basics to make it possible and the scene is officially playable with it.

The initial plan was to do something way more simple, but sometimes, what starts as something small ends up as something huge!

25 junio 2016

Advances in Sub-surface scattering

The system had been gathering dust for more than two years now, but my current client wanted to invest on it for his product.

In the last two months many things have changed and improved. The system supports now multi profile, as seen in UE4. This means that we can have many different organic materials on screen at the same time: skin, eyes, teeth... Other types of organic materials will be on the task list, but for now we can simulate other materials such as marble, honey or opaque glass with the same shader, it's pretty flexible.


 Translucency has improved to allow light to travel through the subject:

Another experiment in course was percentage close shadow filtering


Last addition to the character render was eyes rendering. Its a very hard task to cheat our brain when it comes to human perception. We are specially sensitive in face recognition and I think we will never cross the uncanny valley :)

11 enero 2016

SAS - Standard Anisotropic Shader

During December I worked on an update of my Cloth Shader for Unity 4 After some days of work several ideas came to my head. "What if it is suitable for metals?", "What if I make a metals demo?" "What if I try to shade a cymbal? "What if supports transparency?", "What if... carbon fiber!!", "What if, what if...." So it started to grow until I realized it was too big/flexible to deliver it as a simple update. Instead of that, I have released it as an upgrade for previous buyers of the old cloth shader.
The new version aims to model any kind of scratched surfaces.

12 septiembre 2015

Removing ambient occlusion from photo-scanned subjects

This is a simple idea I came up  last night. I was making a little stone that would be used rotated in every axis. Then I figured out that the ambient lighting of the original capture won't match with the scene. This was the subject:

So the idea was to convert this diffuse into an albedo. The method consist on emulating the scenario to get a simulation of the original lighting conditions I had there. Then I will use the inverse of that result to brighten the original captured diffuse.
You see there the lighting came from every direction from the clouds and a little percent of it came from the ground (typical hemisphere lighting).
So the scene can be emulated like this:

Here is the resulting ambient occlusion:

Captured albedo. Notice it matches perfectly with the emulated AO


Now, I inverted the AO and blended it as "Linear Light" with opacity 50%. Other blending modes may be tested; "Lighten" seems to work pretty nicely too.

I can now bake a new AO without any other geometry than the model:

And finally, the diffuse texture after the surgery session:

29 agosto 2015

From real world to real-time

Since May my life has been a mess. I moved to Tenerife with the idea of building my home-studio. It's progressing, slowly, but progressing. But well, thats another story for another post. The thing is that there is a mountain close to my house here in Tenerife with very interesting rock formations. I really wanted to have that kind of rocks in my assets bucket to use them here and there.
I have tried to model rocks several times, but the result was always terrible. So the solution was obvious, photoscan!
I asked my brother if he may like to climb that mountain to take some photos. I told him the plan and he agreed.

This was the target:

Climbing and searching interesting rocks to scan.

Scary views!

Although there were rocks everywhere, it was not easy to find good ones because most of them were not accesible, covered with lichens, or with vegetation growing everywere.
The ideal rock should be shadowed, with no vegetation on it, young enough for not being too eroded or covered by lichens and accesible from every side. But well, we found some. We had to remove all the vegetation on/around it first.

The first attempt on processing the data took 15 hours to complete. I made a 200k mesh. The final mesh should be at least 2 million dense! How long would that take? Absolutely impossible. I had no choice, I spent 2000€ on new hardware: 
Then I was able to compute a 4 million triangle mesh in 2-3 hours or so. Here is the rough mesh

Then I had to remove all the crap in the borders:

"And what now?" -I asked myself
- O_o
- Do I have to fill all of that by hand?
- I guess...
- It will never look as good as the original
- I know, but what else can we do?
- -_-' 
- Do you know how to do that?
- No idea. you?
- ¬_¬
- Okay, I'll find the way

Yeah, I had to fill all the missed surface to convert that into an usable asset. I started with a rough shape:

 Then I applied Dynamesh in zBrush and removed the bottom cap:

5 hours later:

Once with the modelling "done" I made the low poly with decimation master and the UVs with UV master (easy way). The next step was to project the texture, bake normal, AO and cavity to use them in DDO.

I used DDO mostly to render the model, I didn't use much of it in this case. The texture fix was done with Mudbox. I didn't spend much time on that, probably less than 3 hours.

PS. Special thanks to Lee Perry-Smith for the support and advices