@Override
  public void refreshUniforms(Camera camera, boolean isGammaInput) {
    super.refreshUniforms(camera, isGammaInput);
    final Map<String, Uniform> uniforms = getShader().getUniforms();

    uniforms.get("psColor").setValue(getColor());
    uniforms.get("opacity").setValue(getOpacity());
    uniforms.get("size").setValue(getSize());

    EVENT_BUS.addHandler(
        ViewportResizeEvent.TYPE,
        new ViewportResizeHandler() {

          @Override
          public void onResize(ViewportResizeEvent event) {
            uniforms.get("scale").setValue(event.getRenderer().getAbsoluteHeight() / 2.0);
          }
        });

    // Default
    uniforms.get("scale").setValue(500 / 2.0);

    uniforms.get("map").setValue(getMap());
  }
示例#2
0
  public Material clone(Material material) {

    material.name = this.name;

    material.side = this.side;

    material.opacity = this.opacity;
    material.isTransparent = this.isTransparent;

    material.blending = this.blending;

    material.blendSrc = this.blendSrc;
    material.blendDst = this.blendDst;
    material.blendEquation = this.blendEquation;

    material.isDepthTest = this.isDepthTest;
    material.isDepthWrite = this.isDepthWrite;

    material.isPolygonOffset = this.isPolygonOffset;
    material.polygonOffsetFactor = this.polygonOffsetFactor;
    material.polygonOffsetUnits = this.polygonOffsetUnits;

    material.alphaTest = this.alphaTest;

    material.overdraw = this.overdraw;

    material.isVisible = this.isVisible;

    return material;
  }