Package ca.eandb.jmist.framework.color

Examples of ca.eandb.jmist.framework.color.Color.divide()


          Complex    eta2  = new Complex(n2avg, k2avg);
          Vector3    out    = Optics.refract(v, eta1, eta2, normal);
          boolean    toSide  = x.getNormal().dot(out) >= 0.0;

          if (fromSide != toSide) {
            return ScatteredRay.transmitSpecular(new Ray3(p, out), T.divide(1 - r), 1 - r);
          }
//        }
      }

    }
View Full Code Here


        ScatteredRay ray = sc.getMaterial().scatter(sc, sc.getIncident(), true, sc.getWavelengthPacket(), sampler.next(), sampler.next(), sampler.next());
        if (ray != null) {
          shade = shade.plus(sc.castRay(ray).times(ray.getColor()));
        }
      }
      return shade.divide(firstBounceRays);
    } else if (sc.getPathDepth() < maxDepth) {
      ScatteredRay ray = sc.getScatteredRay();
      if (ray != null) {
        double prob = ColorUtil.getMeanChannelValue(ray.getColor());
        if (prob < 1.0) {
View Full Code Here

      Complex    eta2  = new Complex(n2avg);
      Vector3    out    = Optics.refract(v, eta1, eta2, normal);
      boolean    toSide  = x.getNormal().dot(out) >= 0.0;

      if (fromSide != toSide) {
        return ScatteredRay.transmitSpecular(new Ray3(p, out), T.divide(1 - r), 1 - r);
      }
    }
    }

    return null;
View Full Code Here

          } else {
            Ray3 ray = sr.getRay();
            Vector3 v = ray.direction();
            double pdf = w * sr.getPDF() + (1.0 - w) * inner.getEmissionPDF(x, v, lambda);
            Color edf = inner.emission(x, sr.getRay().direction(), lambda);
            return new ScatteredRay(ray, edf.divide(pdf), sr.getType(), pdf, sr.isTransmitted());
          }
        }
      } else {
        ScatteredRay sr = inner.emit(x, lambda, ru, rv, ref.seed);
        if (sr != null) {
View Full Code Here

          } else {
            Ray3 ray = sr.getRay();
            Vector3 v = ray.direction();
            double pdf = w * strategy.getEmissionPDF(x, v, lambda) + (1.0 - w) * sr.getPDF();
            Color edf = inner.emission(x, sr.getRay().direction(), lambda);
            return new ScatteredRay(ray, edf.divide(pdf), sr.getType(), pdf, sr.isTransmitted());
          }
        }
      }
    }
    return null;
View Full Code Here

          Vector3 r = ray.direction();
          Vector3 in = adjoint ? r.opposite() : v;
          Vector3 out = adjoint ? v.opposite() : r;
          double pdf = w * sr.getPDF() + (1.0 - w) * inner.getScatteringPDF(x, v, r, adjoint, lambda);
          Color bsdf = inner.bsdf(x, in, out, lambda);
          return new ScatteredRay(ray, bsdf.divide(pdf), sr.getType(), pdf, sr.isTransmitted());
        }
      }
    } else {
      ScatteredRay sr = inner.scatter(x, v, adjoint, lambda, ru, rv, ref.seed);
      if (sr != null) {
View Full Code Here

          Vector3 r = ray.direction();
          Vector3 in = adjoint ? r.opposite() : v;
          Vector3 out = adjoint ? v.opposite() : r;
          double pdf = w * strategy.getScatteringPDF(x, v, r, adjoint, lambda) + (1.0 - w) * sr.getPDF();
          Color bsdf = inner.bsdf(x, in, out, lambda);
          return new ScatteredRay(ray, bsdf.divide(pdf), sr.getType(), pdf, sr.isTransmitted());
        }
      }
    }


View Full Code Here

                solidAngle,
                projectedSolidAngle,
                this.outstandingSamplesPerMeasurement,
                colorToCSV(raw),
                colorToCSV(reflectance),
                colorToCSV(reflectance.divide(projectedSolidAngle)),
                colorToCSV(reflectance.divide(solidAngle))
            );
            out.println();

          }
View Full Code Here

                projectedSolidAngle,
                this.outstandingSamplesPerMeasurement,
                colorToCSV(raw),
                colorToCSV(reflectance),
                colorToCSV(reflectance.divide(projectedSolidAngle)),
                colorToCSV(reflectance.divide(solidAngle))
            );
            out.println();

          }
View Full Code Here

              Color score      = join(lightTail, eyeTail,
                            lightImageWeight);
              if (score != null) {
                raster.get().addPixel(x, y,
                    score.divide(samplesPerPixel));
              }

            }

          }
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.