Monday, September 15, 2014

Engineering II - Post 2 - Draw Colorful Triangle - Add LUA Script - Add Altered Build Assets

Assignment 2 - Draw Colorful Triangle - Add LUA Script - Add Altered Build Assets

ZIP Link

Assignment2.zip

Write-Up

This assignment was labeled as "draw colorful triangle on a black background." And a little bit more. We were to also utilize a LUA script with our content for building assets, rather than just using function calls in that code.

We only had to alter the triangle vertices and have color values interpolate between the positions. The triangle is made of three vertices and if a given color value is used at a vertex, it will interpolate between the colors between the vertices.

After this we were required to use a given LUA script to run all of the asset building process.

Technical Write-Up

So, I was able to edit the triangle and get it to draw correctly.


After the triangle was confirmed working I used the PIX program to look into function calls while rendering. PIX captures the function calls during one frame of rendering.


In the Events tab, the highlighted function call is called "DrawPrimitive" and takes in the parameter of a "TriangleList". The list contains the number of vertices that are stored for each triangle. If two triangles were drawn, then you would be storing six vertices in the TriangleList. The method is specifically being used to draw a triangle as the primitive object.

In the PrevS tab of the Details window, it shows the vertices, the positions, and the color values stored for each. This allows you to confirm that your code is being drawn and distributed correctly.

The Mesh tab also showed the viewport for the image.

After his rendering occurred, we needed to review the existing code in the new AssetBuilder project and confirm missing sections that needed to use the given LUA script (BuildAssets.lua). These calls had to be correct for both exiting functions properly, and making sure that it found the correct source path from the given LUA state.

Realized Learning Moments

I found an incorrect hard-coded path for my Engine code in additional dependencies. I changed it to "..\Tools\Engine\" and it was then confirmed working on any computer looking for this path.

The PIX image was interesting to run, and I didn't realize that this was automatically included with DirectX.

I had initially used the incorrect LUA files as sources for code, and had to redistribute the correct files. It was completely me being blind to which file I was attempting to use.

I felt that the "DoesFileExist" function contained the entire calls needed in the missing code sections to call the correct LUA functions from BuildAssets.lua file.

I feel that I could have learned more with a discussion on how these are called in the lecture, but we focused a lot on the triangle, vertices, etc., even more.

Time Used

Reading: 7 hours
Write-Up: 1 hour
Technical Write-Up: 1 hour
Coding: 3  hours



No comments:

Post a Comment