DotProduct 2 blending help! -1 reply

Please wait...

xode

The Internet ends at GF

50 XP

16th August 2008

0 Uploads

136 Posts

0 Threads

#1 9 years ago

My first problem is, by default, the texture is a 50/50 blend of the two textures designated in the shader. However, I want just the Primary shader shown by default. In the screen below, outside of the mossy area, there is no alpha stick work, but there is still a 50/50 blend shot0179.jpg

My second problem is when I try to do 25% primary 75% secondary blends. The primary texture is a light dirt texture. As you can see, it works perfectly when it is 0% primary 100% secondary (the moss) but this is what happens when I do 25/75 shot0180.jpg

Any ideas?




Guest

I didn't make it!

0 XP

 
#2 9 years ago

Did you try this out yourself?

Anyway, the first problem is adjusted by this..

q3map_alphaMod dotproduct2 ( 0.0 0.0 1.0 ) It is 1.0 on the Z value.

The second problem looks like a problem with the texture. The alpha channel is really essemtial to DotProduct2 and without it the terrain will have these awkward transitions. Could I see the alpha channels on your texture please.




xode

The Internet ends at GF

50 XP

16th August 2008

0 Uploads

136 Posts

0 Threads

#3 9 years ago

I'm not sure whether you mean the alpha fade brushes or the shader file. If you want the shader, here it is:

textures/chandrila_outlands/sky1 { qer_editorimage textures/skies/sky.tga surfaceparm sky surfaceparm noimpact surfaceparm nomarks notc q3map_sun 1 0.91 0.79 105 25 80 q3map_surfacelight 250 skyParms textures/skies/dune 512 - }

textures/chandrila_outlands/b_r_m { qer_editorimage textures/yavin/rockwall q3map_nonplanar q3map_shadeangle 150 q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 ) q3map_Material Mud { map textures/yavin/rockwall // Primary rgbGen identity } { map textures/yavin/s_mud2 // 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/chandrila_outlands/b_d_m { qer_editorimage textures/yavin/lighturth q3map_nonplanar q3map_shadeangle 150 q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 ) q3map_Material Mud { map textures/yavin/lighturth // Primary rgbGen identity

} { map textures/yavin/s_mud2 // 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/chandrila_outlands/0 // Primary texture ONLY { q3map_alphaMod volume q3map_alphaMod set 0 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }

textures/chandrila_outlands/25 { q3map_alphaMod volume q3map_alphaMod set 0.25 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }

textures/chandrila_outlands/50 // Perfect mix of both Primary + Secondary { q3map_alphaMod volume q3map_alphaMod set 0.50 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }

textures/chandrila_outlands/75 { q3map_alphaMod volume q3map_alphaMod set 0.75 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }

textures/chandrila_outlands/85 { q3map_alphaMod volume q3map_alphaMod set 0.85 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }

textures/chandrila_outlands/100 // Secondary texture ONLY { q3map_alphaMod volume q3map_alphaMod set 1.0 surfaceparm nodraw surfaceparm nonsolid surfaceparm trans qer_trans 1 }And here is a picture of my brush placement (deep red is 100/85 alpha, while white is 0 alpha)

alphbr.jpg




Guest

I didn't make it!

0 XP

 
#4 9 years ago

Basically, textures/chandrila_outlands/b_r_m { qer_editorimage textures/yavin/rockwall q3map_nonplanar q3map_shadeangle 150 q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 ) q3map_Material Mud { map textures/yavin/rockwall // Primary rgbGen identity } { map textures/yavin/s_mud2 // 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 } }

Should be q3map_alphaMod dotproduct2 ( 0.0 0.0 1.0 ) I assumed that this was the floortexture as it looks like your ground is yavins rocktexture. Although it seems like you are trying to blend 2 yavin textures. This wont work because you need to give your textures alphachannels to blend in correctly so that it looks natural.

Spoiler: Show
shot0154wm5.jpg

It is quite hard to tell, but you can see the grass kind of twines between the cracks. Without an alphachannel this wont do.

To create a quick alpha channel, take the texture and convert it to greyscale. Increase the brightness by 100% so the image is many shades of white and grey. If requiring hard edges then increase the contrast value. In Photoshop create a new channel and and then cut and paste the greyscale alpha image into the channel. Save the image as a 32bit TGA file and that should be it.




xode

The Internet ends at GF

50 XP

16th August 2008

0 Uploads

136 Posts

0 Threads

#5 9 years ago

After doing that, I get this:

Spoiler: Show
alph.jpg

This isn't the final result, I'm guessing, but I hazard a guess that I then repeat the process and put *this* as the mask of the original texture. Am I right?




Guest

I didn't make it!

0 XP

 
#6 9 years ago

Im not sure how it is in gimp, but you should have 4 channels.. RGB and Alpha1.

Your alphaimage itself should look like this:

Spoiler: Show
terrain1s1.jpg

And your channel list should look kinda like this:

Spoiler: Show
terrain1s2.jpg



xode

The Internet ends at GF

50 XP

16th August 2008

0 Uploads

136 Posts

0 Threads

#7 9 years ago

Yes, there is something like that, but how do I move the image into the Alpha channel slot?




Guest

I didn't make it!

0 XP

 
#8 9 years ago

You simply cut out the entire image and paste it into the new white alpha channel.




xode

The Internet ends at GF

50 XP

16th August 2008

0 Uploads

136 Posts

0 Threads

#9 9 years ago

It doesn't work, it pates it into layers rather than channels.




Guest

I didn't make it!

0 XP

 
#10 9 years ago

Please send me the texture and I will try to fix it.