本文整理汇总了C++中ofShader::load方法的典型用法代码示例。如果您正苦于以下问题:C++ ofShader::load方法的具体用法?C++ ofShader::load怎么用?C++ ofShader::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofShader
的用法示例。
在下文中一共展示了ofShader::load方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
//--------------------------------------------------------------
void testApp::setup(){
light.setDirectional();
ofEnableArbTex();
fbo.allocate(ofGetWidth()*2, ofGetHeight()*2);
fxaa.load("v002.FXAA.vert","v002.FXAA.frag");
ofSetFrameRate(30);
}
示例2: setup
void setup() {
#ifndef INSTALL
useSharedData();
#endif
loadSettings();
tracker.setup();
tracker.setHaarMinSize(175);
tracker.setRescale(.25);
tracker.setIterations(3);
tracker.setTolerance(2);
tracker.setClamp(3);
tracker.setAttempts(4);
#ifdef INSTALL
cam.setup(camWidth, camHeight, 30);
#else
cam.initGrabber(camWidth, camHeight, false);
#endif
if(rotate) {
data.setup(camHeight, camWidth, binSize);
} else {
data.setup(camWidth, camHeight, binSize);
}
loadMetadata(data);
presence.setDelay(0, 4);
presenceFade.setLength(4, .1);
presenceFade.start();
shader.load("shaders/colorbalance.vs", "shaders/colorbalance.fs");
ofDisableAntiAliasing();
glPointSize(2);
ofSetLineWidth(3);
ofSetLogLevel(OF_LOG_VERBOSE);
}
示例3: setup
void setup(){
ofSetVerticalSync(false);
w=ofGetScreenWidth();
h=ofGetScreenHeight();
ofDisableArbTex();
img.load("1.jpg");
player.load("1.mp4");
player.play();
player.setLoopState(OF_LOOP_NORMAL);
gray = img;
gray.setImageType(OF_IMAGE_GRAYSCALE);
wc.load("wcolor.vert","wcolor.frag");
ofFbo::Settings s;
s.depthStencilAsTexture=true;
s.useDepth=true;
s.width=w;
s.height=h;
fboDepth.allocate(s);
fbo.allocate(w,h);
fbo.begin();
ofClear(0,0,100,255);
fbo.end();
gui.setup();
gui.add(stepGradient.set("step gradient", .0015, -1., 1.));
gui.add(advectStep.set("step advect", .0015, -.1, .1));
gui.add(flipHeightMap.set("flip height map", 0.7, 0., 2.));
gui.add(time.set("time", 0., 0., 1.));
gui.add(advectMatrix.set("advect matrix", ofVec4f(0.1), ofVec4f(-1.), ofVec4f(1.)));
gui.add(switchVideo.set("switch video", false));
}
示例4: setup
void setup() {
ofEnableDepthTest();
ofDisableArbTex();
img.loadImage("img1.jpg");
env.loadImage("env.jpg");
env1.loadImage("env1.jpg");
shader.load("material.vert","material.frag");
model.loadModel("wolf.dae", true);
}
示例5: setup
void setup() {
ofSetFrameRate(60);
ofSetVerticalSync(true);
dw=ofGetScreenWidth();
dh=ofGetScreenHeight();
ofDisableArbTex();
fbo.allocate(dw,dh);
shader.load("shaders/fluid.vert","shaders/fluid.frag");
camera.setFarClip(100000);
camera.setNearClip(.1);
if ( !allocate_data () ){
cout<<"error allocate!"<<endl;
exit();
}
clear_data ();
gui.setup();
gui.setPosition(ofPoint(10,10));
gui.add(size_cube.setup("size box", 100.0f,0.0f,255.0f));
gui.add(dvel.setup("draw velocity", true));
gui.add(dden.setup("draw density", false));
gui.add(TaddSource.setup("add source",false));
gui.add(Bclear.setup("clear source",false));
gui.add(addX.setup("add x",false));
gui.add(addY.setup("add y",false));
gui.add(addZ.setup("add z",false));
gui.add(dt.setup("time delta", 0.9f,0.0f,25.0f));
gui.add(diff.setup("diffuse", 0.0f,0.0f,25.0f));
gui.add(visc.setup("viscosity", 0.0f,0.0f,25.0f));
gui.add(force.setup("add force",30.0f,0.0f,60.0f));
gui.add(source.setup("density", 200.0f,0.0f,600.0f));
gui.add(source_alpha.setup("alpha",0.05,0.0,1.0));
gui.add(drawAbstacle.setup("draw abstacle",false));
gui.add(drawAxis.setup("draw Axis",true));
gui.add(sourcePosX.setup("source posX", 0,-10,SIZE));
gui.add(sourcePosY.setup("source posY", 0,-10,SIZE));
gui.add(sourcePosZ.setup("source posZ", 0,-10,SIZE));
}
示例6: setupFromXml
void setupFromXml(string filename) {
size = ofVec2f(ofGetWidth(), ofGetHeight());
if (xml.load(filename)) {
xml.setTo("STAR[0]");
do {
xml.setTo("POSITION");
int x = xml.getValue<float>("X");
int y = xml.getValue<float>("Y");
xml.setToParent();
int m = xml.getValue<int>("MAGNITUDE");
int id = xml.getValue<int>("ID");
BPStar s;
s.setPosition(x, y);
s.setMagnitude(m);
s.setId(id);
stars.push_back(s);
}while( xml.setToSibling() ); // go to next STAR
} else {
}
shader.load("","SkyShader.frag");
skyShader.setup();
}
示例7: keyPressed
void keyPressed(int key) {
if(key == '1') { model.loadModel("wolf.dae"); cube=false; }
if(key == '2') { model.loadModel("elephant.dae"); cube=false; }
if(key == '3') { model.loadModel("alduin.obj"); cube=false; }
if(key == '4') cube=!cube;
if(key == ' ') ofToggleFullscreen();
if(key == 'q') { shader.load("material.vert","material.frag"); reflect=false; sreflect=false; }
if(key == 'w') { shader.load("material.vert","material1.frag"); reflect=false; sreflect=false; }
if(key == 'e') { shader.load("material.vert","material2.frag"); reflect=false; sreflect=false; }
if(key == 'r') { shader.load("material.vert","material3.frag"); reflect=false; sreflect=false; }
if(key == 't') { shader.load("material.vert","material4.frag"); reflect=false; sreflect=false; }
if(key == 'y') { shader.load("material.vert","material5.frag"); reflect=false; sreflect=false; }
if(key == 'u') { shader.load("material.vert","material6.frag"); reflect=false; sreflect=false; }
if(key == 'i') { shader.load("material.vert","material7.frag"); reflect=false; sreflect=false; }
if(key == 'o') { shader.load("material.vert","material8.frag"); reflect=false; sreflect=false; }
if(key == 'p') { shader.load("material.vert","material9.frag"); reflect=false; sreflect=false; }
if(key == 'a') { shader.load("material.vert","material10.frag"); reflect=false; sreflect=false; }
if(key == 's') { shader.load("material.vert","material11.frag"); reflect=false; sreflect=false; }
if(key == 'd') { shader.load("material.vert","material12.frag"); reflect=false; sreflect=false; }
if(key == 'f') { shader.load("material.vert","material13.frag"); reflect=false; sreflect=false; }
if(key == 'g') { shader.load("material.vert","material14.frag"); reflect=false; sreflect=false; }
if(key == 'h') { shader.load("material.vert","material15.frag"); reflect=false; sreflect=false; }
if(key == 'j') { shader.load("material.vert","material16.frag"); reflect=false; sreflect=false; }
if(key == 'k') { shader.load("material.vert","material17.frag"); reflect=false; sreflect=false; }
if(key == 'l') { shader.load("material.vert","material18.frag"); reflect=false; sreflect=false; }
if(key == 'z') { shader.load("material.vert","material19.frag"); reflect=false; sreflect=false; }
if(key == 'x') { shader.load("material.vert","material20.frag"); reflect=false; sreflect=false; }
if(key == 'c') { shader.load("material_reflect.vert","material_reflect.frag"); reflect=true; sreflect=false; }
if(key == 'v') { shader.load("material_reflect_1.vert","material_reflect_1.frag"); reflect=true; sreflect=false; }
if(key == 'b') { shader.load("material_reflect_2.vert","material_reflect_2.frag"); sreflect=true; reflect=false; }
}