示例#1
0
 public void draw(CCGraphics g) {
   _myModelShader.start();
   g.texture(_myWallBTex);
   _myModel.group("wallb_behind").draw(g);
   g.noTexture();
   g.texture(_myWallATex);
   _myModel.group("walla_behind").draw(g);
   g.noTexture();
   _myModelShader.end();
 }
示例#2
0
  public SModelDrawer(CCModel theModel) {
    _myModel = theModel;

    _myModelShader =
        new CCCGShader(
            CCIOUtil.classPath(this, "model_display.vp"),
            CCIOUtil.classPath(this, "model_display.fp"));
    _myModelShader.load();

    _myWallATex = new CCTexture2D(CCTextureIO.newTextureData("130223_wallmaskA2_highres.jpg"));
    _myWallBTex = new CCTexture2D(CCTextureIO.newTextureData("130223_wallmaskB2_highres.jpg"));
  }
  public static void attachVertexNoise(final CCCGShader theShader) {
    CGparameter myPermTextureParam = theShader.vertexParameter("permTexture");
    CGparameter mySimplexTextureParam = theShader.vertexParameter("simplexTexture");
    CGparameter myGradTextureParam = theShader.vertexParameter("gradTexture");

    if (noise == null) noise = new CCGPUNoise();

    theShader.texture(myPermTextureParam, noise.permTextureID[0]);
    theShader.texture(mySimplexTextureParam, noise.simplexTextureID[0]);
    theShader.texture(myGradTextureParam, noise.gradTextureID[0]);
  }