Jump to content
The Dark Mod Forums

Howto make water less transparent & highlite


Bikerdude

Recommended Posts

So got the following std water material def -

extures/water_source/water_green_nontransparent
{
    qer_editorimage textures/water_source/water_green
    discrete
    nonsolid
    water
    twosided
    noselfshadow
    noshadows

    diffusemap    textures/water_source/water_green
    {
        blend bumpmap
        map    textures/water_source/water_green_local
        translate     0.01 * sintable[time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 0.8)], 0.01 * sintable[time * (( parm5 + 0.1) - (( parm5 || 0) * 0.1))]
        scale 0.5,0.5
    }
    {
        vertexProgram HeatHazeWithMaskAndDepth.vfp
        // 0.1 * 0.4 => 0.04
        vertexParm 0 time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 0.4), time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 2)
        vertexParm 1 (( parm6 + 1.5) - (( parm6 || 0) * 1.5))
        fragmentProgram HeatHazeWithMaskAndDepth.vfp
        fragmentMap 0 _currentRender
        fragmentMap 1 textures/sfx/vp1
        fragmentMap 2 textures/water_source/vp_water
        fragmentMap 3 _currentDepth
    }
}

How do I make is less transparent and not lighten textures under the water level -

 

post-496-0-31371600-1459625071_thumb.jpg

 

Link to comment
Share on other sites

You have to change the shader program to get the desired effect.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

You'll need to use a filtering blend I think. Right now the colour representing the light coming off the water is being added to the colour of the light reflected by the background, so the overall result is brighter than either.

 

If you make your diffuse map a blend of any kind, it'll stop using the bumpmap so that's no good.

 

You could tone down the background by using an extra material stage as the filtering blend, exactly like putting a thin sheet of dark glass just under the water surface:

 

 

textures/water_source/water_green_nontransparent
{
    qer_editorimage textures/water_source/water_green
    discrete
    nonsolid
    water
    twosided
    noselfshadow
    noshadows
    
    // Try to darken the background
    {
        blend filter
        map _white
        rgb 0.5         // 0.0 means fully black. 1.0 won't darken at all
    }
    diffusemap    textures/water_source/water_green
    {
        blend bumpmap
        map    textures/water_source/water_green_local
        translate     0.01 * sintable[time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 0.8)], 0.01 * sintable[time * (( parm5 + 0.1) - (( parm5 || 0) * 0.1))]
        scale 0.5,0.5
    }
    {
        vertexProgram HeatHazeWithMaskAndDepth.vfp
        // 0.1 * 0.4 => 0.04
        vertexParm 0 time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 0.4), time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * 2)
        vertexParm 1 (( parm6 + 1.5) - (( parm6 || 0) * 1.5))
        fragmentProgram HeatHazeWithMaskAndDepth.vfp
        fragmentMap 0 _currentRender
        fragmentMap 1 textures/sfx/vp1
        fragmentMap 2 textures/water_source/vp_water
        fragmentMap 3 _currentDepth
    }
}

 

 

Without testing, I'm not sure whether that'll darken just the background, or the water surface too. I think it'll be just the background, but on second thoughts darkening the water too might look best. To do that you'd move the new stage to after the diffusemap and bumpmap. The idea now is it's only meant to darken the background so it gets listed and drawn first, before the water gets drawn on top. If you move it last, it'll darken the background and the surface.
You can adjust the amount of darkening by changing the rgb 0.5 to any value between 0 (background fully black) to 1 (no darkening at all, like the current shader)
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

      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 )
      · 2 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
       
      · 5 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...