Package ca.eandb.jmist.framework.color

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


    Color c = etol.times(ltoe);

    if (ColorUtil.getTotalChannelValue(c) > 0.0
        && PathUtil.visibility(a, b)) {

      c = c.times(g);

      c = c.times(a.getCumulativeWeight()).times(
          b.getCumulativeWeight());

      return c;
View Full Code Here


    if (ColorUtil.getTotalChannelValue(c) > 0.0
        && PathUtil.visibility(a, b)) {

      c = c.times(g);

      c = c.times(a.getCumulativeWeight()).times(
          b.getCumulativeWeight());

      return c;

    } else { // No mutual scattering or nodes not mutually visible
View Full Code Here

    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));

    return F.times(D * G / (4.0 * EdotN * LdotN));
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Medium#extinctionIndex(ca.eandb.jmist.math.Point3, ca.eandb.jmist.framework.color.WavelengthPacket)
   */
 
View Full Code Here

    for (LightSample sample : sc.getLightSamples()) {
      Vector3 L = sample.getDirToLight();
      Vector3 H = L.plus(V).unit();
      Color I = sample.getRadiantIntensity();

      d = d.plus(I.times(N.dot(L)));
      s = s.plus(I.times(cm.getGray(N.dot(H), lambda).pow(n)));
    }

    d = d.times(kd);
    s = s.times(ks);
View Full Code Here

      Vector3 L = sample.getDirToLight();
      Vector3 H = L.plus(V).unit();
      Color I = sample.getRadiantIntensity();

      d = d.plus(I.times(N.dot(L)));
      s = s.plus(I.times(cm.getGray(N.dot(H), lambda).pow(n)));
    }

    d = d.times(kd);
    s = s.times(ks);
    a = a.times(ka);
View Full Code Here

      if (!sample.castShadowRay(sc)) {
        Vector3 in = sample.getDirToLight().opposite();
        Vector3 out = sc.getIncident().opposite();
        Color bsdf = mat.bsdf(sc, in, out, lambda);
        double dot = Math.abs(in.dot(normal));
        sum = sum.plus(sample.getRadiantIntensity().times(bsdf.times(dot)));
      }
    }
    return sum;
  }
View Full Code Here

    ScatteredRay sr = lens.rayAt(p, lambda, Random.DEFAULT);
    if (sr != null) {
      Ray3 ray = sr.getRay();
      Color scale = sr.getColor();
      Color shade = rayShader.shadeRay(ray, lambda);
      return shade.times(scale);
    } else {
      return ColorUtil.getBlack(lambda);
    }
  }
View Full Code Here

    double d = sc.getDistance();
    if (distanceInterval.contains(d)) {
      double t = (d - distanceInterval.minimum()) / distanceInterval.length();
      Color ncol = getColorWhiteDefault(minDistanceValue, lambda);
      Color fcol = getColorBlackDefault(maxDistanceValue, lambda);
      return ncol.times(1.0 - t).plus(fcol.times(t));
    } else if (d < distanceInterval.minimum()) {
      return getColorWhiteDefault(nearValue, lambda);
    } else {
      return getColorBlackDefault(farValue, lambda);
    }
View Full Code Here

        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

    Vector3  source = RandomUtil.uniformOnUpperHemisphere(rng).toCartesian(Basis3.fromW(zenith));

    if (source.dot(x.getNormal()) > 0.0) {
      double sdotn = source.dot(x.getShadingNormal());
      Color radiance = lambda.getColorModel().getContinuous(new SkyRadianceSpectrum(source)).sample(lambda);
      target.addLightSample(new DirectionalLightSample(x, source, radiance.times(sdotn), shadows));
    }

    if (daytime && sun.dot(x.getNormal()) > 0.0) {
      double sdotn = sun.dot(x.getShadingNormal());
      target.addLightSample(new DirectionalLightSample(x, sun, solarRadiance.sample(lambda).times(sdotn), shadows));
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.