Home Unreal Engine

UDK - Low End Shaders/Material (AKA Old School Tricks)

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all,

I was wondering, if anyone in here is willing to share some insight and maybe (pretty please) share idea and techniques on how to create and fake special materials/effects in UDK to save up on resources for low-end, small/portable quality games.

An example of what I mean, is recently (after much beginner mistakes), I was able to create fake Emssive effect by applying a plane to places which I want to have emissive in my mesh, locking them in place, and creating a shader system (real simple one, optimization was the main problem I had) to make so that it always faces the camera and doesn't create horrible clipping issues though the mesh.

Also, through a simple small texture which is gradient based, I can control the strength of the material/emissive pending on how close the camera is via the Lerp node.

Using this method, I can also create fogs and snow glow through a material constant, and dictating through a color node, what strength my 'ambient' color should be.

Basically, the old school techniques they used before everyone got fancy shaders to say it mildly.

So yeah, I was wondering if anyone has some interesting tips and tricks I could follow to go old school on some of my stuff.

Cheers and ciao.

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    well.. a lot of oldschool games used highly unified art direction, so they could have very limited and shared palettes.

    Cube mapping has been around for a long time and can be very powerful. I set up a fresnel effect with it in UT2k3.

    Sprite based effects like you said you did are a solution. The lens flare and bloom in many a game was done that way.

    And really just good solid texturing skills, combined with a either neutral, or highly self-consistent art direction go a long way.

    Some engines have procedural texturing techniques for some effects. Unreal 1 had a 2d particle system that drove its water, fire, and other moving textures. Quake3 had its own shading language for some of its effects.. before that, yeah good painting skills, flipbook textures and sprites for effects and special stuff.

    Any particular effect you're looking for?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Not really anything particular, just trying to understand and tackle old school stuff that they would have done in PS2 ages inside UDK if I was looking to create something for a device on such a level.

    I'm curious about the Bloom and Lens Fare method, how would I got about making it? I tried using the same idea of the "LookAt" function for the emissive, but I feel like there is more to it.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    nah thats pretty much it. A plane with a lens flare texture placed at the light location and set to always face player camera. Sometimes you can control opacity with a dot product between player facing angle and sprite location so the flare only shows brightly when you look at it directly.

    Starsiege (1999) had a sun flare mechanic like that made up of I think 6 planes, one for each part of the overall lens flare effect, that moved and faded as the player looked at the sun.

    Really everything we're doing on the highest end is more like.. layered from the PS2 era. We can do everything at once instead of picking a few bits. The chips are faster so we can do more calculations per frame. PS2 era games had framebuffer effects, stencil shadows, occasionally even simple normal or bump mapping as I recall. They didn't do selfshadowing, and tricounts were lower.

    The two biggest bottlenecks for that era.. well they're the same now. Graphics memory and processor power. Just smaller. So 512^2 palletized textures or smaller, fewer textures per model, like diffuse only, and either unlit or a simple lambertian diffuse model.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, that's an idea, thanks. Much appreciated for the time you're giving mate :)

    I have small question, I see most MMO games which don't have a robust engine or budget take, fake depth of their models and such, using clever techniques with the Spec Map instead of the normal map.

    I have seen character models in MMO which faked the skin effects, through this on a basic level, emulating some nice looking wet/sweat effects.

    I was wondering how viable it would be to set up a Cubemap, through fresnel, on my Spec Maps, to get such an effect? Would it be heavy anyway or form? Also, do you recommend me to go into the Emissive Slot with low values for this idea, or stick to traditional Spec and Gloss?
  • Sandro
    Options
    Offline / Send Message
    You can switch to custom lighting model in material editor and build your shading from scratch. Nicely painted diffuse map coupled with proper ambient cube and vertex color for AO might be a good start.

    Using phong model with spec is heavy in itself and more lights hit the object, heavier it becomes. You want to get away with as little light-object interactions as possible.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, interesting, do you know of any places I could read up on UDK's custom lighting? Would grand if I could get my feet wet in that area.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    http://udn.epicgames.com/Three/MaterialsCompendium.html
    http://udn.epicgames.com/Three/MaterialEditorUserGuide.html
    http://udn.epicgames.com/Three/CustomLighting.html

    Basically its a "do-it-yourself" node. You'll have to specify how lighting affects your model to get results out of it. The default phong model is disregarded when using custom lighting. you can check my Minnaert shader model video on my youtube channel for a simple material using custom lighting.
    [ame]http://www.youtube.com/watch?v=JPHBWXEi0V0[/ame]
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Interesting, thanks a bunch mate, this can really be useful.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Double Post: Sorry peeps, will make this quick.

    Me and a buddy of mine are debating on certain aspects of shaders vs. pixels, specifically, displacement.

    In UDK for example, I can set up a vertex blend material that also (through proper controls) can displace visually a mesh if I paint certain materials/color on it.

    Question is, when doing this, is the material limited (and visually displaces) on the mesh through the height map if I use one, or does it limit itself to the number of division on the mesh?

    So basically, do I get a much better bang for my buck if I use the material to displace my mesh through Vertex Blend using the Height Map as a mask for displace my mesh when painting, or would it be more efficient to do it old school.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Ace-Angel wrote: »
    Question is, when doing this, is the material limited (and visually displaces) on the mesh through the height map if I use one, or does it limit itself to the number of division on the mesh?
    .

    Vertex offset, and vertex colour, only works on the vertexes you already have. It doesn't add vertexes to a mesh.
  • Highelf
    Options
    Offline / Send Message
    Highelf polycounter lvl 11
    Has anyone ever tackled making (faked) subsurface scattering for tree leaves? I don't have the gfx card to do the real SSS feature in UDK.

    I've been trying out some stuff but to no avail; I guess the only way to \add/ lighting effects is by rewriting the base light setup (like phong) in the custom light plug? Anyway the way I was thinking was a very simple 2D SS map + light vector calculation to lighten up parts of the leaves depending on thickness. Any ideas or resources on how to approach it? Google gave me nothing.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Highelf wrote: »
    Has anyone ever tackled making (faked) subsurface scattering for tree leaves? I don't have the gfx card to do the real SSS feature in UDK.

    I've been trying out some stuff but to no avail; I guess the only way to \add/ lighting effects is by rewriting the base light setup (like phong) in the custom light plug? Anyway the way I was thinking was a very simple 2D SS map + light vector calculation to lighten up parts of the leaves depending on thickness. Any ideas or resources on how to approach it? Google gave me nothing.

    Have a look at the foliage map (or the night and day map) that come with UDK. JordanW has made a few SS materials for plants in those maps using a few different techniques.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    If you can use Fresnel as a base in the Transluceny node, work your way up from there, it should help abit.

    That's the cheapest way I know of doing it quickly and dirty. Sprung is right on the money with taking a look at the DN package. You could look for the SSS shader also: http://forums.epicgames.com/showthread.php?t=732232
  • Justin Meisse
    Options
    Offline / Send Message
    Justin Meisse polycounter lvl 18
    Ace-Angel wrote: »
    Hmm, that's an idea, thanks. Much appreciated for the time you're giving mate :)

    I have small question, I see most MMO games which don't have a robust engine or budget take, fake depth of their models and such, using clever techniques with the Spec Map instead of the normal map.

    I have seen character models in MMO which faked the skin effects, through this on a basic level, emulating some nice looking wet/sweat effects.

    I was wondering how viable it would be to set up a Cubemap, through fresnel, on my Spec Maps, to get such an effect? Would it be heavy anyway or form? Also, do you recommend me to go into the Emissive Slot with low values for this idea, or stick to traditional Spec and Gloss?


    which MMO? Most of the time it's just diffuse and specular color - and maybe normal maps if you're a crazy. I don't know how it works in FPS studios using Unreal - but from my MMO experience, artists don't build their shaders, you'll have maybe 2 to 3 to choose from and it's usually environment shader, character shader and FX shader.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    which MMO? Most of the time it's just diffuse and specular color - and maybe normal maps if you're a crazy. I don't know how it works in FPS studios using Unreal - but from my MMO experience, artists don't build their shaders, you'll have maybe 2 to 3 to choose from and it's usually environment shader, character shader and FX shader.
    That makes sense, oh, about the MMO, it's this one: http://www.playrequiem.com/

    I remember hovering my mouse on the characters and being pleasantly surprised when I noticed it was the spec map giving the depth and material properties on the character and not normal map (since they don't use one).
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Ace: A really big contributor to the normal mapped look is the specular portion. You'll also notice that normal mapped models with lazily created specular maps look far more flat. Often times the grey shaded model with normal map will look more impressive than the final fully mapped version.

    You can really control how a material reads via its specular. Think of premultiplying an AO bake with your specular, and modulating the hue and saturation directly in the spec map to respect the ideal shape of the model. If you pay enough attention there you could fake normal map detail pretty well, especially if your game has limited lighting environments to take into account, like almost always above the player, even indoors.

    Justin: The only unreal based title I've been able to dig into shader wise is UT3. They have essentially shader families. Main environment shaders, and one or two master shaders for characters. Actually I think there are 3. One for robots, one for the krall and one for the humanoids, as they all have a little different SFX implementation for some weaponry hits. So a similar sort of implementation to how you've mentioned. It makes sense performance wise.

    @high-elf: There are a number of solutions I can think of. Some of it depends on how general a solution you want.

    If you are mainly concerned with looking through leaves from below, the cheap trick is to have 2 planes per leaf. The top plane gets textured normally. On the texture for the bottom plane paint the stem and veins of the leaf a deep green, nearly black, paint the leaf body a lighter saturated green you'd expect to see if it were lit through by the sun, then just point the normals on the bottom plain up toward the top plane, but make sure the polygons face down.

    IF you're always under the leaves, and the light is always above them you'll get a nice translucent effect with zero shader overhead.
    LeafExample.jpg
    of course you should do a better job than I did on your textures. ;)

    Leftmost is a max viewport grab with the planes separated. To the right are the renders. Setup is a single omni light above the leaf.
  • Highelf
    Options
    Offline / Send Message
    Highelf polycounter lvl 11
    Thats actually a really cool technique. I might have to give that a shot! Thanks man. (and sorry for the late response.)
Sign In or Register to comment.