terrain-blending problem


(walk_on_sky) #1

hello everyone! im new to this forum, but i was reading many post the last days and weeks… but i didnt find anything like the problem im having…

i tried to do some terrainblending… i used the technique described on socks site (http://www.simonoc.com/pages/articles/terrain1_1.htm)

my shader looks like that:


//-----------------------------------------------------------
//-------Terrain---------------------------------------------
//-----------------------------------------------------------

//grastextur-hoher bewuchs-blending mud
textures/baserace/grass_01-mud_01
{
        qer_editorimage textures/baserace/grass_01-mud_01.tga

        //foliage
        //q3map_terrain
        //q3map_foliage models\baserace\w_grass_foliage3.md3 0.5 4 0.0125 2
        //q3map_foliage models\baserace\w_grass_foliage1.md3 0.25 4 0.0125 2
        //q3map_foliage models\baserace\w_grass_foliage2.md3 0.35 4 0.0125 2
        //q3map_foliage models/mapobjects/plants_sd/mil.md3 1 16 0.0125 2
        // q3map_foliage <model> <scale> <density> <odds> <use inverse alpha>
        //foliage end

        surfaceparm grasssteps

    q3map_nonplanar
    q3map_shadeangle 120
    q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
    q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 )
    
    {
        map textures/baserace/grass_01.tga    // Primary
        rgbGen identity
    }
    {
        map textures/baserace/mud_01.tga    // Secondary
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaFunc GE128
        rgbGen identity
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
        rgbGen identity
    }
}

and my -bat-file to compile like that:


"C:\Programme\Mapping-Tools\q3map2_fs_20g\q3map2_fs_20g.exe" -meta -fs_basepath "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory" -game et "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory\etmain\maps\foliagetest.map"
"C:\Programme\Mapping-Tools\q3map2_fs_20g\q3map2_fs_20g.exe" -vis -fs_basepath "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory" -game et "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory\etmain\maps\foliagetest.bsp"
"C:\Programme\Mapping-Tools\q3map2_fs_20g\q3map2_fs_20g.exe" -light -patchshadows -samples 2 -fs_basepath "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory" -game et "C:\Programme\Mapping-Tools\Wolfenstein - Enemy Territory\etmain\maps\foliagetest.bsp"

but in the game (ET), it doesnt loke like in the tutorial:


the box in front has the grass-texture without any shaders on it, the floor has the same texture but with the shader i posted…

does anyone know why the shaded texture gets so bright?

thank you in advance

walk_on_sky


(obsidian) #2

Dotproduct works by multiplying your surface normal with the specified dp vector. You don’t have any variances in surface normals (your terrain is perfectly flat) so you don’t have any blending.

You can also try using alphaMod volume brushes to manually set the vertex alpha.


(walk_on_sky) #3

thanks for replying… but i think i didn’t explained my problem well enough…:
there is blending (grass to gravel) but the textures are much too bright… the little box in my screenshot is the way it should be and the floor is like i dont want it to be…

i knew that i wont have any dotproduct2 blending on a flat terrain… and so i already used alphamod volume-brushes for this test… the blend in the screen is a result of that…

walk_on_sky


(obsidian) #4

What do you mean by “too bright”? I don’t think you mean to say anything about the lighting in that screenshot, because it looks fine.

If you mean to say that you wanted the texture to be predominantly grass with bits of rocks blending in, then you should just reverse the two texture maps (and adjust your alpha channels to suit).


(walk_on_sky) #5

so, i solved my problem with help from another forum and some tries with different textures.
the problem was caused by a missing alpha-channel in the second texture (the blended one) that i used… when i used one with an alpha-channel, everything just worked fine…

thank you for helping

walk_on_sky


(ACROBAT) #6

Walk on the sky- did you used to play jk2? Were you in a clan something like CW- WalksontheSky or soemthing?


(walk_on_sky) #7

@acrobat: no i never played jk2 regularly, i only tried it with a friend… but i’ve never been in any clan by now :wink: