Computer Graphics & Game Development test (Intermediate)
30 questions · 35 minutes · Free
The rendering pipeline, OpenGL/Vulkan/WebGL, shaders, 3D maths and game engines.
Take the Computer Graphics & Game Development test
What it covers
- The rendering pipeline
- OpenGL, Vulkan and WebGL
- Shaders
- 3D maths and transforms
- Unity and Unreal Engine
Interview format
- Questions: 30 questions — 18 multiple choice, 9 multi-answer, 3 predict-the-output
- Time: 35 minutes, timed from the first question
- Difficulty: Intermediate
- Skill area: Frontend
- Price: Free
Sample questions
5 sample questions from the Computer Graphics & Game Development test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.
Which of the following statements correctly describes how normals are transformed when there is non-uniform scaling?
- The transpose of the model matrix is used to transform normals under non-uniform scaling.
- The inverse transpose of the model matrix is used to transform normals when there is non-uniform scaling.
- The model matrix is used directly to transform normals under non-uniform scaling.
- Non-uniform scaling does not affect the transformation of normals.
Answer: B. The inverse transpose of the model matrix is used to transform normals when there is non-uniform scaling.
When a model undergoes non-uniform scaling, the transformation matrix used to transform normals is the inverse transpose of the model matrix. This ensures that the normals remain perpendicular to the surface after scaling. Using the model matrix directly or other methods would not account for the non-uniform scaling and could lead to incorrect lighting and shading.
Which of the following best describes the purpose and functionality of uniform buffer objects (UBOs) in graphics programming?
- Uniform buffer objects are used to pass data from the fragment shader to the CPU for post-processing tasks.
- Uniform buffer objects (UBOs) are used to efficiently send data to multiple shaders in a single buffer, reducing the number of API calls and improving performance.
- Uniform buffer objects are used to store per-vertex data, such as position and colour, and are accessed by the vertex shader.
- Uniform buffer objects are a type of texture used to store dynamic data, such as lighting information, for use in shaders.
Answer: B. Uniform buffer objects (UBOs) are used to efficiently send data to multiple shaders in a single buffer, reducing the number of API calls and improving performance.
Uniform buffer objects (UBOs) allow multiple shaders to access the same data efficiently. They are stored in a single buffer and can be shared across multiple shader programs, which reduces overhead. This is in contrast to individual uniform variables, which require separate API calls for each variable. UBOs are especially useful in scenarios where large amounts of data need to be passed to shaders, such as light data, material properties, or transformation matrices.
Which of the following statements correctly describes the role of the fragment shader in the rendering pipeline?
- The fragment shader outputs the final colour for each fragment.
- The fragment shader runs once per pixel regardless of overdraw or MSAA.
- The fragment shader is executed before the vertex shader in the rendering pipeline.
- The vertex shader is responsible for calculating the final colour of each fragment.
Answer: A. The fragment shader outputs the final colour for each fragment.
The fragment shader is responsible for calculating the final colour of each fragment, which corresponds to a pixel on the screen. The vertex shader outputs clip-space positions, and the fragment shader is executed per fragment, not per pixel directly. The other options describe incorrect roles or misunderstandings about the rendering pipeline.
Which of the following statements accurately describes how an OpenGL context is created in an application?
- The operating system handles the creation of an OpenGL context, and the application only needs to call a single OpenGL function to initialise it.
- OpenGL automatically creates a context when the application starts, so no explicit setup is needed.
- The application must explicitly create an OpenGL context using a platform-specific API (like GLFW or EGL) before any rendering can occur.
- The GPU creates an OpenGL context automatically when the application requests rendering.
Answer: C. The application must explicitly create an OpenGL context using a platform-specific API (like GLFW or EGL) before any rendering can occur.
In OpenGL, a context is required to interface with the GPU and manage state. It is not automatically created by the system and must be explicitly initialised by the application using a library such as GLFW, EGL, or similar. This ensures compatibility across different platforms and allows the application to control context attributes such as version, profile, and rendering capabilities.
What is the primary purpose of shader subpass dependencies in a render pass?
- Shader subpass dependencies define the order and conditions for executing subpasses within a render pass, ensuring correct data flow and synchronization between them.
- Shader subpass dependencies are used to compile shaders into SPIR-V format in Vulkan.
- Shader subpass dependencies are used to manage the memory allocation of shader resources in Vulkan.
- Shader subpass dependencies are used to optimize the performance of shaders by reducing the number of draw calls.
Answer: A. Shader subpass dependencies define the order and conditions for executing subpasses within a render pass, ensuring correct data flow and synchronization between them.
Shader subpass dependencies are crucial for ensuring that subpasses within a render pass execute in the correct order and that data is properly synchronized between them. This ensures that outputs from one subpass are available as inputs to another subpass when needed. Other options do not accurately describe the role or functionality of subpass dependencies.
Frequently asked questions
- How many questions are in the Computer Graphics & Game Development test?
- 30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
- What does the Computer Graphics & Game Development test cover?
- The rendering pipeline, OpenGL, Vulkan and WebGL, Shaders, 3D maths and transforms, Unity and Unreal Engine.
- Is the Computer Graphics & Game Development test free?
- Yes. It is free to take with a readyforhires account.
- What level is the Computer Graphics & Game Development test?
- Intermediate, in Frontend.