Jump to content
The Dark Mod Forums

Making Water Darker


grayman

Recommended Posts

I've created brown water using the existing *.mtr, *.gui, and texture files as templates.

 

Colored water tends to be bright. It's not so noticeable when the surrounding textures are light or there are plenty of light sources around. But in a darkened area, it stands out, and doesn't appear normal. This is for use in a sewer (of course), and the bright water doesn't look right, given the dingy darkness of its surroundings.

 

I can provide all the gory details if I need to, but I wondered if anyone knew what parameter(s) I could tweak to make the water darker?

 

Thanks.

Link to comment
Share on other sites

Many water materials I have seen use either blend blend or blend add material stages, which do not react to light and will always appear bright in an otherwise-darkened environment.

 

If you specifically want dark water, a blend filter (multiplicative) blend might do what you need.

Link to comment
Share on other sites

Some of the water materials have a specular stage to avoid this, they're naturally dark and when in lighter areas are brightened by the specular layer, there are also some specular water layers without any actual water that you can lay over samples.

 

I'd also look at just decreasing the rgb of the blend stage, i.e halve it and have a look, the water test map has a bunch of different samples laid out for you too :)

Link to comment
Share on other sites

The "blend filter" change gave me darker water. Thanks.

 

I noticed that if you jump into a pool using a thickmurk texture, when you come back out, it looks like the patch overlay that sits on top of the water surface is no longer rendered.

 

Before you jump in, the water is thick and murky, and you can't see things at the bottom of the pool.

 

After you come out, the water is still tinted, but is more transparent. You can easily see what's at the bottom of the pool. The murkiness is gone.

 

I'm working with the startmap pools to test my brown water. I noticed this problem when jumping into and climbing out of my new water, and thought I'd missed something when creating them. But then I jumped into one of the existing murky green pools and the same problem happened.

 

I'm using TDM 1.05 and these graphics settings:

 

 

Ambient Rendering: Enhanced

Interactive Shader: Enhanced

Post Processing: Disabled

 

 

Link to comment
Share on other sites

I always thought that the tdm water doesn't look very realistic. In reality if it's dark outside the water is black and the reflections of lights are really distinguishable. So I tried to make some new water like this: http://img31.imagesh.../i/watermu.jpg/

It's still transparent, that's why you can see the dark line decals on the bottom running from top to bottom of the screen.

 

Normal map:

http://img203.images...rdarklocal.jpg/

I wanted it to somehow oscillate like real waves but I don't know how to do that.

 

This is the material I used, but to be honest I don't really know what it all means :).

 

textures/Flanders/water
{
qer_editorimage textures/water_source/water_dark

noShadows
noselfShadow
//discrete
nonsolid
water
twosided

{
	blend diffusemap
	map textures/water_source/water_dark	
}

{
	blend 	specularmap
	map		textures/Flanders/water_dark_s
	translate time*.0,time*-.01
}

{
	blend 	bumpmap
	map		textures/Flanders/water_dark_local
	translate	0.01 * sintable[time * 0.2], 0.01 * sintable[time * 0.22]
	scale .75 , .75 
	translate time*.0,time*-.01
	rgb	( 100 * sintable [time]) 
}

deform expand 4*sintable[time*0.25]		

{
	vertexProgram heatHazeWithMask.vfp
	vertexParm 0 time * 0.1 , time * 0.5
	vertexParm 1 1
	fragmentProgram heatHazeWithMask.vfp
	fragmentMap 0 _currentRender
	fragmentMap 1 textures/sfx/vp1
	fragmentMap 2 textures/water_source/vp_water
}


}

Link to comment
Share on other sites

See if this helps...

 

textures/Flanders/water
{
qer_editorimage textures/water_source/water_dark

noShadows
noselfShadow
nonsolid
water
deform 	expand 4*sintable[time*0.25]

//twosided - You'll never see this from the underside so no need for two sides
//discrete

{
	blend 	diffusemap
	map 	textures/water_source/water_dark
}

{
	blend 	specularmap
	map 	textures/Flanders/water_dark_s
	translate 	time*.0, time*-.01
}

{
	blend 	bumpmap
	map 	textures/Flanders/water_dark_local
	translate 	0.01 * sintable[time * 0.2], 0.01 * sintable[time * 0.22]
	scale 	.75, .75
	translate 	time*.0, time*-.01
	rgb 	(100 * sintable [time])
}

// The following stage is not needed. It's used to distort the view through the water but since the water is opaque you can't see behind it anyway.

//	{
// 	vertexProgram heatHazeWithMask.vfp
// 	vertexParm 0 time * 0.1 , time * 0.5
// 	vertexParm 1 1
// 	fragmentProgram heatHazeWithMask.vfp
// 	fragmentMap 0 _currentRender
// 	fragmentMap 1 textures/sfx/vp1
// 	fragmentMap 2 textures/water_source/vp_water
//	}

}

Edited by rich_is_bored
Link to comment
Share on other sites

there are also some specular water layers without any actual water that you can lay over samples.

 

I tried this, placing a patch with the specular texture 1 unit above the water surface.

 

It didn't do anything.

 

Is there a trick to using this?

Link to comment
Share on other sites

Real water performs Fresnel reflection, refraction, filtering and scattering of light, in various quantities based on the circumstances. I find it unlikely that fully-opaque water would look good in game, unless it is intended to be extremely dirty. The combined reflection + refraction + filtering water shaders (e.g. Half-Life 2) can look very good, and I believe there are some examples of this for Doom 3 / TDM as well. Scattering is a volumetric effect which does not have any equivalent in material shaders, but can be approximated using an underwater foglight provided it is carefully matched to the surrounding illumination.

Link to comment
Share on other sites

I tried this, placing a patch with the specular texture 1 unit above the water surface.

It didn't do anything.

Is there a trick to using this?

 

Not that I know of, did you check the water test map? iirc they are used on some of the samples there.

 

I have been experimenting with animated water and it's rather damn nice - but it's very tricky to generate good samples; Still trying to find the sweet spots but without writing the generator myself it's pretty damn slow... I think that might be the next step and perhaps I could then include it as a DR plugin, mmm.

Link to comment
Share on other sites

I can't see the video here at work but I think you could have an animated Height map and use addnormals to blend it with an Animated Normal map.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

You could play with "scroll", "translate", "scale" to achieve the effect as well I suppose.

 

It's too bad that "videomap" can't be used :(

 

Well, you can't use addnormals with translate or scale or anything like that, addnormals only accepts two images. I just tried blending two bumpmaps with vertexcolors but it doesn't work for me either. The only thing left I can imagine is something with an alpha channel, but I'm not sure that works for normal maps.

Link to comment
Share on other sites

It's weird that nesting works but this wont? :unsure:

 

textures/add_two_scroll{ 
{ 
blend bumpmap 
map addnormals
( 
{scroll x,y

textures/custom/image_1.tga
},

{scroll x,y

textures/custom/image_2.tga
} 

) 
}
}

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

If that doesn't work then the only way I could imagine this working is:

 

1) Design your wave animation for one direction and write-out the frames as images

2) Do the same for your second set

3) Convert each to a normal map

4) Create two "filmstrips" by chaining the normal maps together into one larger texture like 64x2048 (etc)

5) Create a material stage kinda like

 


{

blend bumpmap 

Addnormals (textures/custom/suchandsuch_A__local, textures/custom/suchandsuch_B_local )

scale size, size
translate time, time

}

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Here's my complete snippet for animated water using a strip:

 

textures/darkmod/serp/animatedtest
{
water
{
	blend bumpmap
	map textures/temp/wavelong
	scroll table32[ time*0.9 ] * 0.03125, 0
}
{
	blend diffusemap
	map	textures/water_source/water_green
}
{
	vertexProgram heatHazeWithMask.vfp
	vertexParm 0 table32[ time*0.9 ] * 0.03125, 0
	vertexParm 1 1.3
	fragmentProgram heatHazeWithMask.vfp
	fragmentMap	0	_currentRender
	fragmentMap	1	textures/temp/wavelong
	fragmentMap	2	textures/water_source/vp_water
}
{
	if (global5 == 2)
	blend add
	program ambientEnvironment.vfp
	vertexParm	0	1, 1, 1, 1	// UV Scales for Diffuse and Bump
	vertexParm	1	1, 1, 1, 1	// (X,Y) UV Scale for specular
	vertexParm	2	global2, global3, global4, 1

	fragmentMap	0	cubeMap env/gen1
	fragmentMap	1	_flat	// Bump
	fragmentMap	2	textures/water_source/water_green	// Diffuse
	fragmentMap	3	_black	// Specular
}
}

 

And here are some sample strip textures : sample1 sample2

 

I didn't get around to the ambient stage, doubt its possible without editing the shader. Looks fine with just the diffuse tho. It's most likely easier to just use the oldschool ambient method for a material like this anyway.

 

The samples are terrible - sample2 is generated by some animated water app which is pretty horrible, sample1 was my attempt at seamless and gapless procedural generation, but the code is a bit broken atm... also it looks horrible :( But if you can make better ones I'm sure it'll look a load better!

Link to comment
Share on other sites

So if you guy's are gonna use Jermi's normal maps from his T2 water mod you would have to merge the frames into a strip that would be in used in place of "textures/temp/wavelong" in the above shader...

 

(Saw Fidcal posts at TTLG) ;)

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

So if you guy's are gonna use Jermi's normal maps from his T2 water mod you would have to merge the frames into a strip that would be in used in place of "textures/temp/wavelong" in the above shader...

 

I've been using animated normals for water running down glass on my map, Fidcal asked about this the other day and I thought I'd dig out some of my testing stuff. But yeah the problem is that the actual water animation is tricky to generate and most of the methods for generating it in 3d modeling apps gives really average results. I'd prefer to get it right the first time. I'm also a bit concerned about performance, but I think it's quite a bit better now that I'm using scroll rather than scale (id use scale for scrolling stuff, but it gives insane microstuttering with larger textures).

Link to comment
Share on other sites

I'll go digging around...

 

Though I would be curious to see how this would look for the Enhanced Ambient:

 

 {

if (global5 == 2)

blend add

program ambientEnvironment.vfp

vertexParm 0 table32[ time*0.9 ] * 0.03125, 0


vertexParm 1 table32[ time*0.9 ] * 0.03125, 0


vertexParm 2 global2, global3, global4, 1

fragmentMap 0 cubeMap env/gen1

fragmentMap 1 textures/temp/wavelong // Bump

fragmentMap 2 textures/water_source/water_green // Diffuse

fragmentMap 3 textures/water_source/vp_water // Specular ?

}

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

It's weird that nesting works but this wont? :unsure:

 

Operations such as scroll and rotate work by modifying the texture coordinates (not the image) at render-time, which is a fast operation. Scrolling individual image components of a compositing operation like "addNormals" would need a new, combined image to be created every frame, which would be a lot slower. Although this could be implemented, it is a very different process to simply putting values in the OpenGL texture matrix, so it's no surprise that the texture motion stage-keywords don't work inside addNormals.

Link to comment
Share on other sites

Just some idea I was kicking around. Is this nutty?:

 

script:

 

void loopWater
{
float frame = 1;
setShaderParm(1,frame() );
frame++;
if (frame >=21) {frame = 1;}
sys.wait(0.05);
}

 

 

material:

 

    {
       if ( parm1 == 1 )
       blend       diffusemap (could be bumpmap)
       map         frame1
   }

  {
       if ( parm1 == 2 )
       blend       diffusemap (could be bumpmap)
       map         frame2
   }

and so on...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...