Jump to content

Sprites on terrain from EasyGen


Recommended Posts

Hello guys. I have a problem with sprites on my map and I'm slowly getting desperate.

I've generated terrain with EasyGen and wanted to work on shaders a bit, I've added q3map_material to each of them - no issues. Then I wanted to add some custom sprites (I've used them before as regular shaders and everything was fine).

The problem is that the sprites do show up in game but very randomly. For testing purposes I've added them to an unblended grass texture only. In theory, sprites should cover 100% of this texture when it's not blended with any other texture, but it's not the case. The sprites show up on some random terrain triangles here and there throughout the map, the slope doesn't seem to matter (they appear on bigger slopes and on flat triangles, as well). The texture on which they appear is right, but the coverage definitely isn't.

I've checked if, for whatever reason, the sprites are rendered underground, but they are not.

Does anyone know what's going on here? Can this be fixed somehow? I'd like to have a nice full coverage, not some random tufts of grass. This is how it looks in game:

Spoiler

spacer.png

This is the shader that I'm using for sprites:

Spoiler

textures/willa_teren/terrain_2
{
    q3map_baseshader textures/willa_teren/terrain_base
    qer_editorimage textures/elia/ground_grass0.jpg
    q3map_material    ShortGrass
    cull    twosided
    {
        map $lightmap
    }
    {
        map textures/elia/ground_grass0.jpg
        blendFunc GL_DST_COLOR GL_ZERO
    }

   {
        map textures/Elia/grass_sprite
            surfaceSprites vertical 20 30 15 4000
        ssFademax 5000
        ssFadescale 1
            ssVariance 0.5 1
            ssWind 0.5
        alphaFunc GE192
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        depthWrite
        rgbGen vertex
    }
}

 


And this is how this shader was originally rendered by EasyGen:

Spoiler

textures/willa_teren/terrain_2
{
    q3map_baseshader textures/willa_teren/terrain_base
    qer_editorimage textures/elia/ground_grass0.jpg
    {
        map textures/elia/ground_grass0.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

 

 

EDIT: I've found a solution to this, can post it later if anyone's interested.

Edited by Elia
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...