Terrain Alpha Blending


(D3C0Y) #41

damn sock now i know why ur on the sd crew :slight_smile: , awsome work :eek:


(Fluffy_gIMp) #42

Looking very nice Sock! :slight_smile:

You could almost turn it into a Battle of Monte Cassino map now :slight_smile: http://www.bbc.co.uk/dna/ww2/A1057664
There’s some reference for it in it’s destroyed state kicking around somewhere, I think there’s a section in the World at War DVD set in the office :slight_smile:

-Fluffy_gIMp


(MrLego) #43

Very realistic looking Sock.

The detail at the cliff base and beach is also a nice touch. :cool:

Makes me want to re-think my current map and move it outdoors again.

  • So little time and so many things to learn. :lookaround:

(sock) #44

Thanks for all the feedback but my xmas mapping time is over. :frowning: I leave tomorrow on a plane to go exploring a very cold place and will not be back to the new year. If anybody wants any more images of the test map I’ve setup a page on my website.

http://www.planetquake.com/simland/pages/etmaps/abbey.htm

Have a good new year’s eve and see you all in the new year.
Keep warm

Sock
:moo:


(MrLego) #45

Happy Holidays Sock

Thanks for the teaser. :cool:


(NeChronic) #46

My first post :smiley:

A newbie-friendly tutorial on this great, new alpha blending technique would be really helpful! When will it be done? Will one ever be done (shure, you need some days off during christmas)?

I’m not as good in q3-based-engine mapping as in HL etc. so it would help me (of course) and many other mappers, who are entering “unknown terrain” now :wink:


(Loffy) #47

put it all over the surface of your terrain entity instead of common/terrain. No alphamaps required!

Hi!
I dont understand what you (rgoer) mean by: put it over the surface of your “terrain entiry”. I’ve just tossed in a few brushes, of various sizes and some of them are sloping. Should I turn them into entites - how? Do you mean func_group? I have tried to func_group the brushes and applied my terrain texture to them (the shader you described above).
But all I get is a couple of brushes with a dirt texture on them.

Trying to create a terrain with this new method. Not working though atm.
I have created a shader and put it in my testmaps’s script folder. I’ve also included it in etmain and Ive added the shader to shaderlist.txt.
I am pretty sure the compiler is reading the shader.

When I compile, I use a bat file and q3map2 version 2.5.11. I can see in the compiler (while it is working) that it reads the shader ("entering scripts/testmap.shader) however there is a warning: WARNING unknown
q3map_alphaMod method: dotproduct2.
Hmm. I guess I have to work a little more on this.

// Loffy


(rgoer) #48

Sorry, “terrain entity” == “func_group” … suppose I should have been more clear. Texture the top surface of your terrain with your alphablending terrain shader instead of common/terrain.

You mentioned that blending wasn’t working for you, that all you got was dirt. What do the alpha channels for your targas look like?

Also, in order for dotproduct2 to work, you need a newer version of q3map2 than 2.5.11, grab the one from the “nightly build” link at http://shaderlab.com/q3map2.


(Mean Mr. Mustard) #49

I grabbed the latest build of q3map to see if I too can create nice terrain…

q3map complained about “msvcr71.dll” - any one know where I can download that library? I looked in ydnar’s site, but didn’t find it.


(Fusen) #50

damn thats a nice map you got us all excited now lol looking forward to more screenies or even a playable demo :wink:


Ford Xr Falcon Specifications


(rgoer) #51

mscvr71.dll can be had from windows update (for now) by grabbing the latest .NET runtimes, or if you wait 'till ydnar gets back he might start hosting it with q3map2 (since a lot of people seem to need it).

edit: http://spog.tshup.com/msvcr71.zip


(Loffy) #52

Sorry, “terrain entity” == “func_group” … suppose I should have been more clear.

Nemas problemas! I just try a lot of thing. If it works, great. If not, I’'ll try another apporach.
I’ll already tried to make them func group (but it didnt work).

You mentioned that blending wasn’t working for you, that all you got was dirt. What do the alpha channels for your targas look like?

Hm, this I dont understand. What do YOU mean by alpha channel? Ive taken three nice textures and opened them in photoshop. To all of them, I’ve added a new channel, an alpha channel. But this new channel is all black be default. So I though: “Hm, he said somehting about 85-95 percent. He must mean ‘make sure they are bright’”. So I added a filter called “Clouds” to soften the all black channel. I even hand drew some white lines with a brush - just to make sure that some parts of the alpha channel was really bright.
(Am I right? I have no idea. Just fiddling around.)
Then I saved them as 256x256 pix. 34 bits tga’s (with alpha channels). I called them dirt.tga, grass.tga and rock.tga. All three have alpha channels.

Also, in order for dotproduct2 to work, you need a newer version of q3map2 than 2.5.11, grab the one from the “nightly build” link…

Hm, this could be it. Will try this now.

Texture the top surface of your terrain with your alphablending terrain shader instead of common/terrain.

Aha! Only the top of my brushes. I’ve just textured the whole of the bushes (exept the bottom)! Will try this aswell.

// Loffy

PS, almost forgot: thanks! Really appreciate it!!


(rgoer) #53

I hope it works for you. It sounds like you’ve got a pretty decent grasp on how the alpha channels are supposed to be set up… here are a few tips on alpha channels (for this kind of shader), though: assuming your bitmap is a seamless texture, you’ll generally get pretty decent results by just copying the rgb channel and pasting it into the alpha channel (and then adjusting the levels or brightness/contrast until you’ve got the 85-90% brightness level needed by the shader). This way, you’re sure to get seamless alpha, and its pattern will correspond (in some manner) to the color bitmap as well. Unless you make it seamless by hand, just rendering clouds will have a definite seam, which could uglify your alpha blending… in any case, good luck, and I’m glad this is helping somebody ;^)


(Loffy) #54

Sorry for spam, but I just want to add the shader:

textures/testmap/terrain
{
// standard terrain shader stuffs:
qer_editorimage textures/testmap/rock.tga
q3map_nonplanar
q3map_shadeAngle 179
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
q3map_tcMod rotate 33
q3map_lightmapAxis z
q3map_lightmapSampleOffset 8

// this means dot product squared, for faster falloff between vertical and horizontal planes:
q3map_alphaMod dotproduct2 ( .85 .85 .85 )

// mapping stages:
{
map textures/testmap/dirt.tga
rgbGen identity
}

{
map textures/testmap/rock.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaFunc GE128
rgbGen identity
alphaGen oneMinusVertex
}

{
map textures/testmap/grass.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaFunc GE128
rgbGen identity
alphaGen vertex
}

{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}


Why ( .85 .85 .85 ) ? Well, I just wanted to try some some values and I just took these at random. I will try different ones later one.
The textures rock.tga, dirt.tga and grass.tga all have alpha channels.
// L.


(Irrelevant) #55

OffT:

Is it possible to open Q3:A maps in ET ET (or open them in Radiant for ET and tweak them to work for it)? I’d really like to have a look around S.A.F.E. (amoung others), as linked by sock. :cool:

Otherwise, sock, is there any chance you could use some uber-devtool to port it (even if just the brushwork)?

OnT:

Looks like a big improovement over the old system. Not that it’s bad or anything, just this is better, y’see?

Umm… ignore me. :bash:


(rgoer) #56

Loffy: I’m not sure how having all three of the ( x y z ) values equal for dotproduct will work. You might try having at least one of them different from the other two (for terrain falloff, having the z value being the outlier might be most appropriate).


(michi.be) #57

Well, Mr.Dotproduct dislikes “surfaceparm grasssteps”. E.T will crash is this command is in the shader.


(rgoer) #58

Michi.be: I don’t think so… I used it in my terrain shader, and everything seemed just fine…


(michi.be) #59

thx for the fast reply. :slight_smile:
My E.T crashed to windows then i shot at my terrain.
I will play with the options a bit and try other surfaceparms.

Other thing:

At the edges where my vertical brushes meet the brushes with the dotproduct shader the textures don’t fit.


(HairyPlums) #60

A quick Q -

Is there anything special about the alpha channels in the images? I’ve not been able to use my own images for dotproduct2, although I can do my own shader no bother - if I use the images from Ydnar’s example…