Examples of Medium


Examples of ca.eandb.jmist.framework.Medium

    double    EdotN = E.dot(N);
    double    LdotN = L.dot(N);
    double    tanAlpha = Math.tan(Math.acos(HdotN));
    double    cos4Alpha = HdotN * HdotN * HdotN * HdotN;

    Medium    medium = x.getAmbientMedium();
    Color    n1 = medium.refractiveIndex(x.getPosition(), lambda);
    Color    k1 = medium.extinctionIndex(x.getPosition(), lambda);
    Color    n2 = n.sample(lambda);
    Color    k2 = k.sample(lambda);
    Color    F = MaterialUtil.reflectance(E, n1, k1, n2, k2, N);
    double    D = Math.exp(-(tanAlpha * tanAlpha / mSquared)) / (Math.PI * mSquared * cos4Alpha);
    double    G = Math.min(1.0, Math.min(2.0 * HdotN * EdotN / EdotH, 2.0 * HdotN * LdotN / EdotH));
View Full Code Here

Examples of ca.eandb.jmist.framework.Medium

  @Override
  public ScatteredRay scatter(SurfacePoint x, Vector3 v, boolean adjoint, WavelengthPacket lambda, double ru, double rv, double rj) {

    ColorModel  cm      = lambda.getColorModel();
    Point3    p      = x.getPosition();
    Medium    medium    = x.getAmbientMedium();
    Color    n1      = medium.refractiveIndex(p, lambda);
    Color    k1      = medium.extinctionIndex(p, lambda);
    Color    n2      = n.sample(lambda);
    Color    k2      = k.sample(lambda);
    Vector3    normal    = x.getShadingNormal();
    boolean    fromSide  = x.getNormal().dot(v) < 0.0;
    Color    R      = MaterialUtil.reflectance(v, n1, k1, n2, k2, normal);
View Full Code Here

Examples of ca.eandb.jmist.framework.Medium

      if (x != null) {
        totalDepth++;
        depth.put(type, getPathDepthByType(type) + 1);

        boolean pop = false;
        Medium popped = null;
        if (sr.isTransmitted()) {
          if (isFront()) {
            media.push(getMaterial());
            pop = true;
          } else if (!media.isEmpty()) {
            popped = media.pop();
          }
        }

        Medium ambientMedium;
        Medium medium = media.isEmpty() ? Medium.VACUUM : media.peek();
        if (x.isFront()) {
          ambientMedium = medium;
        } else {
          ambientMedium = media.size() > 1 ? media.elementAt(media.size() - 2) : Medium.VACUUM;
        }

        LocalContext local = new LocalContext();
        local.ray = ray;
        local.distance = x.getDistance();
        local.front = x.isFront();
        local.medium = ambientMedium;
        local.importance = sr.getColor().times(stack.peek().importance);

        stack.push(local);
        x.prepareShadingContext(this);

        Color color = shade();
        color = color.times(medium.transmittance(local.ray,
            local.distance, color.getWavelengthPacket()));

        if (popped != null) {
          media.push(popped);
        }
View Full Code Here

Examples of ca.eandb.jmist.framework.Medium

  @Override
  public ScatteredRay scatter(SurfacePoint x, Vector3 v, boolean adjoint, WavelengthPacket lambda, double ru, double rv, double rj) {

    ColorModel  cm      = lambda.getColorModel();
    Point3    p      = x.getPosition();
    Medium    medium    = x.getAmbientMedium();
    Color    n1      = medium.refractiveIndex(p, lambda);
    Color    k1      = medium.extinctionIndex(p, lambda);
    Color    n2      = refractiveIndex.sample(lambda);
    Vector3    normal    = x.getShadingNormal();
    boolean    fromSide  = x.getNormal().dot(v) < 0.0;
    Color    R      = MaterialUtil.reflectance(v, n1, k1, n2, null, normal);
    Color    T      = cm.getWhite(lambda).minus(R);
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.Medium

  public Medium handleMedium(HiddenTokenAwareTree token) {
    List<HiddenTokenAwareTree> children = token.getChildren();
    if (children.size() == 1) {
      HiddenTokenAwareTree type = children.get(0);
      return new Medium(token, new MediumModifier(type), new MediumType(type, type.getText()));
    }

    HiddenTokenAwareTree type = children.get(1);
    return new Medium(token, toMediumModifier(children.get(0)), new MediumType(type, type.getText()));
  }
View Full Code Here

Examples of jtrackbase.db.Medium

      log.finest("Starting Album");
      InputDialog<Medium> ip = new InputDialog<Medium>(
          TrackbaseFrame.this, new MediumPanel(mediumType));
      ip.setVisible(true);
      log.finest("Nothing to persist yet");
      Medium m = ip.getData();
      log.finest("Persisting: " + m);
      if (m == null) {
        return;
      }
      EntityManager em = DBController.getEntityManager();
View Full Code Here

Examples of jtrackbase.db.Medium

    return columnNames[columnIndex];
  }

  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {
    Medium m=get(rowIndex);
    if (m==null) {
      return null;
    }
    switch (columnIndex) {
    case 0:{
      return m.getId();
    }
    case 1:{
      return m.getName();
    }
    case 2: {
      return m.getLabel()==null?"":m.getLabel().getName();
    }
    case 3: {
      return m.getYearReleased();
    }
    case 4: {
      return m.getTracks()==null?-1:m.getTracks().size();
    }
    }
    return null;
  }
View Full Code Here

Examples of jtrackbase.db.Medium

  private static final String DURATION_INITIAL_CONTENT = "00:00:00";

  private static int TRACK_OFFSET = 3;

  public MediumPanel(MediumType mt) {
    this(new Medium(mt));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.