Please or Register to create posts and topics.

[Solved] Custom water texture

Page 1 of 2Next

Hi there,

I seek some help with my custom water texture.
I created it and replaced to old, dirty looking on with hammer and everything works fine, except the fact that I'm now able to walk on it and it's not animated. So these two things are basically my questions. I also checked out Interlopers.net, but didn't find anything useful (Checked the water, waterfalls and custom textures tutorials).

I attached the .vmf and .vtf files.

Best Regards,
iSpectra

???????????????????????????????????????????????Modding beginner. But ready to learn.
????????????????????????????????????????????????????????Visit my Steam profile!

Your water texture is very basic; the vmt needs to be more complex in order to function properly.

Code: Select all
"LightmappedGeneric"
{
   "$basetexture" "custom/water"
   "$translucent" 1
   "$surfaceprop" "water"
   "$envmap" "env_cubemap"
   "%keywords" "water"
   "%compilewater" 1
   "$abovewater" 1
        "$normalmapalphaenvmapmask" 1
// I'm not too sure about this part; cause I didn't check your vtf yet but probably the problem is in the vmt.
   "Proxies"
   {
      "AnimatedTexture"
      {
         "animatedtexturevar" "$basetexture"
         "animatedtextureframenumvar" "$frame"
         "animatedtextureframerate" 21.00
      }
      "AnimatedTexture"
      {
         "animatedtexturevar" "$bumpmap"
         "animatedtextureframenumvar" "$bumpframe"
         "animatedtextureframerate" 21.00
      }
   }
}

EDIT: this is the most basic water texure possible; not with fancy flow etc, but there are uses where a static water texture is prefered over a nice fancy flowing one. For a flowing one you'll need stuff that's in jose's post. :D

Hi, and welcome to the forums.

First of all, your main problem is the .vmt file. The water texture in Source engine is a shader, not a normal texture. This shader is called "Water". Read here about it. So you can't pretend to use a Lighmappedgeneric as water because the engine will not compile it as so, the engine thinks you have simply made a texture and texture a brush side.

In order to understand how a water material (.vmt) is made, I'd suggest you to check into Valve's materials. There are a lot of them. They're stored into your folder Portal 2/portal2, into a packed .vpk file called pak01_dir.vpk (you can open these with GTFScape).

As an example, look inside a Portal2 water material called Toxicslime_a1_Intro5.vmt below:

Code: Select all
Water
{
$forceexpensive 1
$normalmap "liquids/water_river_normal_sharp"
$flowmap "liquids/sp_a1_intro5_hflowmap"
$flow_normaluvscale 160
$flow_worlduvscale 0.5
$flow_timeintervalinseconds 0.6
$flow_uvscrolldistance 0.1
$flow_bumpstrength 1
$flow_noise_texture "liquids/water_noise"
$flow_noise_scale 0.001
$flow_debug 0
$basetexture "liquids/toxicslime_color"
$color_flow_uvscale 300
$color_flow_timeintervalinseconds 5
$color_flow_uvscrolldistance 0.11
$color_flow_lerpexp 1
$color_flow_displacebynormalstrength 0.01
$reflecttexture _rt_WaterReflection
$reflectamount "0.1"
$reflecttint "{ 240 240 192 }"
$reflectskyboxonly 0
$reflectonlymarkedentities 1

$abovewater 1
$bottommaterial "nature/toxicslime002a_beneath"
$fogenable 1
$fogstart 0
$fogend 100
$lightmapwaterfog 1

$fogcolor "{ 58 35 20 }"
$flashlighttint 1
"%compilewater" 1
"%tooltexture" "nature/water_frame01_normal"
$surfaceprop slime
}

The second problem you have is that you are using a .vtf texture without an alpha channel. This is important because the water shader makes us of the alpha channel to fake the movement...

I hope this will help for starters :thumbup:

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

Hi,

first of all, thank you both for your posts!
@josepezdj: Do you know any custom water tutorial, because the dev. community link doesn't really help me since it's still way to complex for me to understand properly.

Edit: I didn't find the Toxicslime_a1_Intro5.vmt too. I checked the materials/liquids folder.

???????????????????????????????????????????????Modding beginner. But ready to learn.
????????????????????????????????????????????????????????Visit my Steam profile!

Look in the VPK.

Falsi sumus crusto!

@iSpectra: as I told you and also Felix said, you must look into the file pak01_dir.vpk. This is a packed special file that Valve games use: many of the games' files are packed into there, not in common folders outside :wink: Above I told you where it is located and how to open it. I suggest you to check into it and start by modifying any of the stock water materials.

There aren't tutorials for creating custom water materials, only for applying it properly... Be sure you also read the article Adding Water.

The VDC explains what each parameter does, but let me help with what I know:

water parameters

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

Try that material I linked you to and let me know if it works good... As I told you the .vtf you posted has no alpha channel, and the water shader makes use of it to alternate the texture with the noise and flowmap... and to make it looks good with a cool movement.

Ok, now I'm a bit tired of writting, bye :lol:

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

So I used the code and texture you provided me, but I still have a problem. At least I got fancy reflections and flowing animations.

???????????????????????????????????????????????Modding beginner. But ready to learn.
????????????????????????????????????????????????????????Visit my Steam profile!

You could also download some water textures from TopHATTwaffle's website

Big Mood

Even tho that helps me for now, I'd like to know if someone knows why my texture has this weird problem.

???????????????????????????????????????????????Modding beginner. But ready to learn.
????????????????????????????????????????????????????????Visit my Steam profile!
iSpectra wrote:
Even tho that helps me for now, I'd like to know if someone knows why my texture has this weird problem.

because you wrote your vmt wrong is my guess... just copy one from the existing water materials, and change the names boom done... right?



Also, I made a map just for you! Sunset
Click Here to view my Workshop and play my puzzlemaker maps
Page 1 of 2Next