First of all, this is for a Minecraft themed map. So if you have any moral objections to being an accessory to such a crime, feel free to ignore this thread.
I was poking around the Valve Developer Wiki today and I ran across something that, at first glance, looked like it would be a tremendous help in rendering biome grass properly. For those uninitiated, in Minecraft, the color of grass varies by what biome of the map you're in, with large patches in a particular shade of green and soft fades between them, like so.
As far as I can tell, the grass is rendered by applying a solid shade of green to each block and then overlaying a standard gray noise texture in multiply mode. I could just make dozens of different textures for all the intermediate shades, but I think I found an elegant solution in the form of an obscure Source shader called LightmappedTwoTexture. What it supposedly does is let you specify two texture files and it will overlay one on top of the other in multiply mode. Easy-peasy. So I figure, I'll just make a "grass map" where each block is represented by one pixel, set that as the base texture scaled up 16 times, and then use the gray noise texture as my second texture.
Right now my VMT looks like this:
Which is how I'm supposedly meant to do it. But for some reason, it's not working. It's only rendering the base texture, a solid green. Any idea what's up? Does the TF2 engine even support this shader? It's not even officially documented; the closest thing in the Developer Wiki is UnlitTwoTexture, but I assume the syntax is supposed to be the same.
I was poking around the Valve Developer Wiki today and I ran across something that, at first glance, looked like it would be a tremendous help in rendering biome grass properly. For those uninitiated, in Minecraft, the color of grass varies by what biome of the map you're in, with large patches in a particular shade of green and soft fades between them, like so.
As far as I can tell, the grass is rendered by applying a solid shade of green to each block and then overlaying a standard gray noise texture in multiply mode. I could just make dozens of different textures for all the intermediate shades, but I think I found an elegant solution in the form of an obscure Source shader called LightmappedTwoTexture. What it supposedly does is let you specify two texture files and it will overlay one on top of the other in multiply mode. Easy-peasy. So I figure, I'll just make a "grass map" where each block is represented by one pixel, set that as the base texture scaled up 16 times, and then use the gray noise texture as my second texture.
Right now my VMT looks like this:
Code:
"LightmappedTwoTexture"
{
"$basetexture" "minecraft/grass_base_plains"
"$texture2" "minecraft/grass_overlay"
"$surfaceprop" "Grass"
}