Light & shade fx
It would help to have some knowledge of the way light behaves. It doesn't bend, it diffracts and this is on account that light changes direction when traveling from one medium to another. You don't have to be too concerned about the physics of light but you should know a little about it. When in doubt, try to set up a small experiment in which you will see how the light should look. Getting the right slope makes a difference in the end result of the area you are working on but it doesn't have to be exact. The closer to reality, the better but don't be too concerned. Remember, the player is moving through the map far too quickly to make a mental note on whether the light slopes just as it should. Implementing the exaggerated shading is more important. If you do any shading, you will have to consider the light source in the area. It could be a physical light source or one that cannot be seen but even on a cloudy day the sun would be at a particular position in the sky which would act as a directional source. Whether it's the sun, the moon, or an incandescent light bulb, it doesn't matter what it is but where it is. Once you have decided the direction in which the light is coming from, you will have to make the appropriate sectors for the shading. The easiest way to do this is to consider the light source while you are building an area in your map. For instance, if I am building a room with a rectangular shaped light in the center of that room, I might want to double up on the use of that sector (the one used for the rectangular light) as a box or table on the floor. Now, since the light source is in the middle of that room, I should consider all the objects that I have placed within that room starting with the source of the light. The light would be, naturally, brightest on the top of that box, the sides would be darker, and there would be another rectangular shaped shadow enclosing that box on the surrounding floor. With these things in mind and being that the Build engine does not like it when you make an enclosing sector around one that has already been created, start by making the sector that will be the surrounding shaded area and then make the inner sector that will act as both the light source and the box on the floor. Light & shade fx: sectors Next, you would consider the other objects in the room, where they are in relation to the light source and how the shadow would fall around those items. With this decided, you would make the sectors for the shaded areas. If the object is not any where near another one, then you do not need to consider shade over onto the adjacent objects. However, if there is an object that is near, you would have to consider how the shade (or light) would effect the shading of this object and then consider how you will make the sectors for the shading. You may have to divide or add to the existing sectors to have the shading look right. Here is where the problems start to arise. When you start making the sectors to achieve the appropriate shading, you will encounter problems. The kind of things that occur are things like sectors mysteriously joining, disappearing, going from a valid player space to an invalid player space, and of course, unintentional mishaps on your part. To avoid as many of these problems as possible, you may want to keep these things in mind: 1- Less problems seem to occur when making the sectors from the wall to the object. If you need to have a shadow from an object join the wall of a room, rather than start drawing the sector from the object to the wall, draw the sector from the wall to the object. Start by placing the points close to where you will need them on the wall with the grid locking on, and then, starting from one of those points on the wall, connect it to a point on the object (if the point on the object you wish to join to are not on any size of grid, then while you make this sector move them so that they are locked on a grid point). In short, always start your shadow sectors from a point on the wall to the object when and if the shadow must touch the wall. Once the sector is made, if you need to, turn the grid locking off and move the points to where you want them. note: Usually there are at least two points to any shadow touching the wall. When connecting those points to the object, connect one side from the wall to the object, then connect the second point from the wall to the object. 2- When you do not have to have the shadow sector touch the wall, start from the object outward. 3- If you have already made an object (for instance, the rectangular light and the box/table underneath) and now you have decided that the light source in that room (or area) has got to result in a surrounding shadowed sector, then there is trick to making that surrounding sector. Let's go back to the box in the center of the room, light source directly over top idea mentioned earlier: Say, you have got that exact situation but did not consider the shadowed area that should be around this object. Well, if you haven't experienced this, you will: try making a sector outside one that has already been created and the engine will not know how to display it. The engine will behave as if you are making a level over top of it...thing is, the surrounding sector you just tried to make is on the same level, hence weirdness ensues. Here is what you do to avoid that: see example Light & shade fx: shadows
There are various ways of making shadows appear on the walls of your maps and it all depends on what you are trying to make and how the area of map is designed. There is just not enough space on this server to talk about every possible situation but a few examples should suffice and get you started. One way is to make a small sector behind the wall. If a shadow is being projected from some object to the wall, then the same two points that connect the wall to that object will be the starting points of the sector behind the wall. This sector does not have to be very deep. Make the sector, pull the bottom half up from the floor to the height you wish the shadow to be. Then pull the top half down to meet the bottom half. Align the texture. In 3D mode, hold the cursor on the top half, hit the 2 key to split the top and bottom texture attributes and shade the top or bottom to what suits your plans. Some times you have to reapply the texture to the bottom half after using the 2 key. Not a big deal. note: You will not be able to scale the bottom texture once it is split. The bottom texture will be the same scale as the top half and the only thing you can do with the bottom texture is move it for alignment. Another way, and this is my favourite, is to simply use a one-sided sprite for the shadow. It has its limitations but in most cases this trick works really well. The best texture to use is the default texture, tile # 0. Place a sprite on the floor, give it the default texture, make it flat, r, one sided, 1, and move it against the wall right in the middle of the points joining the shadow from the wall to the object. Now, scale it to the appropriate width and height and make it transparent ( press the t key twice on the sprite to get the most transparency) and for the final step, shade it appropriately. see examples
|