Realistic Reflective Floor

Tutorial collection, comprehensive listings on main site.

Realistic Reflective Floor

Postby Tutorial on Tue Sep 04, 2007 8:47 pm

category
General Half-Life 2/Effects

description
The secret to clean and shiny floors is revealed.

keywords
realistic, reflective, floor, shiny, texture.

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:

Image


First create the room without a floor.

Then stretch the walls 32 units down like this:

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:

Image

Now this would look like this in game:

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 "}":

Code: Select all
   "LightmappedGeneric_DX9"
   {
      "$alpha" 0.7
   }



So, if the file looked like this:

Code: Select all
"LightmappedGeneric"
{
   "$basetexture" "ref_test/tilefloor11"
   "$surfaceprop" "Tile"
}



Now it looks like this:

Code: Select all
"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:

Image


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

Download example map

Remonttimies
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Mess on Tue Sep 04, 2007 8:55 pm

I have found doing this before that ragdolls drop through into the 'water', and explosions cause splashes. afaik there is no way to solve these, so this floor technique should only be used in non-action sequences.
Image
User avatar
Mess
Interlopers Staff
Interlopers Staff
 
Joined: Tue Apr 26, 2005 11:53 am

Postby Generalvivi on Tue Sep 04, 2007 9:47 pm

heh nice way to look at this I suppose. Wish it was easier to make stuff like this. : /
Generalvivi
Irrational Games
 
Joined: Fri Feb 18, 2005 1:41 am
Location: Boston

Postby Fearian on Wed Sep 05, 2007 12:21 am

ah I remember all the trickas like this that we used to have to use in HL 1 mapping... sometimes even vreating a mirror image of your map underneath a transparant brush...
User avatar
Fearian
May Contain Skills
May Contain Skills
 
Joined: Wed Nov 30, 2005 10:33 pm

Postby ScarT on Wed Sep 05, 2007 6:06 am

A custom shader would make this possible, and look nice too :)
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Postby Remonttimies on Wed Sep 05, 2007 1:21 pm

Mess wrote:I have found doing this before that ragdolls drop through into the 'water', and explosions cause splashes. afaik there is no way to solve these, so this floor technique should only be used in non-action sequences.


In fact, this time nothing will go trough that floor (except bullets in css), you know nothing goes trough func_detail. If you used func_brush and made the transparency with its alpha properties, then bodies would fall trough it.
User avatar
Remonttimies
Been Here A While
Been Here A While
 
Joined: Mon Jul 03, 2006 9:54 am
Location: Finland

Postby TwiNCannoN on Wed Sep 05, 2007 1:22 pm

Indeed, should be fine considering the top texture .vmt is just set to be a tile surfaceprop
User avatar
TwiNCannoN
Been Here A While
Been Here A While
 
Joined: Mon Oct 24, 2005 5:43 pm

Postby JLea on Wed Sep 05, 2007 11:02 pm

ProZak wrote:A custom shader would make this possible, and look nice too :)


That's what I was thinking.
User avatar
JLea
May Contain Skills
May Contain Skills
 
Joined: Mon Jan 02, 2006 1:19 pm
Location: Melbourne, Australia

Postby scooby on Thu Sep 06, 2007 12:13 am

goood tut. :shock: it worked for me hhaah!
"Just drank a fifth of vodka, dare me to drive"
User avatar
scooby
Regular
Regular
 
Joined: Tue Dec 05, 2006 9:30 pm
Location: Miami, FL

Postby srredfire on Thu Sep 06, 2007 1:00 am

I do see splashes of water when doing this, even on the example map. A body will fall or something and there will be a splash. Too bad this can't be perfected.
srredfire
Veteran
Veteran
 
Joined: Sat Jul 22, 2006 10:44 pm

Postby TwiNCannoN on Thu Sep 06, 2007 1:57 am

Weird, works for me with no splashes. Bodies shouldn't fall through the func_detail. If you make it a func_brush or something, bodies will fall through, though.
User avatar
TwiNCannoN
Been Here A While
Been Here A While
 
Joined: Mon Oct 24, 2005 5:43 pm

Re: Realistic Reflective Floor

Postby CorporalAris on Tue Apr 22, 2008 10:14 pm

Hello there.

I have been trying to use this tutorial on a Half-Life 2 map. However, when I load it in Hammer, it shows up as a Pink and Black Checkerboard. I have put the three included reflective VTFs and VMTs in
C:\Program Files\Steam\steamapps\corporalaris\sourcesdk_content\hl2\materialsrc\customtex
and in
C:\Program Files\Steam\steamapps\corporalaris\half-life 2\hl2\materialsrc\customtex

What am I doing wrong? BTW, I am doing this as a mirror on a wall, so it is vertical.

Edit: I put it on the floor, and then it worked. Is it not possible to place it on a wall?
User avatar
CorporalAris
Been Here A While
Been Here A While
 
Joined: Tue Apr 22, 2008 10:10 pm

Re: Realistic Reflective Floor

Postby Remonttimies on Wed Apr 23, 2008 2:24 pm

You have to put your custom textures in

C:\Program Files\Steam\steamapps\USERNAME\half-life 2\hl2\materials\customtex

And this cannot be placed on walls.
User avatar
Remonttimies
Been Here A While
Been Here A While
 
Joined: Mon Jul 03, 2006 9:54 am
Location: Finland

Re: Realistic Reflective Floor

Postby mat_de_b on Wed Apr 23, 2008 3:58 pm

Could put a block bullets brush in there?
User avatar
mat_de_b
Pheropod
Pheropod
 
Joined: Mon Apr 10, 2006 7:32 pm

Re: Realistic Reflective Floor

Postby CorporalAris on Wed Apr 23, 2008 8:03 pm

Why can't it be placed on walls? I have gotten it work on the floor, yes, but WHY can't real time reflections be placed on walls. If need be, I can work on a custom shader, but I need to know WHY.
User avatar
CorporalAris
Been Here A While
Been Here A While
 
Joined: Tue Apr 22, 2008 10:10 pm
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users