Tier 4
Series 306
306G: The Graphics Exam
Capstone Exam
"The simulation visuals are failing. The ocean is freezing the CPU, the shaders are using heavy branching logic, and the asteroid field is killing the frame rate. Identify the three critical rendering failures."
Target Asset for Audit
FRAGILE_CODE_DETECTED
using UnityEngine;
public class OceanRenderer : MonoBehaviour {
public MeshFilter oceanMesh;
void Update() {
// Audit Requirement: Lesson 306C (Vertex Shader)
// Error 1: CPU Vertex Animation
Vector3[] verts = oceanMesh.mesh.vertices;
for(int i=0; i<verts.Length; i++) {
verts[i].y = Mathf.Sin(Time.time + verts[i].x);
}
oceanMesh.mesh.vertices = verts;
// Audit Requirement: Lesson 306D (Instancing)
// Error 2: Material cloning
GetComponent<Renderer>().material.color = Color.blue;
}
// Shader Code Snippet included in exam context:
// float4 frag(v2f i) : SV_Target {
// // Audit Requirement: Lesson 306B (HLSL)
// // Error 3: Branching
// if (i.uv.x > 0.5) return float4(1,0,0,1);
// else return float4(0,0,1,1);
// }
}