So, as always, about those effects:
Partially Transparent:
Doing this will make your own materials transparent, based on the alpha you set. In order to achieve this, you'll have to draw those objects back to front (based on the distance from the camera). The reason for that is, to make a pixel "transparent", I actually need to know what color is already there on the screen, then do the calculation based on the alpha that I set.
Binary Alpha:
Basically, you set a threshold to determine whether the alpha value in the texture is 0 or 1. In other word, completely opaque or transparent. In this way, you can "cut" the irrelevant part of the texture that you don't want, which is pretty handy in many cases.
Additive:
Add the color info in this texture to what's already in the scene. Kind of like the binary alpha, but instead of completely overwrite the original pixel, it adds to it.
The tough part of this assignment is to render the partially transparent entities. The sorting algorithm is easy, but because of the way I did the sorting (I sorted effect->material->entity on load using a manager kind of thing) in Graphic 5 & 6, I can't sort the distance from the camera based on effect. I have to get the entity list again the way I did in Graphic 4 and do the sorting on that base, which actually took me sometime.
Some textures that I used are from this website: textures
Screenshots from PIX:
Screenshot for the game:
Control:
To control the point light:
use "I" - up, "K" - down, "J" - left, "L" - right, "U" - backward, "O" - forward;
To control the camera: Arrow Keys
To control the box: WASD.
Link to the code:
Graphic 07



No comments:
Post a Comment