Creating new material types


OJN
06-24-2007, 09:50 AM
Is it possible to create a new material type (like brick, wood, or rock) with very specific properties? How would you go about changing the friction on the material (for an ice like effect), changing the hitsounds, or changing how it seals the level? Or are we stuck with the default materials in the dods gcf?

I checked the valve developer wiki. They have an article on creating materials, not material types.

Watevaman
06-24-2007, 12:20 PM
Texture References

"$basetexture" "path to base texture"
Basic color map.
"$basetexture2" "path to 2nd base texture"
Used for the WorldVertexTransition shader.
"$bumpmap" "path to normal map"
Defines normal vectors for lighting purposes and for envmap distortion
"$bumpmap2" "path to normal map"
Used for the WorldVertexTransition shader.
"$parallaxmap" "path to height map"
Use for parallax mapping. Not functional.
"$texture2" "path to 2nd base texture"
Used for "twotexture"-type shader.
"$detail" "path to detail texture"
Greyscale image usually used at higher resolution to add detail to the base texture. Used in conjunction with "$detailscale".

[edit]
Texture Adjustment

"$bumpscale" <float>
"$parallaxmapscale" <float>
"$detailscale" <float>
Number of times the detail texture will scale in the base texture.
"$basetexturetransform" "center <float> <float> scale <float> <float> rotate <float> translate <float> <float>"
"$basetexturetransform2" "center <float> <float> scale <float> <float> rotate <float> translate <float> <float>"
"center" and "translate" are in UV 0..1 coordinates, "rotate" is in angles.
You must include all variables. The defaults are: center .5 .5 scale 1 1 rotate 0 translate 0 0.

[edit]
World Interaction

"$surfaceprop" "surface property"
Defines the gib types and impact sounds of the material. See Material Surface properties for more information.

[edit]
Reflections

"$basealphaenvmapmask" 1
Uses $basetexture's alpha channel as an envmap mask.
"$envmap" "env_cubemap"
Uses nearest env_cubemap for reflection.
"$envmapcontrast" float
contrast 0 == normal 1 == color*color. Adjusts dynamic range of env_cubmap. Use higher contrasts to diminish relatively darker areas, increase "hot spots".
"$envmapmask" "texture"
"$envmapmaskscale" float
"$envmapmode" 1
"$envmapsaturation" float
saturation 0 == greyscale 1 == normal
"$envmapsphere" 1
"$envmaptint" "[float float float]"
Scales the red, green, and blue components of the envmap.
"$normalmapalphaenvmapmask" 1
Masks the envmap according to the alpha channel of the normal map.

[edit]
Lighting/Rendering

"$additive" 1
Renders the texture additively (Its colors are added to, instead of replacing, what is displayed behind it).
"$color" "[float float float]"
Scales red, green, and blue components of the material.
"$halflambert" 1
Improves shading quality dramatically.
"$nocull" 1
Make the surface two-sided.
"$selfillum" 1
Uses $basetexture's alpha channel to set minumum clamps on the lighting.

[edit]
Opacity

"$translucent" 1
Used with "UnlitGeneric", "VertexlitGeneric", "LightmappedGeneric" and many more shaders to enable a opacity map according to the alpha channel of the "$basetexture" targa.
"$alphatest" 1
Alphatesting: Every pixel with an alpha value less than 178 will be completely transparent ingame. (However, values close to this value will confuse the shader at distances.) This type of shading costs much less than translucent shading [1] (http://www.chatbear.com/board.plm?a=viewthread&t=697,1113959073,6037&id=839735&b=4986&v=flatold).
"$alpha" float
Scales material opacity by the 'float' number.

[edit]
Other

"$decal" 1
Needed for a material to be rendered as a decal. See Creating Decals.
"$model" 1
Used on materials applied to models (used with "UnlitGeneric", "Refract" and others).
"$writeZ" 1
Only used by materials using the modulation shader. Setting $writeZ to 1 forces the material to set the z value in the depth buffer (so things z-buffer against it). By default, the modulation shader doesn't set the z value.


This is a list of everything that can go into the .vmt to modify the way a texture acts. (you've probably seen it) The World Interaction area is what you're looking for.

Here's the main Wiki page:
http://developer.valvesoftware.com/wiki/Shader_Types_and_Parameters

And the list of Material Surface Properties:
http://developer.valvesoftware.com/wiki/Material_surface_properties

OJN
06-24-2007, 08:44 PM
I am aware of that list. I am looking to create a custom surface property. Is that possible with the current engine, or am i stuck with that list?

Sly Assassin
06-24-2007, 11:43 PM
Unless the suface property is already coded in you'll be stuck with the current ones unless you code your own.

Zyndrome
06-24-2007, 11:53 PM
You can extract the existing materials, change its properties and save them as different files, and just include them in your BSP.

Watevaman
06-25-2007, 08:11 AM
I am aware of that list. I am looking to create a custom surface property. Is that possible with the current engine, or am i stuck with that list?

Sorry, I thought you meant simply changing the prop to another one.

Well, no offense here, but what kind of material are you trying to create that isn't already on that list?

Colonel_Krust
06-25-2007, 08:53 AM
flubber

happyernst
06-25-2007, 10:01 AM
same with the wood ladder sound

OJN
06-25-2007, 12:55 PM
I am working on a map and one of it's major features is spammable walls. The only way I was able to do this was to rebadage textures as glass instead of their standard type. I did it this way:

This is for the texture spammable_stonewall005

"LightmappedGeneric"
{
"$baseTexture" "stone/stonewall005"
"$surfaceprop" "glass"
}

Glass has the spammable properties I want, but it has incorrect hitsounds, lower than normal friction, and does not seal the level. I am looking to create a material type that fixes these problems. My goal is to either make a single new texture with some neutral hitsound, or make several new ones with the correct hitsounds, spammable_wood, spammable_plaster, etc.

I am asking how to code my own in such a way that I can pack it with my bsp or give it to other people to use in their maps.

fishy
06-25-2007, 03:23 PM
shouldn't you just use a func_breakable, textured with whatever, and set the gib amount, gib type etc?

f64
06-27-2007, 08:09 PM
Exactly what do you mean by "spammable walls"?

Guyver
06-27-2007, 08:32 PM
Exactly what do you mean by "spammable walls"?
Walls that you can shoot through I'm guessin'.

Colonel_Krust
06-28-2007, 03:32 AM
something flimsy yet flexible that can be shot thru without being destroyed....Like a big wall of insulation.....=).

what texture are the panels on argentan?

Dash
06-28-2007, 06:35 AM
You can't create new material types, that's been said already, since you'd need to code them in, and make your own version of DOD as there is no way to include new material types in maps, so that's something you can forget about.

As for a possible solution, how about using a func_detail wall sandwiched between 2 very thin walls?

Furyo
06-28-2007, 07:18 AM
If you're looking for walls you can shoot through, just convert them to func_illusionary....

f64
06-28-2007, 06:14 PM
If all you want to do is be able to shoot thru the wall, make a sample map and test different thickness brushes with the texture of your choice.

I did that some time back to see which weapons could penetrate a wall but I must have discarded the .vmf.

I recall that a 20 unit brush or thinner could be penetrated by an mg42.
A k98 was 16 or less I believe. Test it out if you get bored :)

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.