Please or Register to create posts and topics.

VTFEDIT HELP

I can do a few things with vtf edit such as editing portalgun textures or player textures but then there are some things that seem to have an invisible background like in a decal. I used photoshop to delete the background around the decal but once I finish opening the texture in hammer all around the texture is white.

Also I could use some help learning a few command lines for vmt files, again I know a few but I am limited to those few atm.

Image

You have to add an alpha channel, where white is visible/lit and black is invisible/unlit.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!
radelite wrote:
I used photoshop to delete the background around the decal but once I finish opening the texture in hammer all around the texture is white.

If you are sure that your texture's background is transparent, then all you need is to add the parameter $decal 1 and $translucent 1 inside your .VMT. That should do.

radelite wrote:
Also I could use some help learning a few command lines for vmt files, again I know a few but I am limited to those few atm.

Well, you have some information on the wiki, however, I'll try to tell you some basic knowledge so that you can have a first overview.

(Post to be edited in some minutes....)

EDIT

OK, let's go. Take a quick look to these 2 examples first:

Image Image

THE SHADER

First thing you want to set up into your .VMT is the shader you'll want the engine to use to render your texture. This is declared at the very beginning of your .VMT. You then need to open a bracket for a block of code, then put all the parameters you want to control and set up, and then use another bracket to close the block.

The most commonly used shader is the Lightmappedgeneric. This is the one you'll use for almost all the textures in your map. When the compile (VRAD) finds this shader, it gathers the lighting surrounding each surface textured with your texture and it stores this information into a lightmap (thus the name of the shader "Lightmappedgeneric") which is fixed to that surface. VRAD does that for each of your map's surfaces textured with a Lightmappedgeneric texture. Lightmaps are static, meaning that the lighting stored for each of these surfaces won't ever change in game; anyways, these surfaces can still cast more lighting or shadows coming from an env_projectedtexture, which has dynamic values that can change in game.

You've surely seen another shader called VertexlitGeneric. This is a shader to render model's textures. It uses the player's position to set an amount of lighting and reflections on the model (try not to use some textures ended up with "_vertex" because you will see them behaving weird in game due to how this specific shader is managed)

Other important shader is UnlitGeneric. It does what it says, it doesn't store the lighting information into lightmaps based in the surrounding lighting when compiling, but the lighting information from the texture itself, and that's why is named Un-lit-generic. This can make it glow in the dark (which means that it has a light independent from its environment). You tipically know it from the Portal2 indicator lights textures.

One of my favourite shaders is the Refract one. You can basically create a refracting material that distort what is seen through it. With the use of some material proxies to animate a bumpmap you can even fake a waterfall or a wall of water. I've made some cool textures by using this shader already, any problem you find with it, just tell me and I'll try to help you out.

Some other interesting shaders are the "SolidEnergy" (sry, linking you to an old post of mine because of the lack of information on the wiki ;)) shader (used for the textures of the fizzlers, laserfields, light bridges...), "UnlitTwoTexture" (used to mix 2 different textures; note the part of "Unli", similar behavior than the UnliGeneric), "WorldVertexTransition" (used for blending textures on displacements), "WorldTwoTextureBlend".... You can take a look to the existing shaders.

SOME PARAMETERS

Depending on the chosen shader you'll have some parameters available and others not. Also, there will be some of them specifically made for only a given shader... The simplest shader is the UnlitGeneric since too few params are available (because by concept, it is self-setup). Let me tell you about some interesting parameters:

- $translucent: it admits a boolean value, 1 (= ON) or 0 (= OFF). The alpha channel of your texture will set the translucency information of each part (pixel) of your texture. The parts you set as transparent in the alpha channel won't be visible, and also the transparency level per pixel will taken into account to show them mmore/less in game.

- $selfillum: it admits a boolean value, 1 (= ON) or 0 (= OFF). This will make your texture to be self illuminated if set to "1". This is also very interesting to have glowing textures in the dark. You can also set what should be glowing and what shouldn't be via the alpha channel of your texture ;)

- $bumpmap: it sets the path to a bump (first image on the left) or a normal (image on the right) map:

Image Image

You can fake an enhancement of the relief of your texture with this parameter. You can get awesome results with a good bumpmap or normalmap.

- $ssbump: it admits a boolean value, 1 (= ON) or 0 (= OFF). If set to "1" you tell the engine to use the fake relief of your bumpmap to cerate the shadows (self-shadowing) for your material.

- $reflectivity: This is a very interesting parameter available for the LightmappedGeneric shader. You need to set 3 values between "0" and "1" (for the Red Green and Blue), and they indicate the amount of lighting you want the texture to reflect out, but without having to increase the surrounding lighting in your map. You can use it to increase the level of brightness that a texure will reflect in game: values like [.75 .75 .75] will be brighter than for example [.4 .4 .4]. But you can also use this parameter to make your textures reflect a given colour by not reflecting the same amount of lighting for R G and B. Take a look to this awesome article that explains this very well.

- %noportal: it admits a boolean value, 1 (= ON) or 0 (= OFF). Pretty self-explanatory :p

- %nopaint: it admits a boolean value, 1 (= ON) or 0 (= OFF). If set to "1" you won't be able to paint any surface textured with your texture.

- $detail: path to a detail texture. This is great to give a nice touch to your textures, have you noticed those little dots there are on the white textures in portal? those aren't part of the texture itself, but this detail texture:

Image

Awesome, right? :D

- $decal: it admits a boolean value, 1 (= ON) or 0 (= OFF). If set to "1" it will stay on top of another texture without overlapping.

There are MAAAAANY more....

THE MATERIAL PROXIES

This is by far the most interesting thing regarding textures. The material proxies can make a texture animated in many ways. Take a look to this amazing article and check what you can do ;)

If you take one of the P2 stock textures you'll notice how complex these can become:

dev_tvmonitor1a.vmt

Spoiler
Sorry, only logged-in users can see spoilers.

That was the texture you use with the entity func_monitor, and if you remember, it produces a lot of cool artifacts and realistic TV noise on your monitor... Basically you can create variables and play with their values by setting a lot of arithmetic operations... Here you'll find a list of these material proxies. It takes some time to understand them and be able to achieve the desired animation on your texture, but they worth your time IMHO ;)

I hope this helps you out to understand the material textures a bit more :)

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

WOW thank you so much, this will help me a ton with new textures. Thanks again :D

Image

WAHOOOOOO I finally created a working overlay WAHOOOOO

Image
josepezdj wrote:
everything

Wow, that's friggin useful! Thanks for typing that up. You should post that here. It would be super helpful.

When life gives you lemons, make apple juice and have everyone wonder how you did it.
Musical website Moddb