Dot Product shader Q: TGA vs. JPEG files?, also Q about Atlantica -1 reply

Please wait...

acrobat

I don't spend enough time here

50 XP

30th April 2004

0 Uploads

29 Posts

0 Threads

#1 12 years ago

I am using sock's shader in my new map in a skinny area and it looks great, but I have a couple LARGE areas that it looks terrible in.

When I've tried to scale them up with the surface inspector, they do not scale up. If I scale them up in the shader file, they scale up but the secondary shader stays tiny. Even so I might be able to work something out, but...

I tried messing around with the the dot product shader that Szico used in Atlantica, and he used JPEG files instead of TGA files, which I didn't know would work. Is there any disadvantage to this?

Also unlike TGA files...his shader scaled up when you used the surface inspector. What gives? Also his secondary shader (grass in this case) also scaled up when you used the surface inspector.

Anyone have any insight into this?




Guest

I didn't make it!

0 XP

 
#2 12 years ago

Try this SimonOC - Articles, Creating Terrains, Page 1 with the terrain and I will be certain that it will work. If you then want to change the size you could modify q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) [COLOR=Black]to get a different size result. This might take some messing around but it will eventually work as you want it to. I think that if you use dot2product without alpha fade you can use jpg files.[/COLOR]




acrobat

I don't spend enough time here

50 XP

30th April 2004

0 Uploads

29 Posts

0 Threads

#3 12 years ago

I believe I've tried that before. The primary shader enlarges but the overlay does not.

Yet with the jpegs both enlarge with only the surface inspector being used.

Is there a line that distinguishes or takes out the alpha overlay as you say? or is the shader essentially the same? What would be the difference in in-game appearance?




acrobat

I don't spend enough time here

50 XP

30th April 2004

0 Uploads

29 Posts

0 Threads

#4 12 years ago

So you're saying Szico most likely added extra shader commands in order to make it blend rather than using the alpha channels?

Here is Szico's shader

################################ ////// DotProduct2 Blends ////// ################################

textures/atlantica/atlantica_ter_rockgrass { qer_editorimage textures/yavin/rock3 q3map_lightmapMergable q3map_nonplanar q3map_shadeangle 120 q3map_notjunc { map textures/yavin/rock3 tcMod scale 0.5 0.5 } { map textures/atlantica/atlantica_ter_grass tcMod scale 0.5 0.5 alphaGen oneMinusVertex blendfunc blend } { map $lightmap blendFunc filter } }

textures/atlantica/atlantica_ter_rockgrass2 { qer_editorimage textures/atlantica/atlantica_rock2 q3map_shadeangle 180 q3map_nonplanar q3map_notjunc { map textures/atlantica/atlantica_rock2 tcMod scale 1 1 } { map textures/atlantica/atlantica_ter_grass tcMod scale 0.5 0.5 alphaGen oneMinusVertex blendfunc blend } { map $lightmap blendFunc filter } }

textures/atlantica/atlantica_ter_cliffgrass { qer_editorimage textures/quicktrip/qt_Uncut q3map_lightmapMergable q3map_nonplanar q3map_shadeangle 120 q3map_notjunc { map textures/quicktrip/qt_Uncut tcMod scale 0.25 0.25 } { map textures/atlantica/atlantica_ter_grass tcMod scale 0.25 0.25 alphaGen oneMinusVertex blendfunc blend } { map $lightmap blendFunc filter } }

textures/atlantica/atlantica_ter_soilrock { qer_editorimage textures/atlantica/atlantica_ter_soil q3map_lightmapMergable q3map_nonplanar q3map_shadeangle 180 q3map_notjunc { map textures/atlantica/atlantica_ter_soil tcMod scale 1 1 detail } { map textures/atlantica/atlantica_rock2 tcMod scale 1 1 alphaGen oneMinusVertex blendfunc blend } { map $lightmap blendFunc filter } } textures/atlantica/atlantica_void { qer_editorimage textures/atlantica/atlantica_void surfaceparm nomarks surfaceparm nonsolid surfaceparm nonopaque q3map_nolightmap q3map_notjunc { map textures/atlantica/atlantica_void blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA alphaFunc LT128 } }

Here is SIMON OC's

//**********************************************************************// // // terrain_example.shader for Q3 by Sock // Website : Simland - Front Page // //**********************************************************************// //

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 // (c) 2004 randy reddig // Shaderlab // 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 }




Guest

I didn't make it!

0 XP

 
#5 12 years ago

The thing is that Szico doesnt use alphablend options, because the commands q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 ) and the alphablending textures are controlling the amount of secondary and primary textures. Basically if you delete q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) you can control the size with the surface editor. I had to do this with my rock texture because it freaked out completely.




acrobat

I don't spend enough time here

50 XP

30th April 2004

0 Uploads

29 Posts

0 Threads

#6 12 years ago

Do you think it makes much difference visually whether you use a tga with alpha shader on top or jpegs?

Maybe it makes little difference.