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
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?
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.
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.
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?
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.
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]
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.
Vertex offset, and vertex colour, only works on the vertexes you already have. It doesn't add vertexes to a mesh.
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.
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
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.
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).
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.
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.