Game Development Community

Simple Terrain lighting

by Josh Druckman · in Torque Game Engine · 02/03/2003 (10:55 am) · 2 replies

I am working on a game with both outdoors in indoors environments. One thing I noticed is that interiors are 'well lit' with normals and light sources so that scene lighting can be configured with material properties and directional lights.

Unfotunately this is not true for outdoor scenes (exterior). Terrain is not affected by any 'real' light (sun etc.), only by pre-calculated lightmaps. In fact, it looks like there is no material for the terrain and all its textures are rendered in GL_REPLACE mode. We get a wired effect when all objects placed in the terrain respond well to lights, but the terrain itself don't.

What is there I can do to get some decent lighting on the terrain ?

About the author

Recent Threads

  • Using TribalIDE

  • #1
    02/03/2003 (12:43 pm)
    I probably ain't much help on this. We looked into trying to add static lighting for exteriors. Basically we were going to duplicate the SUN but on a smaller scale and have it calculate the lightmaps from it with the lightmap from the sun. I can remember all the detail's of it but the one thing I know is we needed to get a little more education on the whole thing before attempting it.
    I know that is no help but if you already know what your doing I would guess that looking at the SUN.cc file in Terrain might start giving you a clue as to what needs to be done to create static lights.

    The FXlight (search resources) lights anything up in the level dynamically but it can be a framerate hog. Best used for light coronas and things of that nature.

    Hope you get somthing out of this
    Matt
    #2
    02/03/2003 (1:25 pm)
    This is fine for static lights, and I don't want to get into static lighting code.

    It souldn't be too difficult to render the terrain in modulate mode, and make sure vertices have normals.
    From looking at the code, it looks like some similar code is enclosed in '#ifdef' block that has to do with NPATCH.

    Any clue what that is ?