Custom scrolling/animated water overlay help

Got problems with your models? Struggling with textures? Get help with your custom assets.

Custom scrolling/animated water overlay help

Postby blackmantis357 on Sat Dec 08, 2012 12:37 pm

I'm currently trying to create a simple texture for use on brushes (walls, floors etc), which would have a diffuse texture, (ie bricks, concrete) and a normalmap scrolling over the top of it to give the impression of water running along it, much like it would on a really rainy day.

Is anyone able to help me with this? So far, I've tried a few different things, but here's my standard VMT;

"LightmappedGeneric"
{
"$basetexture" "academy/concretefloor01"
"$bumpmap" "academy/rainy/Rainy_normal1"
"$envmap" "env_cubemap"
"$envmapmask" "academy/concretefloor01_mask"
"$surfaceprop" "concrete"

"$envmapsaturation" 1
"$envmapcontrast" 1
"$envmaptint" "[ .75 .75 .75]"

"Proxies"
{
"AnimatedTexture"
{
"animatedtexturevar" "$bumpmap"
"animatedtextureframenumvar" "$bumpframe"
"animatedtextureframerate" 30.00
}
"TextureScroll"
{
"texturescrollvar" "$bumptransform"
"texturescrollrate" .57
"texturescrollangle" -90
}
}
}

The problem I'm getting is that source reports that it is unable to initialize any of the proxies as follows;

Error: Material "maps/testmap_rainypavement/academy/concretefloor01_rainy" : proxy "TextureScroll" unable to initialize!

I guess it's a limitation of LightmappedGeneric, any help would be mega appreciated! :D
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby marnamai on Sat Dec 08, 2012 10:40 pm

Dunno if this helps, but I made this one for a fake water stream with 2 scrolling normal maps.
Code: Select all
"Refract"
{
   "$normalmap"         "nature/cave_stream_01"
   "$normalmap2"         "nature/cave_stream_02"   
   "$surfaceprop"         "water"

   "$refractamount"      "0.05"
   "$refracttint"         "[.7.7.75]"
   "$bluramount"         "0.85"
   "$forcerefract"         "1"
   "$nodecal"         "1"

   "Proxies"
   {
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform"
         "texturescrollrate"   "0.25"
         "texturescrollangle"   "180"      
      }
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform2"
         "texturescrollrate"   "0.45"
         "texturescrollangle"   "180"      
      }   
   }
}
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Re: Custom scrolling/animated water overlay help

Postby blackmantis357 on Sun Dec 09, 2012 12:20 am

marnamai wrote:Dunno if this helps, but I made this one for a fake water stream with 2 scrolling normal maps.
Code: Select all
"Refract"
{
   "$normalmap"         "nature/cave_stream_01"
   "$normalmap2"         "nature/cave_stream_02"   
   "$surfaceprop"         "water"

   "$refractamount"      "0.05"
   "$refracttint"         "[.7.7.75]"
   "$bluramount"         "0.85"
   "$forcerefract"         "1"
   "$nodecal"         "1"

   "Proxies"
   {
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform"
         "texturescrollrate"   "0.25"
         "texturescrollangle"   "180"      
      }
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform2"
         "texturescrollrate"   "0.45"
         "texturescrollangle"   "180"      
      }   
   }
}


Thanks for the code, I just gave it a try but it returns these errors;

Code: Select all
Error: Material "maps/testmap_rainypavement/academy/concretefloor01_rainy" : proxy "TextureScroll" unable to initialize!
Requesting texture value from var "$dudvmap" which is not a texture value (material: maps/testmap_rainypavement/academy/stream)


The overlay technically works but the reflection is messed up and I end up seeing a garbled reflection which sort of reflects the envmap, but at the same time, I see things like the menu and other previous water buffers inside it (in other words, no matter where I look at the water from, the reflection does not shift to suit the view.

Image
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby marnamai on Sun Dec 09, 2012 12:31 am

Dudvmap? I don't think you can use that one on anything but water.

https://developer.valvesoftware.com/wiki/Water_(shader)
"Note: The $normalmap command is unique to the Water shader, and uses a normal map. A du/dv map is used for $bumpmap when using the Water shader. The $dudvmap command is obsolete."

I think you're using the wrong shader.
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Re: Custom scrolling/animated water overlay help

Postby blackmantis357 on Sun Dec 09, 2012 12:58 am

marnamai wrote:Dudvmap? I don't think you can use that one on anything but water.

https://developer.valvesoftware.com/wiki/Water_(shader)
"Note: The $normalmap command is unique to the Water shader, and uses a normal map. A du/dv map is used for $bumpmap when using the Water shader. The $dudvmap command is obsolete."

I think you're using the wrong shader.


I'm using refract, the exact code that you posted earlier. I haven't even gotten any references to $dudvmap in the vmt. If I do for the sake of it add "$dudvmap" "academy/rainy/water_dudv1" and refer it to a dudvmap, the error disappears but the water shows up garbled

This is the exact code I'm using:

Code: Select all
"Refract"
{
   "$normalmap"         "academy/rainy/water_normal_ripply1"
   "$normalmap2"         "academy/rainy/water_normal_ripply2"
   "$surfaceprop"         "water"

   "$refractamount"      "0.05"
   "$refracttint"         "[.7.7.75]"
   "$bluramount"         "0.85"
   "$forcerefract"         "1"
   "$nodecal"         "1"

   "Proxies"
   {
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform"
         "texturescrollrate"   "0.25"
         "texturescrollangle"   "180"     
      }
      "TextureScroll"
      {
         "texturescrollvar"   "$bumptransform2"
         "texturescrollrate"   "0.45"
         "texturescrollangle"   "180"     
      }   
   }
}


And if I add a dudvmap to it (even though it's not supported)
Image
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby marnamai on Sun Dec 09, 2012 8:55 am

On which engine version are you making this? I made my example on source 2007.

If you get this error "proxy "TextureScroll" unable to initialize!" it means that function isn't supported for the shader you're using.

Maybe it would be easier to make a simple scrolling lightmappedgeneric texture and place that on a second brush covering the concrete (like 1 unit higher than the concrete surface)


EDIT: I made a test version of a lightmappedgeneric with a scrolling bumpmap but came to the conclusion that a scrolling bumpmap doesn't work on a lightmappedgeneric texture.
Looks like placing a scrolling refracting texture on a second brush in front of the concrete is the only option left.

EDIT 2: I remember gary did something with scrolling rain on glass http://steamcommunity.com/sharedfiles/f ... d=19663916 Maybe he can help
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Re: Custom scrolling/animated water overlay help

Postby kraid on Sun Dec 09, 2012 10:06 am

The problem is indeed that the LightmappedGeneric Shader doesn't support scrolling textures at all.
This might be related to the lightmap calculation it has to perform on it or how the bumpmap is meant to add shadowing details to the surface too.

You'll might need a workarround like a second brush face 1 unit above the other one with a refract or even water material applied to it.

And i just found this one: https://developer.valvesoftware.com/wik ... s_in_Glass

But i cannot give a guarantee that this will work with mods too, since it says: " Not found in released mod code. "
Goldeneye Source v4.2.3
get it now and play for FREE!!!
http://www.goldeneyesource.net
kraid
Been Here A While
Been Here A While
 
Joined: Thu Jan 22, 2009 12:09 pm

Re: Custom scrolling/animated water overlay help

Postby Gary on Sun Dec 09, 2012 3:06 pm

https://developer.valvesoftware.com/wik ... l_Material

You can also put a brush under it tied to a func_reflective_glass with a custom translucent LightmappedReflective material. So you can have reflections in real time. You can have only one of these entities in the PVS at any one time.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Custom scrolling/animated water overlay help

Postby blackmantis357 on Mon Dec 10, 2012 11:31 am

marnamai wrote:On which engine version are you making this? I made my example on source 2007.

If you get this error "proxy "TextureScroll" unable to initialize!" it means that function isn't supported for the shader you're using.

Maybe it would be easier to make a simple scrolling lightmappedgeneric texture and place that on a second brush covering the concrete (like 1 unit higher than the concrete surface)


EDIT: I made a test version of a lightmappedgeneric with a scrolling bumpmap but came to the conclusion that a scrolling bumpmap doesn't work on a lightmappedgeneric texture.
Looks like placing a scrolling refracting texture on a second brush in front of the concrete is the only option left.

EDIT 2: I remember gary did something with scrolling rain on glass http://steamcommunity.com/sharedfiles/f ... d=19663916 Maybe he can help


Thanks, I'll check that out. My version is also circa 2007, I can't quite remember but it was a simple sourcemod I put together around late 2006 or early 2007. It may've even been late 2006 just when EP1 was released.

So far I've come up with this;

http://youtu.be/lcp7lrZeZl0. It'll look nasty unless played in 720p or 1080p. Basically using Lightmappedgeneric, I applied an Animatedtexture (had to change my variable reference in the Animatedtexture area from $normalmap to $bumpmap hurr)

I basically animated the water into a normalmap myself. Extremely happy with how the water splashing onto the street came out at 36 seconds came out.

kraid wrote:The problem is indeed that the LightmappedGeneric Shader doesn't support scrolling textures at all.
This might be related to the lightmap calculation it has to perform on it or how the bumpmap is meant to add shadowing details to the surface too.

You'll might need a workarround like a second brush face 1 unit above the other one with a refract or even water material applied to it.

And i just found this one: https://developer.valvesoftware.com/wik ... s_in_Glass

But i cannot give a guarantee that this will work with mods too, since it says: " Not found in released mod code. "


I had a feeling it might be that. Call it a dumb question but is there a way to create new shaders for Source or does that require original source code etc, or some sort of programming knowledge? I'll check the glass shaders out and see if they have anything useful. I believe there was once a shader called Gooinglass many many many years ago that might be useful as it supported a normal scrolling map but it projected the diffuse over the normal, and the normal was merely to provide the sense of water inside something, I think it was used in Dr Kleiners Laboratory eventually.

Gary wrote:https://developer.valvesoftware.com/wiki/Creating_a_Waterfall_Material

You can also put a brush under it tied to a func_reflective_glass with a custom translucent LightmappedReflective material. So you can have reflections in real time. You can have only one of these entities in the PVS at any one time.


Cheers Gary, will check it out. I have tried a few experiments using an extra brush layer over the top of the surface but it seems to crash my game, perhaps my comp is just lagging behind in the memory department.

Thanks for all your suggestions, will give it a go!
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby nub on Tue Dec 11, 2012 4:10 am

I got this to work one time. Here's the VMT of the texture I made:

Code: Select all
"Refract"
{
    "$refractamount" ".085"
    "$bluramount" "0.5"
   "$scale" "[1 1]"
   "$normalmap" "waterfall/wet_surface_normal"
   "$decal" 1
   Proxies
   {
      TextureScroll
      {
         texturescrollvar $bumpTransform
         texturescrollrate 0.5
         texturescrollangle 270.00
      }
   }
}


You have to create an additional brush for this to look right. Below is a screen shot that shows basically how you do it:

Image

I hope I can explain this as best as possible. Assume the Nodraw brush is a brick wall or something that you want water to cascade down. There's a black brush (the "water" brush) that's 1 unit thick that sits right on the surface of the nodraw brush; and is receded in to the nodraw brush by 1 unit so it's flush. Normally this will cause texture bleeding, but the $decal parameter prevents this and should give you the desired effect. The water brush needs to be tied to func_brush in order to render properly, and the water brush should have the scrolling water texture applied to ONLY the surface you want it to be visible. The other sides of the brush should be nodraw. Otherwise you'll get some fugly looking visuals in various corners and whatnot. I'd also refrain from having this effect meet at outer corners (like on buildings). Might look a bit funky. Not too sure though.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Custom scrolling/animated water overlay help

Postby blackmantis357 on Tue Dec 11, 2012 9:07 am

nub wrote:I got this to work one time. Here's the VMT of the texture I made:

Code: Select all
"Refract"
{
    "$refractamount" ".085"
    "$bluramount" "0.5"
   "$scale" "[1 1]"
   "$normalmap" "waterfall/wet_surface_normal"
   "$decal" 1
   Proxies
   {
      TextureScroll
      {
         texturescrollvar $bumpTransform
         texturescrollrate 0.5
         texturescrollangle 270.00
      }
   }
}


You have to create an additional brush for this to look right. Below is a screen shot that shows basically how you do it:

Image

I hope I can explain this as best as possible. Assume the Nodraw brush is a brick wall or something that you want water to cascade down. There's a black brush (the "water" brush) that's 1 unit thick that sits right on the surface of the nodraw brush; and is receded in to the nodraw brush by 1 unit so it's flush. Normally this will cause texture bleeding, but the $decal parameter prevents this and should give you the desired effect. The water brush needs to be tied to func_brush in order to render properly, and the water brush should have the scrolling water texture applied to ONLY the surface you want it to be visible. The other sides of the brush should be nodraw. Otherwise you'll get some fugly looking visuals in various corners and whatnot. I'd also refrain from having this effect meet at outer corners (like on buildings). Might look a bit funky. Not too sure though.


Awesome technique, thanks for sharing, yeah I might give this a try.

Is there any way to say, duplicate the Lightmappedgeneric shader and modify it to enable texture scrolling or does this require some sort of extensive knowledge?
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby Armageddon on Tue Dec 11, 2012 9:10 am

You'd have to make a custom shader.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Custom scrolling/animated water overlay help

Postby blackmantis357 on Tue Dec 11, 2012 4:14 pm

Armageddon wrote:You'd have to make a custom shader.


Would that be difficult, or does it require some sort of C/C++ knowledge, or could one just duplicate one of the prior shaders and modify it?
User avatar
blackmantis357
Member
Member
 
Joined: Sat Dec 08, 2012 12:28 pm

Re: Custom scrolling/animated water overlay help

Postby fishshapedfish on Tue Dec 11, 2012 5:12 pm

You code them in HLSL. I am not really sure how hard it is, I've never tried it.
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Re: Custom scrolling/animated water overlay help

Postby marnamai on Tue Dec 11, 2012 5:44 pm

https://developer.valvesoftware.com/wik ... aderEditor

it does require a little programming
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium
Next

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users