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 ?
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 ?
#2
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 ?
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 ?
Torque Owner Matthew Jones
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