Skip navigation

Monthly Archives: October 2014

File Link(.exe)


Click Me

Objective


This assignment wants me to replace the arguments in the old command line  with a lua file which contains a assets list that show how the assets should be build. Also in this assignment, instead of compiling shader files in the run-time, I need to compile them with Shaderbuilder in the building process and load the binary data of shaders while the game is running.

Assets build list 


In the previous assignments, I put the names of the assets files on the command line to build them, which is fine for a simple example or assignment, however, it will be bad when the project scope becomes large. A better solution is to create a file of assets list and just pass the file name to the command line.

This is what my assets list file looks like:

assetstobild

 

In the root level, I have “generic” and “shader” to indicate different categories of assets, and particular builders will be apply to each of the assets categories. In one category,” builder = “…” ” means which builder will be used to build the assets.The GenericBuilder will just copy the last files from source to target. The ShaderBuilder is responsible for compiling the HLSL text file to the binary file depends on the type of the shader. ” assets = {…} ” is the list of assets that will be built. Each asset has a source file path and a target file path. Also, they all have a arguments list to pass optional arguments to the builder.

Time estimation


Reading and searching — 1.5 h
Coding / Debugging — 3 h
Writing blog — 1 h
Total — 5.5 h

File Link(.exe)


Click Me

Objective


This assignment wants me to create objects in 3D world and display them with a 3D camera.

Cube in 3D


I made a colored cube and a gray plan in the 3D world, you can control the camera with ASDW keys and move the cube with Arrow keys.

That is what it looks like:

cube in 3d cube in 3d 2

Debug a shader


I met a problem when I was debugging the Shader, PIX was keep failing to enable shader debugging. And Finally I found the reason here , the solution is pretty easy.

1. open Regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Direct3D

2.Right click the “Direct3D” key—> permissions —> Advanced —> switch to “Owner” tag –> Select Administrators and  click apply.

3.Switch to “Permissions tag” —> select Administrator —> edit —> check full control for it.

4.open PIX again, problem solved 😀

That’s my debug screen:

shader debugger

 

Time estimation


Reading and searching — 1 h
Coding / Debugging — 3 h
Writing blog — 1 h
Total — 5 h