Jump to content

kwenga

Members
  • Posts

    37
  • Joined

Posts posted by kwenga

  1. @@Langerd, you are still missing a point there. :P I CAN remove sprite stage, and yes - shadows, light, etc. will work. I can fix that buggy area and make everything look nice and smooth. Well, I could finish map without it. My point is different though.

     

    When you're using a shader with a SINGLE texture - grass, mud, stones, whatever, you can simply add that whole gfx/sprites part to your .shader file and it will render it on a surface. It is a common technique, so no witchcraft or magic there.

    My case is slightly more complicated. This problematic area is covered by shader which contains TWO blending/mixed textures, so it works different. At that point, I have two options - I could add $lightmap to that shader (creates shadows and all good-looking stuff) OR I could add sprites. In separated cases, it is working. However, I want to add BOTH at the same time, so grass AND lightmap. As @@Xycaleth said, it might be engine related... It might be even impossible, but that's why I'm asking here, looking for an advice from some hardcore modders/mappers/other magicians.

    Besides that. thank you for all responses.

    Langerd likes this
  2. Screenshots won't give you that much of an intel. I know what problem is and I know how to solve it, I just cannot figure out how to include grass thing afterwards. To be fair, I'm not even sure if it is possible, because of the way how .shader file works.

     

    Z5jU8Tu.jpg

     

    This screenshot might be slightly dated, but it still shows how it looks in-game. All bright areas are textured by single textures, both shadows and grass implemented. You can clearly see slightly darker area - that's "terrain_0to2" or other transition from shader file. No lightmap on it.  I can easily fix shadows on that, just by adding $lightmap etc. in .shader file, and it will look fine. But that's not the point - I want to put randomly generated sprites on it too, and there it gets complicated or/and impossible.

  3. I was playing with terrain and shaders in overall, and found major problem. Basically, I don't know how to include both $lightmap and randomly generated grass sprites on the same layer of terrain, which contains transition between two different textures.

    Example below (single texture):

    textures/testmap/terrain_0
    {
        q3map_baseshader textures/testmap/terrain_base
        qer_editorimage textures/yavinvalley/junglefloor.jpg
        q3map_material    ShortGrass
        q3map_nolightmap
        cull twosided
        {
            map $lightmap
        }
        {
            map textures/yavinvalley/junglefloor.jpg
            blendFunc GL_DST_COLOR GL_ZERO
        }
        {
        map gfx/sprites/y_grass_tall
                surfaceSprites vertical 36 36 48 650
                ssFademax 4000
                ssFadescale 1
                ssVariance 1 2
                ssWind 0.3
            alphaFunc GE192
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            depthWrite
            rgbGen vertex
        }
    }

    Single texture, both lightmap and sprites are working very well. No issues with shadows, etc.

     

    Main problem (transition):

    textures/testmap/terrain_0to2
    {
        q3map_baseshader textures/testmap/terrain_base
        qer_editorimage textures/yavinvalley/junglefloor.jpg
        {
            map textures/yavinvalley/junglefloor.jpg
        }
        {
            map textures/yavin/dugdirt.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }
    

    Here comes the problem. I don't know how to include grass sprites in that part of code. Adding it at the end or in the middle just messes everything up - no shadows, no sprites, many bugs and other unpleasant errors. It's not working anyways. I'm pretty sure its something with blendFunc, and since whole .shader file is still some "magic thing" to me, I can't work it out myself. Help would be really appreciated. :)

     

  4. Small, but crucial update - I think I've found solution for glitched triangles. It is not as good as it could be, but in my case it was the only way. It is very easy to fix in easygen (no more searching for glitches in radiant!).

     

    First of all - all glitched triangles were FLAT. As I looked through my maps and experiments, it became obvious that all flat surfaces generated by easygen suffered from errors. If you want to leave some plain terrain for buildings etc., you should do it afterwards in radiant by merging triangles in that perticular area, or by adding extra brush covering/substracting glitched space.

    If you have a map which suffered from errors, and you still have it saved in your easygen (.egn files) directory, you can easily locate and change all flat surfaces by clicking hp9IuuJ.png button, which will highlight plain triangles. Then, you should use optional modifier - smooth, hill, whatever you want, just something which will tilt those triangles and remove red markings. Give it minimal value, so overall look of terrain won't change that much.

     

    I'm still working on that texture problem, so any help would be appreciated.

     

    Edit: Textures fixed. Don't ask how, it's too embarrasing for me. And I was right, it was something VERY obvious.

    Solved!

  5. Okay, I did what you said. Changing values of tcGen ivector did nothing. By definition, ivector "Projects a texture Ns units by Nt units along a chosen axis. q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis", so theoretically it should fix everything. It does not. Higher values, lower values, random values - no effect at all. I'm affraid that I'm missing something very obvious, like forgetting to put shader in pk3 (it took me 3 days when making my first map, to realise why skybox is missing ^^), but I did it so many times it became a routine.

     

    About bmp... I don't have one. I was just playing with easygen without a template or any plans, so all terrain was manually shaped. However, I can export it, easygen has that option.

    From first map: 73x73 pixels, 6,47 KB bitmap

    From second map (with fixed divisions): 65x65, 5,36 KB bitmap

     

    Edit:

    I think it might be overall size of this map, because now I'm looking back at my oldest experiments with easygen, partially implemented to some of my testmaps, and I can't find any missing triangles. Textures are also bigger, but that is because I was afraid of shaders and it was textured triangle by triangle in radiant. ;)

  6. Tested. Changed divisions to 64, div.widt. to 256, height to 4096 (it was a power of 2 in all cases, just to be sure) and my map is still broken. I don't know what to do next.

     

    About shader... here it is. Check it out, maybe you'll find something.

     

     

     

    textures/newres/terrain_base
    {
        nopicmips
        q3map_lightmapaxis z
        q3map_lightmapmergable
        q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
    }

    textures/newres/terrain_0
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_2
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rock3.jpg
        {
            map textures/yavin/rock3.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_3
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/temple_stone2.jpg
        {
            map textures/yavin/temple_stone2.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_4
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/mudside_b.jpg
        {
            map textures/yavin/mudside_b.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rockmossy.jpg
        {
            map textures/yavin/rockmossy.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/marbly.jpg
        {
            map textures/yavin/marbly.jpg
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to1
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/s_mud2.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to2
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/rock3.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to3
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/temple_stone2.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to4
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/mudside_b.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/rockmossy.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_0to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/dugdirt.jpg
        {
            map textures/yavin/dugdirt.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1to2
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map textures/yavin/rock3.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1to3
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map textures/yavin/temple_stone2.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1to4
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map textures/yavin/mudside_b.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1to5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map textures/yavin/rockmossy.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_1to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/s_mud2.jpg
        {
            map textures/yavin/s_mud2.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_2to3
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rock3.jpg
        {
            map textures/yavin/rock3.jpg
        }
        {
            map textures/yavin/temple_stone2.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_2to4
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rock3.jpg
        {
            map textures/yavin/rock3.jpg
        }
        {
            map textures/yavin/mudside_b.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_2to5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rock3.jpg
        {
            map textures/yavin/rock3.jpg
        }
        {
            map textures/yavin/rockmossy.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_2to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rock3.jpg
        {
            map textures/yavin/rock3.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_3to4
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/temple_stone2.jpg
        {
            map textures/yavin/temple_stone2.jpg
        }
        {
            map textures/yavin/mudside_b.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_3to5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/temple_stone2.jpg
        {
            map textures/yavin/temple_stone2.jpg
        }
        {
            map textures/yavin/rockmossy.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_3to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/temple_stone2.jpg
        {
            map textures/yavin/temple_stone2.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_4to5
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/mudside_b.jpg
        {
            map textures/yavin/mudside_b.jpg
        }
        {
            map textures/yavin/rockmossy.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_4to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/mudside_b.jpg
        {
            map textures/yavin/mudside_b.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

    textures/newres/terrain_5to6
    {
        q3map_baseshader textures/newres/terrain_base
        qer_editorimage textures/yavin/rockmossy.jpg
        {
            map textures/yavin/rockmossy.jpg
        }
        {
            map textures/yavin/marbly.jpg
            blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
            alphaGen vertex
        }
        {
            map $lightmap
            blendFunc GL_DST_COLOR GL_ZERO
        }
    }

     

     

  7. Oh, here we go. My first post. Good morning, jkhub!

     

    I'm trying to create my own terrain map using easygen, and because my modding skills are 1/10, I'm struggling. I'm struggling hard. And I need your help.

    To be absolutely clear - I saw similar problems discussed here before, but provided solutions were not so clear (probably because my skill level).

    First problem: missplaced triangles in-game. Terrain looks fine, but there are few triangles which are obviously out of place. Perfect example was pictured in this topic: http://jkhub.org/topic/4229-mapping-bug-with-a-terrain-ingame/
    I saw some sort of explanation provided by experienced mappers (http://jkhub.org/topic/4171-first-terrain-some-issues/?p=61755), but I still cannot understand what should I do. "Changing subdivisions". Where? How? WHY?

    My easygen window, to make it easier.

    eJleMVJ.png

     

    But there is more to it. Another problem, this time it is more frustrating. Texture scalling.

    In easygen, my textures are larger than in compiled map. Identical problem was posted and discussed in this topic: http://jkhub.org/topic/5663-terrain-texture-size/

    I did everything, from using different templates (ended up at 'rgoer') and even fixing minor bugs (moving missplaced shader to right directory, fixing order of terraing shaders in .shader file) and I'm nearly out of ideas.

    I think it can be fixed by using larger textures (just stretching them in paint or something), but it really isn't a solution.

     

    Help me, jkhub. You're my only hope.

     

     

×
×
  • Create New...