Tutorials

Realistic Reflective Floor



You have probably seen this kind of reflections on really polished floors. Sadly, in Source the only way to create a reflection like that is to use water. So, we are going to use water too.

Notes:
This works only on DX9 or higher graphic cards.
You should not use this effect if you can see this same texture on other level or water with this texture at the same time, because it will look bad.
This doesn't work in CSS so well because you can shoot through walls. This results in splashing when you shoot the floor.

The outcome will look like this:

news post image


First create the room without a floor.

Then stretch the walls 32 units down like this:

news post image


Create a floor textured with "tools/toolsnodraw" below your walls.

Then create another 32 units thick brush with the same texture above the floor you just created and texture ONLY the top face of the brush with this reflective texture like this:

news post image

Now this would look like this in game:

news post image


Next we are going to add a texture on top of that reflection.

First pick a nice texture you would like to use, it can be any non see-through texture. Then we need to edit that texture to be slighly transparent, just copy and rename its vmt-file found in materials-folder. If it's Valve's texture, you can use GCFScape to extract its vmt-file from "source materials.gcf" in SteamApps-folder.

Now open the copy of that vmt-file in notepad and add these lines just before the last "}":

	"LightmappedGeneric_DX9"
	{
		"$alpha" 0.7
	}




So, if the file looked like this:

"LightmappedGeneric"
{
	"$basetexture" "ref_test/tilefloor11"
	"$surfaceprop" "Tile"
}




Now it looks like this:

"LightmappedGeneric"
{
	"$basetexture" "ref_test/tilefloor11"
	"$surfaceprop" "Tile"

	"LightmappedGeneric_DX9"
	{
		"$alpha" 0.7
	}
}




Now it will be slighly transparent only on DX9 because it doesn't work on DX8 and worse.
To make it look like more or less reflective, you can change the alpha value. Smaller values will make it more reflective and higher values less reflective. The Value can be anything from 0 to 1.

Now create one more brush, that is 1 unit thick, above the reflective brush. Texture it with "tools/toolsnodraw" again, then texture only its top face with the new texture you just created.
Then tie the new brush to func_detail if you want to see through it in game. Do not tie it to anything else or the transparency won't work.

Now it should look like this in hammer:

news post image


Now its done.
You should include the custom stuff with your map, I prefer using pakrat.

Download example map

Remonttimies

View comments ( 32 )

Back to top