Advertisement
Guest User

ofApp.cpp

a guest
Nov 4th, 2016
179
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None
  1. #include "ofApp.h"
  2. #include "glm.hpp"
  3.  
  4. //--------------------------------------------------------------
  5. void ofApp::setup(){
  6. ofDisableArbTex();
  7. video.load("clouds.mp4");
  8.  
  9. shader_shading.load("basicshading");
  10. shader_displacement.load("displacement");
  11.  
  12. plane_displacement.set(video.getWidth(),video.getHeight(),video.getWidth(),video.getHeight());
  13.  
  14. video.play();
  15. video.setVolume(0);
  16.  
  17. light.setDiffuseColor(ofColor(122.f,100.f,0.f));
  18. light.setPosition(ofGetWidth()/2,ofGetHeight()/2,100);
  19. }
  20.  
  21. //--------------------------------------------------------------
  22. void ofApp::update(){
  23. video.update();
  24. }
  25.  
  26. //--------------------------------------------------------------
  27. void ofApp::draw(){
  28. cam.begin();
  29.  
  30. shader_shading.begin();
  31. shader_displacement.begin();
  32. shader_displacement.setUniformTexture("displacementMap", video.getTexture(), 1);
  33. plane_displacement.draw();
  34. shader_displacement.end();
  35. shader_shading.end();
  36.  
  37. cam.end();
  38. }
Advertisement
RAW Paste Data Copied
Advertisement