StarGames - Josep Huguet Giron

I'm Josep Huguet, and I was in charge of the graphics programming. I developed a diverse amount of tools in the engine for the Art and Design teams, while learning all sorts of techniques on computer graphics.

LIGHTING

Just like in any videogame engine, The Creator can make use of three different types of lights:

- Directional Light: It mimics the lighting that you would get from the sun. Directional lights emit parallel light rays in a single direction but the light reaches out into infinity.

DemoFire

- Point Light: It mimics an incandescent light bulb that emits light in all directions.

DemoFountain

- Spot Light: With it, light is emitted through a cone whose angle you can control, determining how much of the area is actually illuminated

DemoRastro

As shown in the picture above, the designer can determine different values for each light. Color and diffuse values are general for all three lights, but spot lights have a cut off value to tweak the angle of extension.

Although all these values can be saved, I also implemented a way of accessing them from scripting to edit them from C# code (being able to for exaple switch them on and off, or even changing the color).

Lights are behave as components to game objects, meaning that any game object can have a Component Light attatched to it. As a side note, lights position and rotation are matched with the game object's Component Transform.

NORMAL MAPPING

Due to the use of low poly objects, Normal Mapping was mandatory. Thanks to it, the art team was able to add details without using too many polygons, greatly enhancing the appearance and details of a the low polygon models. Here is an example of how greatly the result improved after implementation:

DemoRastro

SHADOW MAPPING

On Concept Discovery it was decided that shadows were mandatory for at least Directional Lights. This was done by testing whether a pixel was visible from the light source, all with the help of a z-buffer stored in form of a texture attatched to a framebuffer.

DemoRastro

OTHER GRAPHIC TOOLS

During the development of the project, I was requested to do other tools to help the art and design tools to reach the goal they had envisioned. The most important ones were:

- Opacity Maps: Mainly for lasers, opacity maps allowed meshes to become transparent at certain parts.

- Blending: By rendering objects with custom transparency from further to nearer, I was able to properly blend the lasers in fragments where the alpha was smaller than 1.

DemoRastro

As seen on the .gif avobe, light was disabled for lasers to make them look shiny. This was also a feature requested by the art team.

- Texture Tiling: To avoid textures with high resolution, I was able to tile textures by muliplying their texture coordinates. These changes were saved for each material, there is a particular UI for this feature, and it is also available for Normal Maps.

- Second Diffuse Layer: As a simple approach to a detail map, materials can have up to two diffuse textures. The second one is placed over the first one, and its texture coordinates are totally independent.

DemoRastro

RENDERING OPTIMIZATIONS

The most important ones were: sorting objects by their materials before being rendered, and minimizing going back and forth between different shaders (which was very time consuming).

PERSONAL NOTE

Before this project, I had never had any relation with shaders and little to none experience on computer graphics. Doing research to accomplish these tasks was quite challenging for me since, until now, all I had learnt was from class. In the other hand, I believe it was a positive experience to investigate by myself while working on an engine I had no relation to.

A part from that, the biggest difficulty for me was to become familiar with OpenGL 4. Many of the tasks I performed took me a lot more time than expected due to my lack of familiarity with the library. In the end, though, I have to say that it was a fulfilling experience and I cannot wait to learn more about Computer Graphics.