Proper way to create reflective metal surfaces (phong/envmap?)

  • If you're asking a question make sure to set the thread type to be a question!

Theobromin

L1: Registered
Apr 6, 2012
9
0
Hello there, looking for a way to make a realistic metal surface (like stainless steel or similar)-

I suppose phong would produce a more dull reflection, while envmap would look rather polished?

But what kind of configurations usually tend to look the best?
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Well it depends on what you want your metal to resemble, there are lots of types of metal with all sorts of finishes.

For a default shiney metal a high reflectivity helps.
 

Theobromin

L1: Registered
Apr 6, 2012
9
0
Well it depends on what you want your metal to resemble, there are lots of types of metal with all sorts of finishes.

For a default shiney metal a high reflectivity helps.

Okay, thanks, guess I'll just do it by trying out different textures with high reflectivity.

In particular, I've been looking for a neat looking metal door in a spot where I really don't want to use the standard door props....
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
I'm not sure how you are with models but there are numerous versions and styles of metal materials for reference on models. For example the distillery models found in gorge are clean and shiney and have clear cubemap reflections. It might be worth investigating some of the material files for them.

P.S. To specify what i meant by high reflectivity, i was refering to light reflectivity. I'm not sure how clear i was about that in my OP. Hopefully you understood but if not, i made this post script to make sure.
 

Theobromin

L1: Registered
Apr 6, 2012
9
0
P.S. To specify what i meant by high reflectivity, i was refering to light reflectivity. I'm not sure how clear i was about that in my OP. Hopefully you understood but if not, i made this post script to make sure.

I suppose you mean high $reflectivity values?
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
If you're looking for material shader parameter to use with world geometry, such as 'lightmappedgeneric' (brush textures), phong doesn't work (at least the last time I checked). The phong shader parameter in the tf2 version of source are strictly a model privilege.

But you're right in your original assumption: "I suppose phong would produce a more dull reflection, while envmap would look rather polished".

Your other option may be:
https://developer.valvesoftware.com/wiki/Func_reflective_glass


Reflectivity isn't going to make your material look reflective. It just changes how much light is bouncing off the material in question.
https://developer.valvesoftware.com/wiki/$reflectivity
 
Last edited:

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
Possibly? Ask YM, he wrote the nodraw.net article about it.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
Doesn't it also increase the bloom from the surface of the material?

Nope. All reflectivity does is change the number of successful bounces for each colour channel off that texture. It's automated so normally you don't need to fiddle with it too so a white texture will have high values and a dark texture will have low values. This is good for matt textures but if you have super-shiny black metal, you're gunna want to bump it up a little so the surrounding brushes get enough bounce.

It has zero impact on the cubemaps on the texture.

I'm pretty sure you can use phong together with an envmap, I think the 2-pipes and 3-pipes models use both together.

The best thing to do is to experiment. Set the envmap to cubemap and play with envmapmask, tint and contrast settings (higher contrast means bright spots on a dark reflection) (slightly bluer/redder tint can change the material's warmth)
 

BeaverKing

L1: Registered
Jun 13, 2010
11
2
that reflective glass entity, from what that wiki says, does not reflect players in real time, only the water shader does that, if im not mistaken. you can check this old article on the subject if that's the type of effect you're going for... -> http://www.gamebanana.com/css/tuts/5156

update that technique a little, maybe that flat water texture on a func_brush with low opacity and no collisions to avoid projectiles causing splashes, 1 unit thick and in front of a normal metal wall to simulate a real time reflection, clip brush in the same place to keep players from passing through it...

i dunno if thats what you want, just figured id throw it out there in case it helps spark an idea

peace
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Water can't be on entities (exception: cheap water on func_water_analog), and the reflection shader only words correctly on a horizontal plane. There isn't really a way to make a super crisp reflection in anything but proper water.
 

BeaverKing

L1: Registered
Jun 13, 2010
11
2
hmm. guess doing it the way that old article describes with the fake reflection under the actual floor is the only way... could almost swear ive seen a mirror on a wall that had real time player reflections before... maybe it was just npc's...

oh well. was an idea :p

maybe someone can make a modified shader to make the effect work on a brush with a slope in the z axis... i found a few custom shaders years ago that added things like parallax mapping and other stuff back into the game. anything's possible :)
 
Last edited: