Magnifying Texture ...

Dodo

Tank
Joined
Aug 30, 2004
Messages
2,140
Reaction score
0
Hi, im trying to make a texture for hl2 that magnifies like the magnifying glass in Kleiners lab. Ive been testing with the dudv map but i cant get the refraction working... do you know what im doing wrong ?

"Refract"
{
"$refractamount" "1"
"$refracttint" "{100 100 100}"
"$scale" "[2 1]"
"$dudvmap" "test/test_dudv2"
"$normalmap" "test/test_dudv2_normal"
"$baseTexture" "test/test_diffuse"
"$translucent" 1
"$additive" 1
}
 
/bump. any of you know what texture that magnifying glass uses ?

-dodo
 
All i can suggest is decompile somthing that is already using it and have a look in the .vtf
 
Haha ohyeah. forgot all about decompiling stuff. thanks, its a good idea!
thanks.

-dodo

edit: You guys think its using a refract shader to magnify ?
 
aah ! found it ! :smoking:
it's in "materials/models/props_c17/light_magnifyinglamp01"

thanks anyway

-dodo
 
You'll find that's just the texture for the magnifying glass stand and not the lens.

The lens material is @ materials/models/props_c17/fisheyelens.vmt and fisheyelens2.vmt. It calls a DuDv and Normal map in materials/models/effects/fisheyelens_dudv.vtf and fisheyelens_normal.vtf

This is the VMT for one of them.
Code:
"Refract"
{
    "$model" "1"
    "$nodecal" "1"
    "$refractamount" "-.04"
    "$REFRACTTINT" "{246 250 255}"
    "$scale" "[1 1]"
    "$dudvmap" "Models/effects/fisheyelens_dudv"
    "$normalmap" "Models/effects/fisheyelens_normal"
    "Refract_DX60"
    {
        "$fallbackmaterial" "models/props_c17/fisheyelens_DX60"
    }
    "Refract_DX60"
    {
        "$fallbackmaterial" "models/props_c17/fisheyelens_dx60"
    }
}

I think the 'Refract_DX60' bit is obsolete. Hope that helps. :)
 
Uh, w00t, I don't know what to say,... I'm speechless... well... thanks !! you made my day !

-dodo

edit:
Is "$refractamount" "-.04" the magnifying scale ? or is that "$scale" "[1 1]", if not where do I difine the magnifying scale.
 
This is from the Valve wiki:

$refractamount (float)

This is the amount of warp for the refraction. Higher values produce more warping.

I can't find anything on $scale. I'm guessing this is it. To scale up you might have to go [2 1], [3 1], [5 1], etc.

When I said the "Refract_DX60 bit is obsolete", it might not be actually. I just didn't see the material before.
 
The fisheyelens texture magnifys 2x but the scale is [1 1] so i guess its the warping of the refract shader that does the actual magnifying...

-dodo
 
it's working !!

fisheye.jpg


-dodo
 
Back
Top