This has been something I've thought about doing for a long time. I've always wondered if it'd be possible use models instead of displacements for cliffs. They'd have a few advantages, namely the way displacement cliffs always seem kinda soft (or jagged) and have problems with texture stretching if you try and do any more interesting shapes. Now that props can have lightmaps, the main drawback of having to use vertex lighting is a thing of the past!
So without further ado, what am I really talking about?
If you've ever delved into TF2's materials, you may notice that many use a detail texure. There's a handful of grayscale textures that Valve use to add a bit of extra detail to their textures. The main benefit is that the detail texture is blended into the main texture at a different scale so that when you're really close up to the main texture, the detail texture still shows the some detail. Virtually every game uses this technique now to enhance perceived texture resolution.
I took a modeled section of cave wall (thanks @Woozlez for the push to do this and the vmf), here this part is about 768x1024 units and just shy of 1000 tris. It's simple and not in any way something I'd ship but just something to use as a proof of concept.
I then laid out the UV map, baked ambient occlusion and painted some very simple colours onto it, this texture is what serves as our large scale variation to the model. Without this, the detail texture would be not much more than a regular displacement's tiling texture, but with it, we can alter the colour of each area however we want.
I also pinched an existing displacement cliff texture, desaturated it and used that as my detail texture. If I were to do this for real I'd probably be spending a lot of time on making the detail texture unique and interesting.
These are 512 and 1024 pixels:
You can see in the smaller material I've got the long light and dark bands running across the texture, the advantage of this method is it allows for nice strata like this.
Then these two textures are blended together in the material like this.
And here's the result:
All in all this uses a 512 base texture, a 1024 tiling detail map and a 512 lightmap.
I've only spent about 4 hours on this in total, so it's easy to imagine I could get an entire map's cliffs done in a few days, a similar length of time to using displacements, but the shapes and forms achievable are far better.
It'd be fantastic if someone actually used this method in a TF2 map, it could really take your cliffs to the next level, not to mention it'd be great practice at doing things in a way the rest of the games industry might.
Appendices:
So without further ado, what am I really talking about?
If you've ever delved into TF2's materials, you may notice that many use a detail texure. There's a handful of grayscale textures that Valve use to add a bit of extra detail to their textures. The main benefit is that the detail texture is blended into the main texture at a different scale so that when you're really close up to the main texture, the detail texture still shows the some detail. Virtually every game uses this technique now to enhance perceived texture resolution.
I took a modeled section of cave wall (thanks @Woozlez for the push to do this and the vmf), here this part is about 768x1024 units and just shy of 1000 tris. It's simple and not in any way something I'd ship but just something to use as a proof of concept.
I then laid out the UV map, baked ambient occlusion and painted some very simple colours onto it, this texture is what serves as our large scale variation to the model. Without this, the detail texture would be not much more than a regular displacement's tiling texture, but with it, we can alter the colour of each area however we want.
I also pinched an existing displacement cliff texture, desaturated it and used that as my detail texture. If I were to do this for real I'd probably be spending a lot of time on making the detail texture unique and interesting.
These are 512 and 1024 pixels:
You can see in the smaller material I've got the long light and dark bands running across the texture, the advantage of this method is it allows for nice strata like this.
Then these two textures are blended together in the material like this.
Code:
"VertexLitGeneric"
{
"$basetexture" "models\props_rocks\rock_base_01"
"$detail" "models\props_rocks\rock_detail_01"
"$detailscale" 5
"$detailblendfactor" 1.5
"$detailblendmode" 0
}
And here's the result:
All in all this uses a 512 base texture, a 1024 tiling detail map and a 512 lightmap.
I've only spent about 4 hours on this in total, so it's easy to imagine I could get an entire map's cliffs done in a few days, a similar length of time to using displacements, but the shapes and forms achievable are far better.
It'd be fantastic if someone actually used this method in a TF2 map, it could really take your cliffs to the next level, not to mention it'd be great practice at doing things in a way the rest of the games industry might.
Appendices:
Oh why aren't you using a normal map and baking details down from a higher res sculpt??
Well, as it turns out... any prop that uses a normal map can't have a lightmap. See this image, the left hand fireplace and table are using default lighting settings, the right hand pair are set to use a 128 lightmap. As you can see only the right hand table actually has any luxels!
Until I did this test I wasn't sure if a normal map would stop a lightmap from working, I already knew it stops vertex lighting. Oh well, Source is an ancient engine after all
Well, as it turns out... any prop that uses a normal map can't have a lightmap. See this image, the left hand fireplace and table are using default lighting settings, the right hand pair are set to use a 128 lightmap. As you can see only the right hand table actually has any luxels!
Until I did this test I wasn't sure if a normal map would stop a lightmap from working, I already knew it stops vertex lighting. Oh well, Source is an ancient engine after all
Why bother with a lightmap?
Well... these images were from the first and second compile test, the top image uses vertex lighting
There's not a huge difference, but the lightmap definitely performs a lot better where there are corners.
Well... these images were from the first and second compile test, the top image uses vertex lighting
There's not a huge difference, but the lightmap definitely performs a lot better where there are corners.
Here's an excellent polycount thread about a similar technique used in UDK for a huge sea cliff. He makes a high poly sculpt, bakes a normal down to a lowpoly then blends in different tiling textures over that base normal map with fantastic results. If only Source weren't an ancient engine!
http://polycount.com/discussion/117621/udk-sea-defenses
http://polycount.com/discussion/117621/udk-sea-defenses
You can simulate what the texture will look like by using an overlay layer in photoshop. The line in the vmt that defines $detailscale tells you how many times to tile the detail texture, for me it was 5. It looks like this:
Lovely and pixelated! But because Source isn't downscaling the detail texture when it renders the model, it still has all the detail up close:
Lovely and pixelated! But because Source isn't downscaling the detail texture when it renders the model, it still has all the detail up close:
Last edited: