textures/parsertest/polygonOffset1
{	
	polygonOffset
}

textures/parsertest/polygonOffset2
{	
	polygonOffset 13.0
	clamp
}

textures/parsertest/polygonOffset3
{	
	polygonOffset -3.0
}

textures/parsertest/sortWithValue
{	
	sort 1.2
}

// We use weird mixed casing on the predefined keywords to prove that the parser is case-insensitive
textures/parsertest/sortPredefined_none            { qer_editorimage test/blah }
textures/parsertest/sortPredefined_subview         { sORt SUbVieW }
textures/parsertest/sortPredefined_opaque          { sORt oPaque }
textures/parsertest/sortPredefined_decal           { sORt dEcal }
textures/parsertest/sortPredefined_far             { sORt fAr }
textures/parsertest/sortPredefined_medium          { sORt mEdiUm }
textures/parsertest/sortPredefined_close           { sORt cLosE }
textures/parsertest/sortPredefined_almostnearest   { sORt aLmoStnearest }
textures/parsertest/sortPredefined_nearest         { sORt nEarEst }
textures/parsertest/sortPredefined_afterfog        { sORt aFteRfog }
textures/parsertest/sortPredefined_postprocess     { sORt pOstProcess }
textures/parsertest/sortPredefined_portalsky       { sORt pOrtAlsky }
textures/parsertest/sortPredefined_decal_macro     { DECAL_MACRO }
textures/parsertest/sort_custom                    { sort 34.56 }
textures/parsertest/sort_custom2                   { sort portalsky sort 34.56 }

textures/parsertest/withAmbientRimColor
{
    ambientRimColor parm1 * 3, 0, time * 6
}

textures/parsertest/noSpectrum
{
    ambientRimColor parm1 * 3, 0, time * 6
}

textures/parsertest/spectrumMinus45
{
    spectrum -45
}

textures/parsertest/spectrumPositive100
{
    spectrum 100
}

textures/parsertest/renderBump1
{
    renderBump textures/output.tga models/hipoly 
}

textures/parsertest/renderBump2
{
    renderBump -size 100 200 textures/output.tga models/hipoly 
}

textures/parsertest/renderBump3
{
    renderBump -aa 2 textures/output.tga models/hipoly 
}

textures/parsertest/renderBump4
{
    renderBump -aa 2 -size 10 10 textures/output.tga models/hipoly 
}

textures/parsertest/renderBump5
{
    renderBump -aa 2 -size 10 10 -trace 0.5 textures/output.tga models/hipoly 
}

textures/parsertest/renderBump6
{
    renderBump -aa 2 -trace 0.5 -size 10 10 textures/output.tga models/hipoly 
}

textures/parsertest/renderBumpFlat1
{
    renderBumpflat -size 200 100 models/hipoly 
}

textures/parsertest/renderBumpFlat2
{
    renderBumpflat models/hipoly 
}

table deformtesttable { { 0, 0, 0, 0, 1, 1 } }

textures/parsertest/deform1
{
	deform flare 1.5
}

textures/parsertest/deform2
{
	deform expand (0.1 * deformtesttable[time * (0.3+time)] - global3)
}

textures/parsertest/deform3
{
	deform move (1.7 + time + 4 - global3)
}

textures/parsertest/deform4
{
	deform turbulent deformtesttable time*2 (parm11-4) -global5
}

textures/parsertest/deform5
{
	deform particle testparticle
}

textures/parsertest/deform6
{
	deform particle2 testparticle
}

textures/parsertest/transform/notransform
{
	{
        map _white
        // no transforms
    }
}

textures/parsertest/transform/translation1
{
	{
        map _white
        translate 3, parm3+5
    }
}

textures/parsertest/transform/translation2
{
	{
        map _white
        scroll time, .5
    }
}

textures/parsertest/transform/scale1
{
	{
        map _white
        scale 4, time*3
    }
}

textures/parsertest/transform/centerscale1
{
	{
        map _white
        centerscale 4, time*3
    }
}

textures/parsertest/transform/shear1
{
	{
        map _white
        shear global3 + 5, 4
    }
}

textures/parsertest/transform/rotate1
{
	{
        map _white
        rotate .03
    }
}

textures/parsertest/transform/combined1
{
	{
        map _white
        translate time, .5
        translate 0.7, 0.5
    }
}

textures/parsertest/transform/combined2
{
	{
        map _white
        translate time, .5
        scale 0.6, 0.2
        translate 0.7, 0.5
    }
}

textures/parsertest/transform/combined3
{
	{
        map _white
        translate time, .5
        shear 0.9, 0.8
        rotate 0.22
        centerscale 0.2, 0.1
        scale 0.5, 0.4
        translate 1, 1
    }
}

textures/parsertest/program/vertexProgram1
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time // only 1 argument defined
    }
}

textures/parsertest/program/vertexProgram2
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time, 3.0 // only 2 arguments defined
    }
}

textures/parsertest/program/vertexProgram3
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time, 3.0, global3 // only 3 arguments defined
    }
}

textures/parsertest/program/vertexProgram4
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time, 3.0, global3, time*2 // 4 arguments defined
    }
}

textures/parsertest/program/vertexProgram5
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time, 3.0, global3, time*2 // 4 arguments defined
        vertexParm 1 1, 2, 3, 4
        vertexParm 2 5,6,7,8
    }
}

textures/parsertest/program/vertexProgram6
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        vertexParm 0 time, 3.0, global3, time*2 // 4 arguments defined
        // index 1 is missing
        vertexParm 2 5,6,7,8
    }
}

textures/parsertest/program/vertexProgram7
{
	{
        map _white
        vertexProgram glprogs/test.vfp

        // Maximum number of vertexParms is 4, index 5 is invalid
        vertexParm 5 5,6,7,8
    }
}

textures/parsertest/program/fragmentProgram1
{
	{
        fragmentProgram glprogs/test.vfp

        fragmentMap		0		cubeMap forceHighQuality alphaZeroClamp env/gen1 // some options
		fragmentMap		1		temp/texture
        // all possible options
		fragmentMap		2		cubemap cameracubemap nearest linear clamp noclamp zeroclamp alphazeroclamp forcehighquality uncompressed highquality nopicmip temp/optionsftw
    }
}

textures/parsertest/program/fragmentProgram2
{
	{
        fragmentProgram glprogs/test.vfp

        fragmentMap		0		env/gen1 // no options
        // fragment map 1 is missing
		fragmentMap		2		temp/texture
    }
}

textures/parsertest/program/fragmentProgram3
{
	{
        fragmentProgram glprogs/test.vfp

        // defining a fragment map with num >= 8 is invalid
		fragmentMap		8		temp/texture
    }
}

textures/parsertest/guisurf1
{
	qer_editorimage	textures/editor/entityGui.tga
	discrete
	guiSurf	guis/lvlmaps/genericmap.gui

}

textures/parsertest/guisurf2
 {
	qer_editorimage	textures/editor/entityGui.tga
	discrete
	playerclip
	guiSurf	entity
}

textures/parsertest/guisurf3
{
	qer_editorimage	textures/editor/entityGui2.tga
	discrete
	playerclip
	guiSurf	entity2
}

textures/parsertest/guisurf4
{
	qer_editorimage	textures/editor/entityGui3.tga
	discrete
	guiSurf	entity3
	playerclip
}

textures/parsertest/colourexpr1
{
	{
        blend diffusemap
        map _white
        red time*3
	}
}

textures/parsertest/colourexpr2
{
	{
        blend diffusemap
        map _white
        green time*3
	}
}

textures/parsertest/colourexpr3
{
	{
        blend diffusemap
        map _white
        blue time*3
	}
}

textures/parsertest/colourexpr4
{
	{
        blend diffusemap
        map _white
        alpha time*3
	}
}

textures/parsertest/colourexpr5
{
	{
        blend diffusemap
        map _white
        rgb time*3
	}
}

textures/parsertest/colourexpr6
{
	{
        blend diffusemap
        map _white
        rgba time*3
	}
}

textures/parsertest/colourexpr7
{
	{
        blend diffusemap
        map _white
        red time*3
        red time*4
	}
}

textures/parsertest/colourexpr8
{
	{
        blend diffusemap
        map _white
        rgb time*3
        red time*4
	}
}

textures/parsertest/colourexpr9
{
	{
        blend diffusemap
        map _white
        rgba time*3
        green time*4
	}
}

textures/parsertest/colourexpr10
{
	{
        blend diffusemap
        map _white
        rgba time*3
        red time*4
        blue time*5
        green time*6
        alpha time*7
	}
}

textures/parsertest/lights/lightfalloff1
{
	lightFalloffImage	makeintensity( lights/squarelight1a.tga )
	spectrum 2	
	{
		forceHighQuality
		map lights/fullambient.tga
		colored
		zeroClamp
	}
}

textures/parsertest/lights/lightfalloff2
{
	lightFalloffCubeMap lights/squarelight1a
	spectrum 2	
	{
		forceHighQuality
		map lights/fullambient.tga
		colored
		zeroClamp
	}
}

textures/parsertest/lights/lightfalloff3
{
    lightFalloffImage	makeintensity( lights/squarelight1a.tga )
	lightFalloffCubeMap lights/squarelight1a
	spectrum 2	
	{
		forceHighQuality
		map lights/fullambient.tga
		colored
		zeroClamp
	}
}

textures/parsertest/expressions/sinTableLookup
{
	{
		blend diffusemap
		map _white
		alphaTest sinTable[0.5008]
	}
}

textures/parsertest/expressions/cosTableLookup
{
	{
		blend diffusemap
		map _white
		alphaTest cosTable[-0.000025]
	}
}

textures/parsertest/expressions/rotationCalculation
{
	{
		blend diffusemap
		map _white
		rotate 		0.005 * sintable [ time * 0.1]
	}
}

textures/parsertest/decalinfo
{
	decalinfo 14.3 1.5 ( 0.9 0.8 0.7 0.6 ) (0.5 0.5 0.4 0.3)
}

textures/parsertest/surfaceflags/solid              { solid }
textures/parsertest/surfaceflags/water              { water }
textures/parsertest/surfaceflags/playerclip         { playerclip }
textures/parsertest/surfaceflags/monsterclip        { monsterclip }
textures/parsertest/surfaceflags/moveableclip       { moveableclip }
textures/parsertest/surfaceflags/ikclip             { ikclip }
textures/parsertest/surfaceflags/blood              { blood }
textures/parsertest/surfaceflags/trigger            { trigger }
textures/parsertest/surfaceflags/aassolid           { aassolid }
textures/parsertest/surfaceflags/aasobstacle        { aasobstacle }
textures/parsertest/surfaceflags/flashlight_trigger { flashlight_trigger }
textures/parsertest/surfaceflags/nonsolid           { nonsolid }
textures/parsertest/surfaceflags/nullnormal         { nullnormal }
textures/parsertest/surfaceflags/areaportal         { areaportal }
textures/parsertest/surfaceflags/nocarve            { qer_nocarve }
textures/parsertest/surfaceflags/discrete           { discrete }
textures/parsertest/surfaceflags/nofragment         { nofragment }
textures/parsertest/surfaceflags/slick              { slick }
textures/parsertest/surfaceflags/collision          { collision }
textures/parsertest/surfaceflags/noimpact           { noimpact }
textures/parsertest/surfaceflags/nodamage           { nodamage }
textures/parsertest/surfaceflags/ladder             { ladder }
textures/parsertest/surfaceflags/nosteps            { nosteps }

textures/parsertest/texgen/normal
{
	{
		blend diffusemap
		map _white
	}
}

textures/parsertest/texgen/reflect
{
	{
		blend diffusemap
		map _white
        texgen reflect
	}
}

textures/parsertest/texgen/skybox
{
	{
		blend diffusemap
		map _white
        texgen skybox
	}
}

textures/parsertest/texgen/wobblesky
{
	{
		blend diffusemap
		map _white
        texgen wobblesky 1.0 0.5 (time*0.6)
	}
}

textures/parsertest/texturefilter/nearest
{
	{
		blend diffusemap
		map _white
        nearest
	}
}

textures/parsertest/texturefilter/linear
{
	{
		blend diffusemap
		map _white
        linear
	}
}

textures/parsertest/texturequality/highquality
{
	{
		blend diffusemap
		map _white
        highquality
	}
}

// uncompressed is the same as highquality
textures/parsertest/texturequality/uncompressed
{
	{
		blend diffusemap
		map _white
        uncompressed
	}
}

textures/parsertest/texturequality/forcehighquality
{
	{
		blend diffusemap
		map _white
        forcehighquality
	}
}

textures/parsertest/texturequality/nopicmip
{
	{
		blend diffusemap
		map _white
        nopicmip
	}
}

textures/parsertest/clamping/noclamp
{
	{
		blend diffusemap
		map _white
        noclamp
	}
}

textures/parsertest/clamping/noclamp
{
	{
		blend diffusemap
		map _white
        noclamp
	}
}

textures/parsertest/clamping/clamp
{
	{
		blend diffusemap
		map _white
        clamp
	}
}

textures/parsertest/clamping/zeroclamp
{
	{
		blend diffusemap
		map _white
        zeroclamp
	}
}

textures/parsertest/clamping/alphazeroclamp
{
	{
		blend diffusemap
		map _white
        alphazeroclamp
	}
}

textures/parsertest/stageflags/ignorealphatest
{
	{
		blend diffusemap
		map _white
        ignoreAlphaTest
	}
}

textures/parsertest/stageflags/ignoredepth
{
	{
		blend diffusemap
		map _white
        ignoreDepth
	}
}

textures/parsertest/stageflags/maskRed
{
	{
		blend diffusemap
		map _white
        maskRed
	}
}

textures/parsertest/stageflags/maskGreen
{
	{
		blend diffusemap
		map _white
        maskGreen
	}
}

textures/parsertest/stageflags/maskBlue
{
	{
		blend diffusemap
		map _white
        maskBlue
	}
}

textures/parsertest/stageflags/maskAlpha
{
	{
		blend diffusemap
		map _white
        maskAlpha
	}
}

textures/parsertest/stageflags/maskColor
{
	{
		blend diffusemap
		map _white
        maskColor
	}
}

textures/parsertest/stageflags/maskDepth
{
	{
		blend diffusemap
		map _white
        maskDepth
	}
}

textures/parsertest/stageflags/maskEverything
{
	{
		blend diffusemap
		map _white
        maskRed
        maskGreen
        maskBlue
        maskAlpha
        maskDepth
	}
}

textures/parsertest/vertexcolours/none
{
	diffusemap _white
}

textures/parsertest/vertexcolours/vertexcolour
{
	{
		blend diffusemap
		map _white
        vertexColor
	}
    {
		blend diffusemap
		map _white
        inverseVertexColor
	}
}

textures/parsertest/vertexcolours/colourcomponents
{
	{
		blend diffusemap
		map _white
        red 0.5
	}
    {
		blend diffusemap
		map _white
        green 0.4
	}
    {
		blend diffusemap
		map _white
        blue 0.3
	}
    {
		blend diffusemap
		map _white
        alpha 0.2
	}
}

textures/parsertest/vertexcolours/coloured
{
	{
		blend diffusemap
		map _white
        color 0.7, 0.6, 0.5, 0.9
	}
    {
		blend diffusemap
		map _white
        colored
	}
}

textures/parsertest/vertexcolours/combinations
{
	{
		blend diffusemap
		map _white
        red 0.5
        green 0.5
        blue 0.5
        alpha time // alpha is different
	}
    {
		blend diffusemap
		map _white
        red 0.5
        green 0.5
        blue 0.5
        alpha 0.5
	}
    {
		blend diffusemap
		map _white
        rgb 0.3
        red 0.4
	}
    {
		blend diffusemap
		map _white
        rgba 0.2
        alpha time
	}
}

textures/parsertest/vertexcolours/combinations2
{
    {
		blend diffusemap
		map _white
        color 0.1, 0.2, 0.3, 0.4
        green time
	}
    {
		blend diffusemap
		map _white
        color 0.1, 0.2, 0.3, 0.4
        green 0.1
        blue 0.1
	}
    {
		blend diffusemap
		map _white
        colored
        alpha time
    }
}

textures/parsertest/privatePolygonOffset
{
    {
		blend diffusemap
		map _white
        privatePolygonOffset -45.9
	}
}

textures/parsertest/alphaTest
{
	{
		blend diffusemap
		map _white
		alphaTest sinTable[time]
	}
}

textures/parsertest/condition
{
    {
        if (parm4 > 0)
		blend diffusemap
		map _white
	}
}

textures/parsertest/frobstage_present1
{
    qer_editorimage textures/numbers/0
    diffusemap      textures/numbers/0
    bumpmap         textures/numbers/1

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/numbers/0
        rgb         0.15 * parm11
    }
}

textures/parsertest/frobstage_present2 // is using _white.tga instead _white
{
    qer_editorimage textures/numbers/0
    diffusemap      textures/numbers/0
    bumpmap         textures/numbers/1

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white.tga
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/numbers/0
        rgb         0.15 * parm11
    }
}

textures/parsertest/frobstage_missing1
{
    diffusemap      textures/numbers/0
    bumpmap         textures/numbers/1
}

textures/parsertest/frobstage_missing2 // has only one stage
{
    diffusemap      textures/numbers/0
    bumpmap         textures/numbers/1

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
}

textures/parsertest/frobstage_missing3 // has only one stage
{
    diffusemap      textures/numbers/0
    bumpmap         textures/numbers/1

    {
        if ( parm11 > 0 )
        blend       add
        map         textures/numbers/0
        rgb         0.15 * parm11
    }
}

textures/parsertest/frobstage_missing4 // has no diffuse to compare
{
    bumpmap         textures/numbers/1

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/numbers/0
        rgb         0.15 * parm11
    }
}

textures/parsertest/frobstage_missing5 // mismatching map in additive stage
{
    diffusemap textures/numbers/0

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/numbers/1
        rgb         0.15 * parm11
    }
}

// Test determining the material coverage
textures/parsertest/coverage1
{
    glass
	noselfshadow
	qer_editorimage	textures/darkmod/window/largesquare01_softerlit_ed
	diffusemap _black
	{
		blend add
		map	textures/darkmod/window/largesquare01_softerlit
		rgb .5
	}
}

// Test coverage of translucent material
textures/parsertest/coverage2
{
    glass
	qer_editorimage textures/darkmod/carpet/rugs/mat_shaggy_ed

	noShadows
	translucent
	diffusemap textures/darkmod/carpet/rugs/mat_shaggy
	bumpmap textures/darkmod/carpet/rugs/mat_shaggy_local
}

// Test determining the noshadows flag
textures/parsertest/noshadowsflag
{
    glass
	noShadows
	diffusemap _black
}

textures/parsertest/remoteRenderMap1
{
	{
		red Parm0
		green Parm1
		blue Parm2
		remoteRenderMap 232 232 // width / height of render image, ie resolution of screen
	}
}

textures/parsertest/remoteRenderMap2
{
	{
        map textures/common/mirror.tga
        remoteRenderMap 256 128
	}
}

textures/parsertest/mirrorRenderMap1
{
	{
        blend blend
        mirrorRenderMap 256 128
	}
}

textures/parsertest/mirrorRenderMap2
{
	{
        blend blend
        mirrorRenderMap 256 128
        map textures/common/mirror.tga
	}
}

textures/parsertest/mirrorRenderMap3
{
	{
        blend blend
        map textures/common/mirror.tga
        mirrorRenderMap
	}
}

textures/parsertest/defaultBlendFunc
{
	{
        // No explicit blend function definition
        map textures/common/caulk.tga
	}
}
