1 / 22

CSC 4356 FINAL PROJECT

CSC 4356 FINAL PROJECT. KEVIN CHERRY. Objective. Class Techniques Shadow Normal Map Point Sprite Water / Mirror Spot / Point Light Common Techniques Skycube HUD Joystick Camera Bob When Walking Sound Collision Detection Custom Techniques Water Fade Off. DEMO. Shadow.

tomas
Télécharger la présentation

CSC 4356 FINAL PROJECT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 4356 FINAL PROJECT KEVIN CHERRY

  2. Objective • Class Techniques • Shadow • Normal Map • Point Sprite • Water / Mirror • Spot / Point Light • Common Techniques • Skycube • HUD • Joystick • Camera Bob When Walking • Sound • Collision Detection • Custom Techniques • Water Fade Off

  3. DEMO

  4. Shadow • Uses code from notes • Able to render for multiple objects • Stores reversed view matrix in texture so I can get just model matrix in shader

  5. Normal Map • Uses function that copies image file to GL texture index • Diffuse and normal textures are handled in shader • Easy to implement and looks great!

  6. Point Sprite • Got starting code online • Structs • Sprite: GL texture unit, position, color, scale, texture coordinates • ASprite: Same but GL texture unit is array and texture count, texture index, swap delay, and swap counter added

  7. Point Sprite • Render • Creates x,y positions for four vertices • Binds sprite’s texture • Uses triangle strip and texture coordinates • Rendered last so texture’s alpha is blended with scene

  8. Point Sprite • ASprite for animation • 3 images swapped every 80 milliseconds

  9. Water • Same as in project 3 • Not as good looking though? • Perhaps needs more for it to refract?

  10. Mirror • Uses water reflection code • Tricky at first • Must flip over the clipping plane axis • This and reflection in water is the only time you can see player

  11. Spot / Point Light • Couldn’t get spotlight working • Instead objects lit by multiplying white vector based on camera distance in fragment shader • Light flickers with time to simulate fire from match • Light gradually takes effect as match comes up/down

  12. Skycube • Easy to add to scene, hard to get texture mapped right • Most sky cube textures online have small problems • Mapped in Wings and carefully touched up • Moves with player so player never escapes

  13. HUD • Had a lot of problems at first, but then realized a simple solution: • Pop any model tranformations • Reverse view transformations in opposite order • Perform HUD translations • Render

  14. Joystick • Uses glutJoystickFunc with poll interval of 15 • Uses unsigned int as bit mask for buttons • Works for any joystick (buttons will be different)

  15. Joystick • Problem: Glut only recognizes 3 axis • Solution: Glfw • In joystick mapped function, glfw used for 4 axis values • Axis values alter same code as mouse movement • Axis values [-1, 1] • Deadzone set to 0.2

  16. Joystick • Can switch from joystick to keyboard and mouse while game is running • Each switch resets movement values • Switches automatically to keyboard and mouse if joystick is disconnected

  17. Camera Bobbing • Common technique used in majority of games • Running increases bobbing rate • Increases a value as you walk • Uses sin of value converted to radians for y displacement

  18. Sound • Uses FMOD Ex • Used for footsteps • Triggered when y deviation is less than threshold

  19. Collision Detection • Checks camera’s position relative to custom 2D squares • Squares are expressed as center XZ position along with width and depth • If camera is within square • Check distance to all edges • Move to outside of that edge

  20. Water Fade Off • Without this, can see where water is cut by skycube • With it, water fades off and seems to continue off into the distance • Accomplished in shader

  21. What’s Left • More realistic water • More sounds • Background music? • Lens flare? • Recursive mirror rendering • More scenary

  22. Q & A

More Related