Package ca.eandb.jmist.framework.path

Examples of ca.eandb.jmist.framework.path.PathNode


      Color sample    = colorModel.sample(seq);
      seq.mark();

      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here


      Color sample    = colorModel.sample(seq);
      seq.mark();

      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      PathNode lightTail  = path.getLightTail();
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      seq.mark();

      seq.mutate(width);
      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      seq.mutate(width);
      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

    private Color join(PathNode lightTail, PathNode eyeTail,
        double lightImageWeight, List<Contribution> contrib) {
      Color score = null;

      PathNode lightNode = lightTail;
      while (true) {

        PathNode eyeNode = eyeTail;
        while (true) {

          Color c = joinAt(lightNode, eyeNode, lightImageWeight,
              contrib);
          score = ColorUtil.add(score, c);

          if (eyeNode == null) {
            break;
          }
          eyeNode = eyeNode.getParent();
        } // eye path loop

        if (lightNode == null) {
          break;
        }
View Full Code Here

            }

            Point2 p      = RandomUtil.uniform(bounds, random);
            Color sample    = colorModel.sample(random);
            PathInfo path    = new PathInfo(scene, sample.getWavelengthPacket());
            PathNode eyeTail  = strategy.traceEyePath(lens, p,
                          path, random);

            for (int j = 0; j < lightPathsPerEyePath; j++) {

              PathNode lightTail  = strategy.traceLightPath(
                            light, path, random);

              Color score      = join(lightTail, eyeTail,
                            lightImageWeight);
              if (score != null) {
View Full Code Here

//    }

    private Color join(PathNode lightTail, PathNode eyeTail, double lightImageWeight) {
      Color score = null;

      PathNode lightNode = lightTail;
      while (true) {

        PathNode eyeNode = eyeTail;
        while (true) {

          Color c = joinAt(lightNode, eyeNode, lightImageWeight);
          score = ColorUtil.add(score, c);

          if (eyeNode == null) {
            break;
          }
          eyeNode = eyeNode.getParent();
        } // eye path loop

        if (lightNode == null) {
          break;
        }
View Full Code Here

  private final Path generatePath(long seed) {
    Random rnd = new RandomAdapter(new java.util.Random(seed));
    Color sample = colorModel.sample(rnd);
    WavelengthPacket lambda = sample.getWavelengthPacket();
    PathNode lightTail = generateLightPath(rnd, lambda);
    PathNode eyeTail = generateEyePath(rnd, lambda);

    if (lightTail != null && lightTail.getDepth() > 0 && lightTail.isAtInfinity()) {
      lightTail = lightTail.getParent();
    }
    if (eyeTail != null && eyeTail.getDepth() > 0 && eyeTail.isAtInfinity()) {
      eyeTail = eyeTail.getParent();
    }
    return new Path(lightTail, eyeTail);
  }
View Full Code Here

    }

    private void join(PathNode lightTail, PathNode eyeTail,
        DoubleArray weights) {

      PathNode lightNode = lightTail;
      while (true) {

        PathNode eyeNode = eyeTail;
        while (true) {
          Color c = pathMeasure.evaluate(lightNode, eyeNode);
          weights.add(colorMeasure.evaluate(c));

          if (eyeNode == null) {
            break;
          }
          eyeNode = eyeNode.getParent();
        }

        if (lightNode == null) {
          break;
        }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.path.BidiPathStrategy#traceLightPath(ca.eandb.jmist.framework.Light, ca.eandb.jmist.framework.path.PathInfo, ca.eandb.jmist.framework.Random)
   */
  public PathNode traceLightPath(Light light, PathInfo pathInfo, Random rnd) {
    PathNode head = light.sample(pathInfo, rnd.next(), rnd.next(), rnd.next());
    return PathUtil.expand(head, maxDepth - 1, rnd);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.path.BidiPathStrategy#traceEyePath(ca.eandb.jmist.framework.Lens, ca.eandb.jmist.math.Point2, ca.eandb.jmist.framework.path.PathInfo, ca.eandb.jmist.framework.Random)
   */
  public PathNode traceEyePath(Lens lens, Point2 p, PathInfo pathInfo,
      Random rnd) {
    PathNode head = lens.sample(p, pathInfo, rnd.next(), rnd.next(), rnd.next());
    return PathUtil.expand(head, maxDepth - 1, rnd);
  }
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.path.PathNode

Copyright © 2018 www.massapicom. 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.