Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Refract Shader

From HalfLife 2 Knowledge Base

Jump to: navigation, search

How to make a refracting texture that displaces the world behind it.

This tutorial was written by Smiddy.


Contents

Requirements

  • Adobe Photoshop CS
  • nVidia NormalMap plugin for Photoshop (get it here.)
  • knowledge of how to compile .vtfs / edit .vmts


Creating the Texture

1.Italic text create a new canvas in photoshop, i made mine 512x512 and this is probably the recommended size, but you can make it whatever you like.

2. fill the background with about a 50% gray

3. add noise, make it monochromatic, gaussian and put it at about 20

4. motion blur the noise vertically (filter>blur>motionblur) of about 10

5. gaussian blur it for about 2.5 (filter>blur>gaussian)

6. repeat the above motion blur, same values

7. increase the contrast by about 25 (filter>adjustments>brightness+contrast)

8. tint it a bluey colour by going into image > adjustments > hue + saturation and ticking colorise. move the sliders until you see a blue you think will suit it.

9. your done, and your texture should look something like this:

ice.jpg

10. save it as something like ice_texture - you won't need to convert this file to .vtf as it is just a reference file for the bumpmap and dudv map.


Creating the Bumpmap

1. open up your ice_texture, and add a bumpmap as show in the following tutorial.

http://www.hl2world.com/bbs/viewtopic.php?t=11832

2. save the file as ice_normal


Creating the du/dv map

1. open up ice_texture and go about adding a bumpmap as you normally would, however, when the normalmap dialog comes up, change your selection to the option highlighted in red below.

ice2.jpg

2. your preview will come up as a black/yellow/red thing. that is correct. 3. press ok to apply it 4. save it as ice_dudv


Tutorial

1. Create a new file in photoshop, the same size you made your texture. fill it with a blueish color

2. Save it as ice, and then compile all three - ice, ice_normal and ice_dudv. You need to compile the ice texture with the Refract Shader though.

3. Put them all in the one folder where you want them to be kept, and create a .vmt file.

make it look like this:


       "Refract"
       {
	"$model" "1"
	"$bluramount" "1.5"
	"$refractamount" ".1"
	"$refracttint" "{100 100 100}"
	"$scale" "[1 1]"
	"$dudvmap" "folder/ice_dudv"
	"$normalmap" "folder/ice_normal"
	"$basetexture" "folder/ice"
	"$envmap" "env_cubemap"
	"$envmaptint" "[.5 .5 .5]"
       }


and save it as ice.vmt in the same folder

4. you're done! hope that wasn't too bad

5. tell me if it doesn't work!

Examples

this method was used in RomeoJGuys new map, de_rats_rjg

you can see the official map thread here:

http://www.hl2world.com/bbs/viewtopic.php?t=11854

de_rats_ice4.jpg


credits

a large thanks to RomeoJGuy who helped me figure out what i was doing so i could write this :)

tatatata

enjoi :)

Personal tools