Sock's dot product 2 +alpha shader


(ACROBAT) #1

I used his dot product shader from temple of the magician once a few months ago, and last time I used it the secondary texture needed to be scaled up. I used the texture “s” key (I forget the name for that, texture alignment?) to double the texture size. It worked fine, but there was no way to adjust the secondary texture since that was overlayed by the compiler. So the secondary texture was ter_dirt1 in this case. Here’s his shader I just DL’d from his homepage. I need a way to be able to upscale the size of the seocndary texture so that i can match the size of the primary in game.

//**********************************************************************//

//

// terrain_example.shader for Q3 by Sock

// Website : http://www.planetquake.com/simland/

//

//**********************************************************************//

//

textures/terrain_example/blacksky // Used for testing boxmaps

{

qer_editorimage textures/terrain_example/blacksky.tga

surfaceparm noimpact

surfaceparm nolightmap

{

map textures/terrain_example/blacksky.tga

}

}

// ======================================================================

// DotProduct2 Terrain blending

// ======================================================================

textures/terrain_example/ter_dirtmud

{

   qer_editorimage textures/terrain_example/ter_dirtmud.tga 

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/terrain_example/ter_dirt1.tga // Primary

rgbGen identity

}

{

map textures/terrain_example/ter_mud1.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

}

}

textures/terrain_example/ter_mossmud

{

   qer_editorimage textures/terrain_example/ter_mossmud.tga 

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/terrain_example/ter_moss1.tga // Primary

rgbGen identity

}

{

map textures/terrain_example/ter_mud1.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

}

}

textures/terrain_example/ter_rockmud

{

   qer_editorimage textures/terrain_example/ter_rockmud.tga 

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/terrain_example/ter_rock3.tga // Primary

rgbGen identity

}

{

map textures/terrain_example/ter_mud1.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

}

}

// ======================================================================

// Hong Phonged textures

// ======================================================================

textures/terrain_example/ter_rock2

{

q3map_nonplanar

q3map_shadeangle 120

   qer_editorimage textures/terrain_example/ter_rock2.tga 

{

map $lightmap

rgbGen identity

}

{

map textures/terrain_example/ter_rock2.tga

blendFunc filter

}

}

// ======================================================================

// Alpha blending without dotProduct2 and ivector

// ======================================================================

textures/terrain_example/bld_rock2moss1 // Normal texture blending

{

   qer_editorimage textures/terrain_example/bld_rock2moss1.tga 

q3map_nonplanar

q3map_shadeAngle 120

{

map textures/terrain_example/ter_rock2.tga // Primary

rgbGen identity

}

{

map textures/terrain_example/ter_moss1.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

}

}

textures/terrain_example/dcl_moss1 // Decal blending

{

   qer_editorimage textures/terrain_example/ter_moss1.tga 

q3map_nonplanar

q3map_shadeangle 120

surfaceparm trans

surfaceparm nonsolid

surfaceparm nomarks

polygonoffset

{

map textures/terrain_example/ter_moss1.tga

alphaFunc GE128

rgbGen identity

alphaGen vertex

}

{

map $lightmap

blendFunc GL_DST_COLOR GL_ZERO

rgbGen identity

depthFunc equal

}

}

// ======================================================================

// alpha fade shaders

// © 2004 randy reddig

// http://www.shaderlab.com

// distribution, in part or in whole, in any medium, permitted

// ======================================================================

//

// These shaders are not fixed to this directory location, they can

// be moved around. They exist here for convenience only.

//

textures/terrain_example/alpha_000 // Primary texture ONLY

{

q3map_alphaMod volume

q3map_alphaMod set 0

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}

textures/terrain_example/alpha_025

{

q3map_alphaMod volume

q3map_alphaMod set 0.25

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}

textures/terrain_example/alpha_050 // Perfect mix of both Primary + Secondary

{

q3map_alphaMod volume

q3map_alphaMod set 0.50

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}

textures/terrain_example/alpha_075

{

q3map_alphaMod volume

q3map_alphaMod set 0.75

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}

textures/terrain_example/alpha_085

{

q3map_alphaMod volume

q3map_alphaMod set 0.85

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}

textures/terrain_example/alpha_100 // Secondary texture ONLY

{

q3map_alphaMod volume

q3map_alphaMod set 1.0

surfaceparm nodraw

surfaceparm nonsolid

surfaceparm trans

qer_trans 0.75

}


(-SSF-Sage) #2

Try to change

q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )

to

q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )