Assignment 2 – Lighting Detail Instruction

20 阅读2分钟

Download link:# Assignment 2 – Lighting Detail Instruction

Description

5/5 – (2 votes)

Goal

  • Implement 3 types of light sources:
    • Directional light
    • Position light (Point light)
    • Spot light
  • Interact and modify the light source in runtime.
  • Finish the code in main.cpp, vertex shader and fragment shader

Assignment 2

  • Announce date: 2020/05/04
  • Deadline: 2020/05/25 23:59(UTC+8)
  • Late work will be penalized by 20/week.
  • Copy & paste others’code will get 0.
  • Hand in your homework to ILMS in the following format( -10 for penalty )
    • studentID_HW2.zip
    • studentID_HW2_Report.pdf

In studentID_HW2.zip

  • Depend on your device
  • -10 for those upload “Normal Models”

For Mac

In studentID_HW2.zip

  • Depend on your device
  • -10 for those upload “x64” or “Normal Models”

Don’t upload!!!

For Windows Make Sure exe can run

Lighting Attribute Reference

    • Directional light:

Position: (1, 1, 1)

      • Direction: always pointing at (0,0, 0)
  • Position(point) light
      • Position: (0, 2, 1)
  • Spot light
        • Position: (0, 0, 2)
        • Direction: (0, 0, -1)
        • Exponent: 50
        • Cutoff: 30 degree

Lighting Attribute Reference

  • Diffuse intensity: (1, 1, 1)
  • Ambient intensity: (0.15, 0.15, 0.15)
  • Specular intensity: (1, 1, 1)
  • Shininess: 64
  • Attenuation:
    • Point light:
      • Constant: 0.01
      • Linear: 0.8
      • Quadratic: 0.1
    • Spot light:
      • Constant: 0.05
      • Linear: 0.3
      • Quadratic: 0.6

Key Mapping

  • Please follow the spec bellow, or you would not get the score of item.
  • You must make sure your key mapping is exactly ****same to ours.
  • Z/X: switch the model
  • T: switch to translation mode
  • S: switch to scale mode
  • R: switch to rotation mode

Key Mapping

  • L: switch between directional/point/spot light
  • K: switch to light editing mode
  • J: switch to shininess editing mode

Key Mapping

  • If you switch mode by T, S, R
  • Apply change on Z axis when scroll the wheel
  • Apply change on X axis when mouse drag ****horizontally
  • Apply change on Y axis when mouse drag ****vertically
  • Only rotation should apply X axis when mouse drag vertically, and Y axis when mouse drag horizontally

Key Mapping

  • If you switch mode by K
  • Apply change on X axis of light’s position when mouse drag horizontally
  • Apply change on Y axis of light’s position when mouse drag vertically
  • Apply change on diffuse intensity for ****directional or point light, cutoff angle for spot light when scroll the wheel

Key Mapping

  • If you switch mode by J
  • Apply change on shininess when scroll the wheel
  • The shininess is applied to all models.

Report

  • Some screen shot
  • Description of your program control instructions
  • Other special things you have done

Grading Policy

ItemScore
Directional light20%
Point light20%
Spot light20%
Per-pixel lighting / Per-vertex lighting15%
Side-by-side viewport5%
Switch lights & models5%
Dynamic light position, cutoff, shininess10%
Report5%
Total100%

14

Related products