Source Engine Icon SOURCE Tutorial

$Phong on brushes*: The Hacky Way

Attention Gamer! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Planub points.
  • Post: Give Planub your thoughts on this Tutorial.
  • Vote: Help Planub win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Stop Lurking!

Become a Bananite

Already a Bananite? Login

You may have seen some models with their shiny point specular and

thought "I got to get me some of that!" Excitedly you open up notepad,

slam down the commands "phong 1" and "phongfresenal ranges "[ .2 .5 1]"

and quickly boot up the game, only to see that it does not work on

"LightmappedGeneric" surfaces. In a fit of rage you are about to throw

yourself off a cliff. Worry Not! I have come in a cloud of light to

deliver you the good news that you can achieve phong on a

lightmappedgeneric surface!* (*Using models)

This is a fairly simple operation; however it requires a few things

=========================================================================

  • A modelling editor package (Propper will work)
  • A normal map
  • A strong will to hold yourself off from commiting suicide to perform these operations

=========================================================================

First thing you want to do is duplicate your ideal brushes in some form

or fashion to another vmf. From there, you tessellate it and use either

propper or your software editing package (In my case I use wallworm and

3DS max to edit things) to export it to an smd format. if you have

propper you can auto compile it, if you have 3DS max, you'll need to

export it and use crowbar or wallworm's compile tools to compile it into

a mdl file.

Now for the textures. I suggest making a subdirectory for your phong

textures. E.G. models/phongtextures/texturename.vmt The only new texture

you'll need is a black 256x256 texture. You can generate it in nearly

all programs. (doesn't have to be 256x256 but works best with that) Once

you have that, you just duplicate the vmt that your brush uses and make

a few changes.

Original materials/tile/floor_tile_001a

=========================================================================

"LightmappedGeneric"{	"$baseTexture" "Tile/floor_tile_001a"	"$envmap" "env_cubemap"	"$envmapcontrast" 1	"$envmapsaturation" 1	"$envmaptint" "[ .75 .75 .75]"	"$normalmapalphaenvmapmask" 1	"$bumpmap" "Tile/floor_tile_001a_normal"	"%keywords" "tf"}

=========================================================================

New materials/models/phongtextures/floor_tile_001a

=========================================================================

"VertexlitGeneric"{	"$baseTexture" "models/phongtextures/black"	"$additive" 1	"$bumpmap" "Tile/floor_tile_001a_normal"	"$phong" 1	"$phongexponent"            60  	"$phongfresnelranges" "[ .2 .5 1]"	"$phongboost" 3	"%keywords" "tf"}

=========================================================================

You'll notice a few changes

I changed LightmappedGeneric to VertexlitGeneric

I ditched the envmap because phong does the main work.

My base texture is the newly created black texture.

I added phong commands

And most importantly, there's this new command

"$additive" 1

What does this do? exactly what it says. It adds the colors of the

textures together, and this is my base texture is black. 1+0 = 1 Black

will show up invisible in-game, however the specular highlight from

$phong will not. Thus replicating the holy grail effect.

In hammer you simply place this in your map just ever so slightly above the brush (1 unit looks fine)

Bam!

Phong.



Posts

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Submitter

Planub avatar
Planub Offline
Member Joined 6y
3,678 points Ranked 1220th
17 medals 1 rare
  • 2nd Place - Character Modding Contest Medal icon
  • Texturer of the Month, August 2013 Medal icon
  • GameBanana/CEVO CSGO Mapping Contest 2014 Entrant Medal icon
  • Reached 1,000 Points Medal icon
  • 1 post awarded Exemplary Feedback Medal icon
  • One month a member Medal icon

Planub
Creator
Send a Private Message to the submitter

Category

Details

Difficulty Level
Intermediate Difficulty

Attributes

Genre
Mapping

Stats

Posts
1
Views
1,572
Date Added
1y
Date Modified
5mo

Rating

10/10 by 1 rater

WiPs by Planub