Today we have implemented a basic lighting model for our graphics engine. We first implemented the ambient light which we simply multiplied by the object color in the fragment shader. We then implemented some diffuse lighting by looking at the dot product between the surface normal and the vector between the vertex and the light source for each vertex. Now, our 3D piglet looks 3D again! The lamp is visualized with a pulsating white mini piglet.
At this point, our diffuse light doesn't take shadows into account. This means that some planes on the ears for example receive light even when the lamp is under the pig, which doesn't look completely natural. However, we are going to leave details like that for later. Now, we are really anxious to start generating fur!
Inga kommentarer:
Skicka en kommentar