Upvote Upvoted 111 Downvote Downvoted
1 2 3 4 ⋅⋅ 6
Transparent Viewmodels in any HUD
posted in Customization
1
#1
1 Frags +

Something new that was just discovered by JarateKing is that one can edit the material proxies of a .vmt to make anything beneath the material translucent, or, more accurately, make it refract. One potential use of this function is to make your viewmodels transparent. This is already mentioned in his hud's thread but I know a lot of people haven't seen it.

A couple things to note:

  • This method is simple hud-editing.
  • It shouldn't ever result in a VAC ban.
  • However: this might be considered an exploit as for some reason it affects some map textures as well, specifically spawn doors. This is disappointing as it increases the likelihood of this being patched in some way.
  • If used in conjunction with chris' or comanglia's maxframes fps configs it will work on all maps.
  • Right now it does not work on dx8, only dx9 (which sucks).
  • It should work on macintosh, not sure of linux.
  • Assuming the above conditions are met: it ~should~ work on all servers, sv_pure 2 or otherwise, at least until the workaround for custom materials is patched (if ever). Some public servers have broken all custom materials for me personally, usually ones running sourcemod to limit classes or disable capping on hightower. Someone in this thread mentioned skial badwater not working. It's possible there's some servermod that might render this ineffective, not sure.

To put it in layman's terms: one is putting a transparent screen underneath their health and ammo that refracts light such that everything underneath it is transparent. Since your viewmodels are technically considered a part of your hud (??) they are partially transparent. This does not affect the actual tf2 map you are playing on, just your viewmodels. (edit: apparently this does affect the map?) Here's how to add this feature into any hud:

1. Materials

First you will need to get the custom materials in question. Here is a download link, and here, for reference, is what the .vmt file actually look like:

"Refract"
{
	"%keywords" "tf"
	"$refractamount" "0.0"
	"$refracttint" "{255 255 255}"
	"$refractblur" "0.0"

	"$scale" "[1 1]"
	"$normalmap" "vgui/replay/thumbnails/REFRACTnormal_transparent"
}

Compared to what it ~normally~ looks like.

"UnlitGeneric"
{
	"$translucent"	"1"
	"$basetexture" "vgui\replay\thumbnails\seeker"
	"$vertexcolor" "1"
	"$no_fullbright" "1"
	"$ignorez" "1"
}

Once you have both the .vtf and the .vmt, put them in custom/ * any name * /materials/vgui/replay/thumbnails.

2. HudLayout

Next you will need to reference the material in HudLayout.res in your scripts folder. Copy/paste this into the file. It needs to follow the formatting used by hudlayout. Put it right where the cursor is in the below screenshot (default hud used for example):

http://i.imgur.com/xPN1OdC.png

Make sure not to delete any existing brackets while doing so. The below is what you copy-paste.

"TransparentViewmodelMask"
	{
		//alpha doesn't work for this, you need to change the texture's alpha
		"ControlName"	"ImagePanel"
		"fieldName"		"TransparentViewmodelMask"
		"xpos"			"0"
		"ypos"			"0"
		"zpos"			"-100"
		"wide"			"f0"
		"tall"			"480"
		"visible"		"1"
		"enabled"		"1"
		"image"			"replay/thumbnails/REFRACTnormal_transparent"
		"scaleImage"	"1"
	}

3. Config Settings

The final step is to edit your fps config so that certain console commands don't disable your viewmodels' transparency. Find these console commands in your config and replace them with the following:

// Prism Settings (for refract)

mat_motion_blur_enabled 1 			//afaik the only sure-fire way to keep refract masking on
mat_motion_blur_strength 0 			//effectively disables motion blur, personal choice + motion blur gets masked and looks bad with refract masking
mat_disable_bloom 1 				//disables bloom so refract masking doesn't create a dark rectangle over light materials
mat_hdr_level 0
mat_colcorrection_disableentities 1
mat_colorcorrection 0

Using these commands should make this work on all maps, with or without water. Big thanks to -Icaria- from reddit for going through chris' maxframes and commenting out each line to find these. More feedback on these being the only commands neccesary welcome.

If my explanation is too complicated or you don't get it, there's a simple version of this post that might help here.

That's it! Your viewmodels will now look like this:

shitty youtube video:

https://www.youtube.com/watch?v=1yqZTt0Lc78&feature=youtu.be

imgur album:
http://imgur.com/a/L0t9v

Something new that was just discovered by [url=http://teamfortress.tv/user/jarateking]JarateKing[/url] is that one can edit the material proxies of a .vmt to make anything beneath the material translucent, or, more accurately, make it refract. One potential use of this function is to make your viewmodels transparent. This is already mentioned in his hud's thread but I know a lot of people haven't seen it.

A couple things to note:
[list]
[*] This method is simple hud-editing.
[*] It shouldn't ever result in a VAC ban.
[*] However: this might be considered an exploit as for some reason it affects some map textures as well, specifically spawn doors. This is disappointing as it increases the likelihood of this being patched in some way.
[*] If used in conjunction with chris' or comanglia's maxframes fps configs it will work on all maps.
[*] Right now it does not work on dx8, only dx9 (which sucks).
[*] It should work on macintosh, not sure of linux.
[*] Assuming the above conditions are met: it ~should~ work on all servers, sv_pure 2 or otherwise, at least until the workaround for custom materials is patched (if ever). Some public servers have broken all custom materials for me personally, usually ones running sourcemod to limit classes or disable capping on hightower. Someone in this thread mentioned skial badwater not working. It's possible there's some servermod that might render this ineffective, not sure.

[/list]
To put it in layman's terms: one is putting a transparent screen underneath their health and ammo that refracts light such that everything underneath it is transparent. Since your viewmodels are technically considered a part of your hud (??) they are partially transparent. [s]This does not affect the actual tf2 map you are playing on, just your viewmodels[/s]. (edit: apparently this does affect the map?) Here's how to add this feature into any hud:

[size=14][b]1. Materials[/b][/size]

First you will need to get the custom materials in question. Here is a [url=https://www.dropbox.com/s/ukzqswen7jb546z/transparent.zip?dl=0]download link[/url], and here, for reference, is what the .vmt file actually look like:

[code]"Refract"
{
"%keywords" "tf"
"$refractamount" "0.0"
"$refracttint" "{255 255 255}"
"$refractblur" "0.0"

"$scale" "[1 1]"
"$normalmap" "vgui/replay/thumbnails/REFRACTnormal_transparent"
}
[/code]
Compared to what it ~normally~ looks like.

[code]"UnlitGeneric"
{
"$translucent" "1"
"$basetexture" "vgui\replay\thumbnails\seeker"
"$vertexcolor" "1"
"$no_fullbright" "1"
"$ignorez" "1"
}[/code]

Once you have both the .vtf and the .vmt, put them in custom/ * any name * /materials/vgui/replay/thumbnails.

[size=14][b]2. HudLayout[/b][/size]

Next you will need to reference the material in HudLayout.res in your scripts folder. Copy/paste this into the file. It needs to follow the formatting used by hudlayout. Put it right where the cursor is in the below screenshot (default hud used for example):

[img]http://i.imgur.com/xPN1OdC.png[/img]

Make sure not to delete any existing brackets while doing so. The below is what you copy-paste.

[code]"TransparentViewmodelMask"
{
//alpha doesn't work for this, you need to change the texture's alpha
"ControlName" "ImagePanel"
"fieldName" "TransparentViewmodelMask"
"xpos" "0"
"ypos" "0"
"zpos" "-100"
"wide" "f0"
"tall" "480"
"visible" "1"
"enabled" "1"
"image" "replay/thumbnails/REFRACTnormal_transparent"
"scaleImage" "1"
}
[/code]
[size=14][b]3. Config Settings[/b][/size]

The final step is to edit your fps config so that certain console commands don't disable your viewmodels' transparency. Find these console commands in your config and replace them with the following:


[code]// Prism Settings (for refract)


mat_motion_blur_enabled 1 //afaik the only sure-fire way to keep refract masking on
mat_motion_blur_strength 0 //effectively disables motion blur, personal choice + motion blur gets masked and looks bad with refract masking
mat_disable_bloom 1 //disables bloom so refract masking doesn't create a dark rectangle over light materials
mat_hdr_level 0
mat_colcorrection_disableentities 1
mat_colorcorrection 0
[/code]

Using these commands should make this work on all maps, with or without water. Big thanks to [url=http://www.reddit.com/user/-Icaria-]-Icaria-[/url] from reddit for going through chris' maxframes and commenting out each line to find these. More feedback on these being the only commands neccesary welcome.

If my explanation is too complicated or you don't get it, there's a simple version of this post that might help [url=http://teamfortress.tv/thread/21928/transparent-viewmodels-in-any-hud/?page=2#37
]here[/url].

That's it! Your viewmodels will now look like this:

shitty youtube video:
[youtube]https://www.youtube.com/watch?v=1yqZTt0Lc78&feature=youtu.be[/youtube]

imgur album:
http://imgur.com/a/L0t9v
2
#2
-36 Frags +

that 2fps video tho

that 2fps video tho
3
#3
5 Frags +

Can you change the opacity of the viewmodels ?

Can you change the opacity of the viewmodels ?
4
#4
2 Frags +
LtSteveCan you change the opacity of the viewmodels ?

The transparency is based on the transparency of the vtf. You'll have to edit that (easiest way is with paint.net or gimp with their vtf plugins). For some reason changing the alpha in hudlayout doesn't work.

komorebi
// Prism Settings (for refract)

mat_motion_blur_enabled 1 			//afaik the only sure-fire way to keep refract masking on
mat_motion_blur_strength 0 			//effectively disables motion blur, personal choice + motion blur gets masked and looks bad with refract masking
mat_disable_bloom 1 				//disables bloom so refract masking doesn't create a dark rectangle over light materials

I know there's at least one other command needed to make it work 100% of the time. Chris's maxframes and comanglia's config both come with whatever command, but I know chris's maxquality (and probably just default tf2) will break it occasionally. I'll try to find it but in the meantime I'd stick with configs :/

[quote=LtSteve]Can you change the opacity of the viewmodels ?[/quote]
The transparency is based on the transparency of the vtf. You'll have to edit that (easiest way is with paint.net or gimp with their vtf plugins). For some reason changing the alpha in hudlayout doesn't work.

[quote=komorebi][code]// Prism Settings (for refract)


mat_motion_blur_enabled 1 //afaik the only sure-fire way to keep refract masking on
mat_motion_blur_strength 0 //effectively disables motion blur, personal choice + motion blur gets masked and looks bad with refract masking
mat_disable_bloom 1 //disables bloom so refract masking doesn't create a dark rectangle over light materials
[/code][/quote]
I know there's at least one other command needed to make it work 100% of the time. Chris's maxframes and comanglia's config both come with whatever command, but I know chris's maxquality (and probably just default tf2) will break it occasionally. I'll try to find it but in the meantime I'd stick with configs :/
5
#5
3 Frags +

nice find

nice find
6
#6
7 Frags +

Can I just put in that this doesn't seem to work for dx 8. In dxlevel 80, it is just a white screen, and in dxlevel 81 some crazy disco colour thing happens. It's fine in dxlevel 90 though.

Can I just put in that this doesn't seem to work for dx 8. In dxlevel 80, it is just a white screen, and in dxlevel 81 some crazy disco colour thing happens. It's fine in dxlevel 90 though.
7
#7
0 Frags +

Kinda sad it does not work in dxlevel 81, maybe there is something you need to do with the material files to make them work properly in lower dxlevels?

Kinda sad it does not work in dxlevel 81, maybe there is something you need to do with the material files to make them work properly in lower dxlevels?
8
#8
1 Frags +

If someone does find a fix for dx 8, please share.
Thanks

If someone does find a fix for dx 8, please share.
Thanks
9
#9
0 Frags +

nice!

nice!
10
#10
1 Frags +

Does the .vmt properties differ depending on dxlevel?

Does the .vmt properties differ depending on dxlevel?
11
#11
2 Frags +
digitalpantherIf someone does find a fix for dx 8, please share.
Thanks
UltrazDoes the .vmt properties differ depending on dxlevel?

On dx8 the refract shader doesn't work. You could setup a fallback material but that'd just get rid of the full white issue, not make masking work. I haven't tested some of the more obscure shaders (find their names in \common\Team Fortress 2\hl2\hl2_misc_dir.vpk\shaders\ ) but I'd assume if refract wouldn't work then the more specific shaders that act like refract wouldn't either.

[quote=digitalpanther]If someone does find a fix for dx 8, please share.
Thanks[/quote]
[quote=Ultraz]Does the .vmt properties differ depending on dxlevel?[/quote]
On dx8 the refract shader doesn't work. You could setup a fallback material but that'd just get rid of the full white issue, not make masking work. I haven't tested some of the more obscure shaders (find their names in \common\Team Fortress 2\hl2\hl2_misc_dir.vpk\shaders\ ) but I'd assume if refract wouldn't work then the more specific shaders that act like refract wouldn't either.
12
#12
3 Frags +

I wonder how long until someone uses a variation of this to cheat.

I wonder how long until someone uses a variation of this to cheat.
13
#13
huds.tf
2 Frags +

This is pretty cool, but I'm hoping Valve don't see this as a reason to fix the custom materials workaround.

This is pretty cool, but I'm hoping Valve don't see this as a reason to fix the custom materials workaround.
14
#14
Momentum Mod
6 Frags +

quake tf2 and now transparent viewmodels

never fix these things PLS

quake tf2 and now transparent viewmodels

never fix these things PLS
15
#15
10 Frags +
WithADanceNumberI wonder how long until someone uses a variation of this to cheat.

Exactly how could you cheat with this method? All you can do is REMOVE things in the hud and viewmodels.

[quote=WithADanceNumber]I wonder how long until someone uses a variation of this to cheat.[/quote]
Exactly how could you cheat with this method? All you can do is REMOVE things in the hud and viewmodels.
16
#16
1 Frags +

well those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.

well those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.
17
#17
0 Frags +

Does anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.

Normal:
http://steamcommunity.com/sharedfiles/filedetails/?id=369759364

Bleeding:
http://steamcommunity.com/sharedfiles/filedetails/?id=369759374

This is with the config settigns from the OP.

Does anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.

Normal:
http://steamcommunity.com/sharedfiles/filedetails/?id=369759364

Bleeding:
http://steamcommunity.com/sharedfiles/filedetails/?id=369759374

This is with the config settigns from the OP.
18
#18
-2 Frags +

Doesn't seem to be working for me :(

Pretty sure it's because I couldn't find HUDLayout.res and created a file in tf\scripts. Does this work on sv_pure servers?

Help please?

Edit: Found the proper HUDLayout.res file and added the text to the bottom, but still not working--any ideas? Thanks!

Doesn't seem to be working for me :(

Pretty sure it's because I couldn't find HUDLayout.res and created a file in tf\scripts. Does this work on sv_pure servers?

Help please?

Edit: Found the proper HUDLayout.res file and added the text to the bottom, but still not working--any ideas? Thanks!
19
#19
1 Frags +
komorebiTo put it in layman's terms: one is putting a transparent screen underneath their health and ammo that refracts light such that everything underneath it is transparent. Since your viewmodels are technically considered a part of your hud (??) they are partially transparent. This does not affect the actual tf2 map you are playing on, just your viewmodels. Here's how to add this feature into any hudWithADanceNumberwell those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.

i dont think its possible with world textures like walls

[quote=komorebi]To put it in layman's terms: one is putting a transparent screen underneath their health and ammo that refracts light such that everything underneath it is transparent. Since your viewmodels are technically considered a part of your hud (??) they are partially transparent. This does not affect the actual tf2 map you are playing on, just your viewmodels. Here's how to add this feature into any hud[/quote]

[quote=WithADanceNumber]well those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.[/quote]

i dont think its possible with world textures like walls
20
#20
0 Frags +

sweet

cheers

sweet

cheers
21
#21
0 Frags +
WithADanceNumberwell those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.

The material used is just a simple texture that by luck will get rid of viewmodels (and hud elements but that's not really relevant here). It's not possible, unless there's some really trippy shader that I don't know about.

DreamerDoes anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.

The bleed overlay is a refract material that the game's set up to also refract viewmodels.

I don't know of any proper fix but I just disable them entirely with clean tf2's _misc_removal.vpk.

[quote=WithADanceNumber]well those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.[/quote]
The material used is just a simple texture that by luck will get rid of viewmodels (and hud elements but that's not really relevant here). It's not possible, unless there's some really trippy shader that I don't know about.

[quote=Dreamer]Does anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.[/quote]
The bleed overlay is a refract material that the game's set up to also refract viewmodels.

I don't know of any proper fix but I just disable them entirely with clean tf2's _misc_removal.vpk.
22
#22
14 Frags +

http://cloud-4.steamusercontent.com/ugc/537384367518089584/ACD0041C683B59CD7F3CB50939BEF9A8C4CDF3F9/

[img]http://cloud-4.steamusercontent.com/ugc/537384367518089584/ACD0041C683B59CD7F3CB50939BEF9A8C4CDF3F9/[/img]
23
#23
newbie.tf
3 Frags +

that was fast.

edit: can you actually see players on the other side of it though?

that was fast.

edit: can you actually see players on the other side of it though?
24
#24
2 Frags +

yes
I just want to add that it only works on some spawn doors. When I was playing it seemed to work mostly on enemy team spawn doors, and some doors only were transparent at certain angles.

yes
I just want to add that it only works on some spawn doors. When I was playing it seemed to work mostly on enemy team spawn doors, and some doors only were transparent at certain angles.
25
#25
3 Frags +
Sentienthttp://cloud-4.steamusercontent.com/ugc/537384367518089584/ACD0041C683B59CD7F3CB50939BEF9A8C4CDF3F9/KevinIsPwnthat was fast.

ye didnt think it would actualy do anything to world textures :O

[quote=Sentient][img]http://cloud-4.steamusercontent.com/ugc/537384367518089584/ACD0041C683B59CD7F3CB50939BEF9A8C4CDF3F9/[/img][/quote]

[quote=KevinIsPwn]that was fast.[/quote]

ye didnt think it would actualy do anything to world textures :O
26
#26
3 Frags +

jarkin is a hud god

jarkin is a hud god
27
#27
0 Frags +
JarateKingWithADanceNumberwell those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.The material used is just a simple texture that by luck will get rid of viewmodels (and hud elements but that's not really relevant here). It's not possible, unless there's some really trippy shader that I don't know about.
DreamerDoes anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.The bleed overlay is a refract material that the game's set up to also refract viewmodels.

I don't know of any proper fix but I just disable them entirely with clean tf2's _misc_removal.vpk.

Okay I did this and it works. Thanks. It still causes the viewmodel to not be transparent when you bleed, but removing that blur is very nice.

[quote=JarateKing][quote=WithADanceNumber]well those custom materials that are used. what if someone uses world model ones that have a property that shows through walls or something? IDK if thats even possible but i mean these are pretty impressive.[/quote]
The material used is just a simple texture that by luck will get rid of viewmodels (and hud elements but that's not really relevant here). It's not possible, unless there's some really trippy shader that I don't know about.

[quote=Dreamer]Does anyone know why bleeding causes the viewmodel to no longer be transparent? It also causes motion blur on every tick of bleeding. It doesn't seem to affect ubers, regular damage, or fire damage. Just bleeding.[/quote]
The bleed overlay is a refract material that the game's set up to also refract viewmodels.

I don't know of any proper fix but I just disable them entirely with clean tf2's _misc_removal.vpk.[/quote]

Okay I did this and it works. Thanks. It still causes the viewmodel to not be transparent when you bleed, but removing that blur is very nice.
28
#28
-1 Frags +

http://cloud-4.steamusercontent.com/ugc/538510267428385174/BA2FE575BEA92C1A7018E55C02F89E7050833067/1024x576.resizedimage

no killfeed, health, ammo, damage text or crosshair. help?

edit: didn't found out the problem but found out the source, i copy/paste

"TransparentViewmodelMask"
{
//alpha doesn't work for this, you need to change the texture's alpha
"ControlName" "ImagePanel"
"fieldName" "TransparentViewmodelMask"
"xpos" "0"
"ypos" "0"
"zpos" "-100"
"wide" "f0"
"tall" "480"
"visible" "1"
"enabled" "1"
"image" "replay/thumbnails/REFRACTnormal_transparent"
"scaleImage" "1"
}
to hudlayout and it gets like the image above

[img]http://cloud-4.steamusercontent.com/ugc/538510267428385174/BA2FE575BEA92C1A7018E55C02F89E7050833067/1024x576.resizedimage[/img]

no killfeed, health, ammo, damage text or crosshair. help?

edit: didn't found out the problem but found out the source, i copy/paste

"TransparentViewmodelMask"
{
//alpha doesn't work for this, you need to change the texture's alpha
"ControlName" "ImagePanel"
"fieldName" "TransparentViewmodelMask"
"xpos" "0"
"ypos" "0"
"zpos" "-100"
"wide" "f0"
"tall" "480"
"visible" "1"
"enabled" "1"
"image" "replay/thumbnails/REFRACTnormal_transparent"
"scaleImage" "1"
}
to hudlayout and it gets like the image above
29
#29
1 Frags +

I even specifically said to make sure to not mess up any brackets when you paste it into hudlayout :<. That's almost certainly what you're doing wrong when you copy-paste. The only other possible answer is if you're on a mac, post back if you are.

I even specifically said to make sure to not mess up any brackets when you paste it into hudlayout :<. That's almost certainly what you're doing wrong when you copy-paste. The only other possible answer is if you're on a mac, post back if you are.
30
#30
-2 Frags +

the thing is when i delete that everything goes back to normal

heres my my hudlayout
also using dx8 (if it is relevant)

the thing is when i delete that everything goes back to normal

heres my [url=http://www51.zippyshare.com/v/12273061/file.html]my hudlayout[/url]
also using dx8 (if it is relevant)
1 2 3 4 ⋅⋅ 6
Please sign in through STEAM to post a comment.