com.jme3.system.AppSettings.getSamples()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(233)

本文整理了Java中com.jme3.system.AppSettings.getSamples()方法的一些代码示例,展示了AppSettings.getSamples()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppSettings.getSamples()方法的具体详情如下:
包路径:com.jme3.system.AppSettings
类名称:AppSettings
方法名:getSamples

AppSettings.getSamples介绍

[英]Get the number of samples
[中]获取样本数量

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private void updateAntialiasChoices() {
  // maybe in the future will add support for determining this info
  // through pbuffer
  String[] choices = new String[]{resourceBundle.getString("antialias.disabled"), "2x", "4x", "6x", "8x", "16x"};
  antialiasCombo.setModel(new DefaultComboBoxModel(choices));
  antialiasCombo.setSelectedItem(choices[Math.min(source.getSamples()/2,5)]);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int getNumSamplesToUse() {
  int samples = 0;
  if (settings.getSamples() > 1) {
    samples = settings.getSamples();
    int supportedSamples = determineMaxSamples(samples);
    if (supportedSamples < samples) {
      logger.log(Level.WARNING,
          "Couldn''t satisfy antialiasing samples requirement: x{0}. "
          + "Video hardware only supports: x{1}",
          new Object[]{samples, supportedSamples});
      samples = supportedSamples;
    }
  }
  return samples;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int getNumSamplesToUse() {
  int samples = 0;
  if (settings.getSamples() > 1){
    samples = settings.getSamples();
    int supportedSamples = determineMaxSamples(samples);
    if (supportedSamples < samples) {
      logger.log(Level.WARNING,
          "Couldn''t satisfy antialiasing samples requirement: x{0}. "
          + "Video hardware only supports: x{1}",
          new Object[]{samples, supportedSamples});
      samples = supportedSamples;
    }
  }
  return samples;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int getNumSamplesToUse() {
  int samples = 0;
  if (settings.getSamples() > 1) {
    samples = settings.getSamples();
    final int supportedSamples = determineMaxSamples();
    if (supportedSamples < samples) {
      logger.log(Level.WARNING,
          "Couldn't satisfy antialiasing samples requirement: x{0}. "
              + "Video hardware only supports: x{1}",
          new Object[]{samples, supportedSamples});
      samples = supportedSamples;
    }
  }
  return samples;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int getNumSamplesToUse() {
  int samples = 0;
  if (settings.getSamples() > 1) {
    samples = settings.getSamples();
    final int supportedSamples = determineMaxSamples();
    if (supportedSamples < samples) {
      logger.log(Level.WARNING, "Couldn't satisfy antialiasing samples requirement: x{0}. " +
          "Video hardware only supports: x{1}", APIUtil.toArray(samples, supportedSamples));
      samples = supportedSamples;
    }
  }
  return samples;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private Config getRequestedConfig() {
  int r, g, b;
  if (settings.getBitsPerPixel() == 24) {
    r = g = b = 8;
  } else {
    if (settings.getBitsPerPixel() != 16) {
      logger.log(Level.SEVERE, "Invalid bitsPerPixel setting: {0}, setting to RGB565 (16)", settings.getBitsPerPixel());
      settings.setBitsPerPixel(16);
    }
    r = 5;
    g = 6;
    b = 5;
  }
  logger.log(Level.FINE, "Requested Display Config:");
  logger.log(Level.FINE, "RGB: {0}, alpha: {1}, depth: {2}, samples: {3}, stencil: {4}",
      new Object[]{settings.getBitsPerPixel(),
        settings.getAlphaBits(), settings.getDepthBits(),
        settings.getSamples(), settings.getStencilBits()});
  return new Config(
      r, g, b,
      settings.getAlphaBits(),
      settings.getDepthBits(),
      settings.getSamples(),
      settings.getStencilBits());
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void setupFilters(){
  if (renderer.getCaps().contains(Caps.GLSL100)){
    fpp=new FilterPostProcessor(assetManager);
    //fpp.setNumSamples(4);
    int numSamples = getContext().getSettings().getSamples();
    if( numSamples > 0 ) {
      fpp.setNumSamples(numSamples); 
    }
    CartoonEdgeFilter toon=new CartoonEdgeFilter();
    toon.setEdgeColor(ColorRGBA.Yellow);
    fpp.addFilter(toon);
    viewPort.addProcessor(fpp);
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

caps.setDepthBits(settings.getDepthBits());
if (settings.getSamples() > 1) {
  caps.setSampleBuffers(true);
  caps.setNumSamples(settings.getSamples());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected void initGLCanvas() {
  GLCapabilities caps;
  if (settings.getRenderer().equals(AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE)) {
    caps = new GLCapabilities(GLProfile.getMaxProgrammable(true));
  } else {
    caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
  }
  caps.setHardwareAccelerated(true);
  caps.setDoubleBuffered(true);
  caps.setStencilBits(settings.getStencilBits());
  caps.setDepthBits(settings.getDepthBits());
  if (settings.getSamples() > 1) {
    caps.setSampleBuffers(true);
    caps.setNumSamples(settings.getSamples());
  }
  canvas = GLWindow.create(caps);
  canvas.invoke(false, new GLRunnable() {
    public boolean run(GLAutoDrawable glad) {
      canvas.getGL().setSwapInterval(settings.isVSync() ? 1 : 0);
      return true;
    }
  });
  canvas.requestFocus();
  canvas.setSize(settings.getWidth(), settings.getHeight());
  canvas.addGLEventListener(this);
  
  //FIXME not sure it is the best place to do that
  renderable.set(true);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void simpleInitApp() {
  this.flyCam.setMoveSpeed(50);
  Node mainScene=new Node();
  cam.setLocation(new Vector3f(-34.74095f, 95.21318f, -287.4945f));
  cam.setRotation(new Quaternion(0.023536969f, 0.9361278f, -0.016098259f, -0.35050195f));
  // load sky
  mainScene.attachChild(SkyFactory.createSky(assetManager, 
      "Textures/Sky/Bright/BrightSky.dds", 
      SkyFactory.EnvMapType.CubeMap));
  createTerrain(mainScene);
  DirectionalLight sun = new DirectionalLight();
  Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
  sun.setDirection(lightDir);
  sun.setColor(ColorRGBA.White.clone().multLocal(2));
  mainScene.addLight(sun);
  rootNode.attachChild(mainScene);
  fpp=new FilterPostProcessor(assetManager);
  //fpp.setNumSamples(4);
  int numSamples = getContext().getSettings().getSamples();
  if( numSamples > 0 ) {
    fpp.setNumSamples(numSamples); 
  }
  fog=new FogFilter();
  fog.setFogColor(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f));
  fog.setFogDistance(155);
  fog.setFogDensity(1.0f);
  fpp.addFilter(fog);
  viewPort.addProcessor(fpp);
  initInputs();
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits());
glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits());
glfwWindowHint(GLFW_SAMPLES, settings.getSamples());
glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if (numSamples > 0) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = context.getSettings().getSamples();
if (numSamples > 0) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

tbf = new TranslucentBucketFilter(true);
fpp.addFilter(tbf);
int samples = context.getSettings().getSamples();
if (samples > 0) {
  fpp.setNumSamples(samples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits());
glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits());
glfwWindowHint(GLFW_SAMPLES, settings.getSamples());
glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if (numSamples > 0) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if( numSamples > 0 ) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if( numSamples > 0 ) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if( numSamples > 0 ) {
  fpp.setNumSamples(numSamples);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int numSamples = getContext().getSettings().getSamples();
if (numSamples > 0)

相关文章

AppSettings类方法