Home Technical Talk

Lighting vs. Texture Shadows

I'm not sure exactly how crazy this sounds yet... because I have to get a bit more game engine stuff done before I can run some more solid tests (Android... 1 Ghz phones or better) but if I am going to be using OpenGL lighting, how important is drawn shadows and highlights on textures?

I ask this partially as a struggling texture artist who hasn't quite learned enough to make a texture look proper yet. I drool at the low poly contest entries...

In any event, some simple tests seem to show that fairly flat colors come out reasonably well with OpenGL lighting, but would be be a better practice to supplement it somewhat with texturing?

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    With that low of a hardware spec, you'll get the most bang for the buck if you go with no lighting at all, and put all the lighting in a lightmap. Here's an example.
    http://wiki.polycount.com/LightMap
  • die_Kröte
    Options
    Offline / Send Message
    I'm not 100% exactly how low the actual target spec is really going to be. I'm not writing for any older Android phones and I'm almost considering ruling out snapdragon devices altogether, or at least warning them that performance won't be as good as with Hummingbird or TI OMAP processor devices (both of which have very nice PowerVR GPUs).

    I suppose I can go with more simple single textures and OpenGL Lighting (1 or 2 at most) and see how it goes and if it really is too slow, disable them and go back to the drawing board on the textures.

    I'm gathering that LightMaps are used for environment that doesn't move, and color array light direction + normal map + color map with Dot3 blending for characters is the way to go?
  • Eric Chadwick
    Options
    Offline / Send Message
    Yes. However you have to have the RAM for it, which I'm guessing you do not.
  • die_Kröte
    Options
    Offline / Send Message
    Which part are you saying is more RAM intensive (lightmaps, normal/dot3 lighting or both)? I've seen quite a few tutorials and such for these kinds of things for iPhone and a lot of current Android devices have equal to or greater hardware specs (My Samsung Captivate has the same CPU (without an FPU unfortunately) as the iPhone 4). As I understand it, Google limits Java based code to 20 megs of Ram though native memory allocation via JNI can access all of a phones available RAM. Current gen (not sure if they should be called next-gen anymore) Android phones have 256 to 512 MB of RAM (though of course not all of that will be accessible due to what is in use already).

    It's beginning to sound like a damned if I do and if I don't situation... if the specs don't work out but I'm thinking they really should be okay.
  • Eric Chadwick
    Options
    Offline / Send Message
    Color map + normal map is double the texture load for characters, vs. just a color map alone with painted-in lighting. Given that the lighting on a mobile is going to be significantly less robust than a PC, and given the increased artist time for normalmapping, it may be better to paint in most of the lighting.

    A good example of painted-in lighting.
    http://www.polycount.com/forum/showthread.php?t=74450
    ... which you could augment with in-game lighting, like Quake Live does.
  • Mark Dygert
    Options
    Offline / Send Message
    Yea on that kind of hardware you're almost always better off with no lighting (everything full bright) and painting/baking in your lighting. Unless it plays some kind of important game play mechanic role, its better to use the processing power on something else.
  • die_Kröte
    Options
    Offline / Send Message
    Geez... those are gorgeous...

    So the honest truth... is that of all the things I'm tackling for this project, the textures are my worst fear of completely screwing up if I go with all drawn in lighting. I was really hoping that OpenGL lighting would be an option and would just cover my deficiencies... It's already slow going and learning this is going to add a lot of time... I guess that's that name of the game though.

    Okay... so I guess I have this plan...

    I'm probably going to go ahead and setup a test case and see exactly how using OpenGL lighting performs. It may be inevitable that it'll be too slow, but it still might work with the game style I have in mind, it's more of a turn based rpg feel and will have small areas at a time (A la Vagrant Story) so there is still a hope that the GL lighting will be okay.

    If I do drop them... is this a relatively decent procedure (partially taken from the SoilChild texture tutorial here...)?

    1. Lay down basic colors.

    2. Setup lighting and Bake the lights/AO in a separate image.

    3. Overlay those in the image editor over the basic colors...

    4. Fine tune from there...

    PS... any thoughts on the shoulder progress?
  • Eric Chadwick
    Options
    Offline / Send Message
    Yeah, that should work OK since you don't have painting experience. The lighting will be pretty basic though since you're probably using a low-poly model. Unfortunately it's not easy to get around this without a qualified artist; that's why they're there. :)
  • die_Kröte
    Options
    Offline / Send Message
    Oooh.... believe me. If I could convince someone to take the project on on the basis of taking a cut of profit and not pay someone in advance (with money I don't have) I'd do it in a heartbeat.

    I shouldn't quite say it like that... there's a stubborn child, dreaming somewhere inside me that wants to achieve this alone... but there's also 33 year old family man with a full time job who has to be realistic... sooo if you're interested... :poly121:
  • Mark Dygert
    Options
    Offline / Send Message
    die_Kröte wrote: »
    I was really hoping that OpenGL lighting would be an option and would just cover my deficiencies...
    Lighting in games has always sucked and continues to suck. Its the advancement in shaders and post FX that have really given games their boost and allowed artists to relax a little. Sadly both of those things are also lacking on the ultra low end hardware...

    Depending on the game and the assets you could probably experiement with baking and painting in some really advanced lighting. You also might want to look into vertex colors and lighting, they can be a cheap way to really punch up the lighting, as well as baking lighting into objects without baking it into the diffuse materials. Basically using tiles and unique shadows without realtime lighting.
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    You might also want to bake a second lightmap with an omnilight above the model. This can help you with placing your own, added shadowing (if you're going for 100% selfilluminated textures).

    I don't think it's feasible to use normalmaps on a cellphone, but you will be able to use a specular map to fake some depth, simply by having the deeper parts be less specular. But it depends a bit on the materials too.

    What type of game and models will you be working with?
  • die_Kröte
    Options
    Offline / Send Message
    Without giving away entirely too much detail, the game is a turn-based rpg style, so not a lot of dramatic movement really, though there is potential for some here and there. Areas will be room by room (like Vagrant Story if you're familiar) as part of the effort to keep the polycount down.

    I don't believe that I can use specular shading with OpenGL ES 1.1, (I'm just not familiar with 2.0 to switch to GLSL).

    I've still got a lot of testing to do to really feel out what my actual polycount and lighting limitations are going to be on the hardware, so poly-limits are hard to quote at the moment. The main character model I'm working on I hope to keep to no more than 2000 tris. Once he's done, I'll put together a simple room, some other objects, turn on lights and start moving everything around and see what I get.

    Android phones are really coming a long way and I think maybe are being under estimated a bit, but of course I'll have to put my money where my mouth is when the time comes to prove it.
  • Eric Chadwick
    Options
    Offline / Send Message
    One easy trick for specular-like effects... use SEM to fake specular, and use a specular map to mask that per-pixel.
Sign In or Register to comment.