3D Graphics Programming.

Another part of my Computer Games Programming course revolves around the world of 3D Graphics.

In this particular assignment, I not only had to texture Sponza correctly, but I had to implement the correct lighting. At first I thought this would have been extremely hard. But as a mathematician at heart, I found the calculation as a challenge I easily overcame once I knew which variables I should incorporate.

So the math was easy for me, the code however is a different story. It was a couple of days before the deadline and I had refactored my code (or most of it), and there was still one task to do. Create a toggle feature that shows the surface normals in Sponza. I couldn’t find a way to do it, until the final day. So close to completing the brief and I didn’t have enough time to finish it. I took initiative at this point and decided I will have a toggle feature, but I will toggle between the textures for Sponza instead.

Toggling

 

 

 

 

 

 

 

This is how my toggle function works, the bool that the function toggles controls what texture should be displayed. The use of an if-else statement is useful here as it will only ever read the code that is encased in the statement that is true and ignore the code that is encased in the statement that is false.

Here are some picture of how it all turned out in the end.

Texture One Texture One sample3

sample5 sample6sample4

I would show you a video, but I don’t have a “Premium Plan” unfortunately. So if you really do want to see a video of it, here is a link to a YouTube video of it in action.

Thank you,

James 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s