terrain blending tutorial


(Lil Killa) #101

When I load up my map with the shader I posted above I get an error telling me something baout the “rgbGen identity” so I take it out and everything screws up…

any idea about why that could be?

Also I saw in a nother thread that you can’t really give a good time estimate for your tuts but some kind of rough estimate would be nice if possible :slight_smile:

Thanks,
LK


(ratty redemption) #102

what game are you mapping for?

Ive never found a reason for me to use rgbgen identity other then on lightmap stages, but I think it may have something to do with over bright bits on some gfx cards... does any one else here know more about that? or correct me if Ive completely got it wrong.

as for an eta on the next tutorial, Ive spent over a month trying to find time to finish the current one, so sorry but it could be any time from next week to next month before I start posting the new one... and its not through lack of motivation on my part, just Ive been doing a lot of rtcw, et mapping and mini mod stuff for ja which is time very consuming... so much so I hardly have found time to just play which Im kinda missing, but I know some of you guys are waiting for me to get the tutorials out so they are quite high on my priority list.


(WolfWings) #103

Just to re-check… any problem if I finish writing up my ‘simplified’ version of your dithered terrain tutorial, and post it on my web-space?


(ratty redemption) #104

@WolfWings, no problem if you credit me where appropriate :slight_smile:

its not even a ego thing with me, the publicity side and tbh, half the reason Im doing these tutorials, is to help secure a job in the games industry when I apply for one.

iow, I consider the tutorials part of my cv …although god knows what any perspective employer would think if they read the off topic chat between me and Mr Tickles :wink:


(WolfWings) #105

N/P. I’m working up a simple web-page to show how to build ‘dithered’ terrain using fewer shaders and textures at the moment.

The page will explain how it works, both with ‘sharp’ dithering and ‘smooth’ dithering, and how to use ‘sharp’ dithering in combination with dynamic lighting. It will also include the ‘costs’ of the technique, and ways to minimize them in some cases.

I also found a way to improve the ‘costs’ of the texturing effect further, making it cost a flat 2 textures per ‘dithering’ effect. I.E. Using a dithering_snow.tga and dithering_snow_invert.tga file, no matter how many surfaces you’re dithering snow onto. This led me to an interesting (and expensive at four shaders, but very pretty) double-dithered effect, appropriate for things like loose snow caught on the rubble of a cliff face.

I do hope you don’t mind the terminology I’m digging up and applying to these techniques? They really are your discovery, I’m just refining it into more verbose, fixed terminology and trying to simplify it where I can. :slight_smile:

Anyways… ETA is somewhat unknown (end of this week, I think?), but the effect is definately very good for things like rust, or patches of snow on terrain, as obvious examples I’ve been beating to death like a horse. If I can find a way to apply the technique to dotProduct2 terrain, that will be something of the ‘holy grail’ of sorts. Though that will require careful parameter selection for the dotProduct2 values, even for a math-head like myself, so it’s probably easier to just manually design that kind of terrain if you’re going to use it with dithering, unless I can get ydnar to add a feature to q3map2 to let us design ‘dithered’ terrain on a 0.0-1.0 Alpha scale, and have q3map2 double that, and split the terrain into two shaders depending on if the terrain is 0.0-0.5 or 0.5-1.0. Making it special-case 0.0 and 1.0 terrain polygons would be nice as well.

Anyways… I’ll post the URL when the page is done and uploaded. :slight_smile:


(ratty redemption) #106

sounds interesting and I`m looking forward to seeing pics, sample maps of this, as well as your input on the next set of shaders I post.

on the naming conventions your using, is ‘sharp’ dithering and ‘smooth’ dithering referring to the use of alphafunc ge128 and blendfunc blend or similar?

btw, if need be, in future could you use bold lower or sentence case highlighting to emphasize important text, as I personally really don`t like capitols, as you might of noticed.


(WolfWings) #107

Yes, sharp refers to using alphaFunc while smooth uses blendFunc effects. Sharp terrain can be set up so the lightmap is rendered first, allowing it to be used with lightstyles, for things like lightning and similair. But, to me, smooth terrain often looks better, especially up close or in screenshots, as it avoids any jagged edges.

And if I use some all-uppercase parts, that’s a long-standing and well-ingrained habit from programming OpenGL effects in C directly, where things like GL_SRC_ALPHA are actual constants that are defined for use with OpenGL, and those constants are in all upper-case, so my fingers hold down the shift key out of reflex now when I type them out. :slight_smile: Similair reasons are why I write ‘alphaFunc’ instead of ‘alphafunc’ or ‘AlphaFunc’ actually. Programming practice for me is lowercase-to-start with an uppercase first letter to mark each sub-word of a descriptive variable or keyword.


(ratty redemption) #108

cool and totally understood …just try to keep in mind my preferences if needing to rant in non code :wink:


(Lil Killa) #109

The game I’m editing is JA…


(ratty redemption) #110

@Lil Killa, the shader you posted above looks fine to me, and considering I dont normally use rgbgen identity, Ive never had any problems with writing shaders for ja models, particles or sprite effects like the weapons use, although tbh I haven`t yet written, tweaked any map shaders other then changing the fog color of some of the default maps.

iow, I don`t personally know why ja would be complaining about that shader command.

try checking your syntax and paths to your tex images, just in case it`s something else that is creating that error.