Tags

Hello, this week we have been going through how to properly render something in dirextX, there are several things to be considered. In my recent post I talked about creating a box and how we calculate it. But in order to make our box act as if it were in the real world there are a few things we must code, a light source is one major aspect in order to get an object to feel more real.

In directX there are a few methods of doing this, for this example we’ve chosen a Point type, it is a positional light that emits light in all directions, evenly. But there are two more lighting types that we unfortunately don’t use in this program. There is the spot lighting that is a positional lighting just as point but this type emits light in a specified direction. The last major type is the directional lighting type, it emits light in a specific direction but it does not have a position, this type however doesn’t have a position. This may sound odd but the source of the light is indefinitely far away. It’s perfect for simulating a sun.

låwda

You can see on the left side of the box the textures are black. It’s an effect of the light not being reflected on the surface.

Not showing on the picture is a prototype for gui (graphical user interface). It is the latest addition to the project, I have not really dug down into the code but I believe that the gui is located in in the camera space, so that it always will follow the camera.

Well that’s it for me. Next week is Culling J