Q3MAP2 Shader examples

2025-06-28 Mapping tutorials kleskby 0 952
Author: KleskBY

General shaders for your game/map. 

Tree leafs:

textures/tree/pine_leaf
{
	surfaceparm alphashadow
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	surfaceparm nolightmap
        surfaceparm trans 
	nopicmip
	dpNoShadow                           //Disable realtime shadows for optimization reasons
        dpNoBih                              //No collision
	cull none                            //Dobule sided                         
	deformVertexes wave 15 sin 0 2 0 .1  //animation
	{
		map textures/tree/pine_leaf
		rgbGen vertex
		depthWrite
		alphaFunc GE128
	}
}

Grass:

textures/grass/grass01
{
        surfaceparm trans
	surfaceparm alphashadow
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	surfaceparm nolightmap
	nopicmip
	dpNoShadow                           //Disable realtime shadows for optimization reasons
        dpNoBih                              //No collision
	cull none                            //Dobule sided    
	
	deformVertexes wave 15 sin 0 2 0 .1 //animation
	deformVertexes autoSprite //look into camera
	{
		map textures/grass/grass01.tga
		rgbGen vertex
		depthWrite
		alphaFunc GE128
	}
}

textures/sponza_thorn_diff
{
	sort additive
    cull disable
    surfaceparm nolightmap
	deformVertexes wave 100 sin 0 0.25 0 .7
	dpNoShadow
	{
		map textures/sponza_thorn_diff
		//blendfunc gl_src_alpha gl_one_minus_src_alpha
		depthWrite
		alphaFunc GE128
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc filter
	}
}

textures/vase_plant
{
	sort additive
    cull disable
    surfaceparm nolightmap
	deformVertexes wave 300 sin 0 0.2 0 .5
	dpNoShadow
	{
		map textures/vase_plant
		//blendfunc gl_src_alpha gl_one_minus_src_alpha
		depthWrite
		alphaFunc GE128
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc filter
	}
}

Sky:

textures/sky
{
	qer_editorimage env/sky1_bk
	surfaceparm noimpact
	surfaceparm nomarks
	surfaceparm nolightmap
	surfaceparm sky
	nopicmip
	nomipmaps
	
	q3map_sun 1.15 .52 0.53 75 45 30
	q3map_surfacelight 55
	skyparms env/sky1 - -
}

textures/sky_grey
{
	qer_editorimage env/sky1_bk
	surfaceparm noimpact
	surfaceparm nomarks
	surfaceparm nolightmap
	surfaceparm sky
	nopicmip
	nomipmaps
	
	q3map_sun .9 .9 1 70 45 30
	q3map_surfacelight 45
	skyparms env/sky1 - -
}

textures/sky_test
{
	surfaceparm noimpact
	surfaceparm nomarks
	surfaceparm nolightmap
	surfaceparm sky
	nopicmip
	nomipmaps
	
	q3map_sun .8 .82 0.83 75 45 30
	q3map_surfacelight 45
	skyparms lolg - -
}

textures/sky_nosun
{
	qer_editorimage env/sky_bk
	surfaceparm noimpact
	surfaceparm nomarks
	surfaceparm nolightmap
	surfaceparm sky
	nopicmip
	nomipmaps
	
	skyparms env/sky - -
}

textures/clouds1 
{
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky
	q3map_sunExt 248 232 190 450 240 75 3 16
	q3map_lightRGB 248 232 190 
	q3map_lightmapFilterRadius 0 64	
	q3map_skylight 325 3
	q3map_backsplash 0 0
	skyparms env/clouds1 - -
}

Banner/Flag/Fabric/Curatin (animated):

textures/sponza_fabric_green_diff
{
	q3map_nonplanar
	q3map_globalTexture
	q3map_shadeangle 179
	q3map_lightmapsamplesize 32
	q3map_lightmapaxis z
	q3map_lightmapBrightness 0.5
	q3map_lightmapsampleoffset 8.0
	deformVertexes wave 100 sin 0 1 0 .7
	dpNoShadow
	dpRtlightAmbient .5
	sort banner
	{
		map textures/sponza_fabric_green_diff
        rgbGen lightingDiffuse
	}
}

Decals (trash on the ground):

textures/decal/decal09
{
    surfaceparm trans
    surfaceparm nonsolid
    surfaceparm noimpact
    surfaceparm detail
    nopicmip
    dp_noshadow
	
    cull back
    {
        map textures/decal/decal09
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaFunc GT0
        depthWrite
        rgbGen identity
    }
    {
        map $lightmap
        rgbGen identity
        blendFunc GL_DST_COLOR GL_ZERO
        depthFunc equal
    }
}

Fence/grate:

textures/fence/fence01
{
    surfaceparm trans
    surfaceparm metalsteps
    surfaceparm noimpacts
    surfaceparm nonsolid
    surfaceparm nomarks
    cull none
    qer_alphaFunc gequal 0.5

    // A GRATE OR GRILL THAT CAN BE SEEN FROM BOTH SIDES
    {
        map textures/fence/fence01
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaFunc GT0
        depthWrite
        rgbGen identity
    }
    {
        map $lightmap
        rgbGen identity
        blendFunc GL_DST_COLOR GL_ZERO
        depthFunc equal
    }
}

Reflective floor:

textures/sponza_floor_a_diff
{
	qer_editorimage textures/sponza_floor_a_diff
	dpglossintensitymod 4
	dpglossexponentmod 4
	{
		map textures/sponza_floor_a_diff
	}
	{
		map $lightmap
		rgbGen identity
		tcGen lightmap
		blendfunc filter
	}
	dpwater 0.4 1.0 0.3 1.0  1 1 1  1 1 1  0.7
}

Fake reflection walls:

textures/spnza_bricks_a_diff
{
	qer_editorimage textures/spnza_bricks_a_diff
	dpglossintensitymod 4
	dpglossexponentmod 4
	dpreflectcube env/cubemaps/01
	{
		map $lightmap
		rgbGen identity
		tcGen lightmap
	}
	{
		map textures/spnza_bricks_a_diff
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

Fur:


textures/fur/pink_base
{
	q3map_cloneshader textures/fur/pink_fur
	{
		map $lightmap
	}
	{
		map textures/fur/pink_base.tga
		blendFunc GL_DST_COLOR GL_ZERO
	}
}



// ------------------------------------------------------------------------------
// fur texture
// ------------------------------------------------------------------------------

textures/fur/pink_fur
{
	q3map_lightimage textures/fur/pink_fur.q3map.tga
	
	q3map_notjunc
	q3map_nonplanar
	q3map_bounce 0.0
	q3map_shadeangle 120
	
	// format: q3map_fur <layers> <offset> <fade>
	q3map_fur 8 1.25 0.1
	
	surfaceparm trans
	surfaceparm pointlight
	surfaceparm alphashadow
	surfaceparm nonsolid
	surfaceparm noimpact
	
	// cull none
	nomipmaps
	
	{
		map textures/fur/pink_fur.tga
		//alphaFunc GE128
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
	}
}


Tags: mapping, trenchbroom, Q3MAP

Comments


captcha


No comments yet. Be the first!
Owned by kleskby#1837
Close

You have no new notifications.

SHOUTBOX
Open chat to load…
Log in to chat