Examples of prepareShadingContext()


Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

    SceneElement root = scene.getRoot();
    Intersection x = NearestIntersectionRecorder
        .computeNearestIntersection(ray, root);
    if (x != null) {
      ShadingContext context = new MinimalShadingContext(Random.DEFAULT);
      x.prepareShadingContext(context);
      context.getModifier().modify(context);
      return new SurfaceNode(this, sr, context, ru, rv, rj);
    } else {
      return new BackgroundNode(this, sr, ru, rv, rj);
    }
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

      if (rec.isEmpty()) {
        break;
      }
      Intersection x = rec.nearestIntersection();
      MinimalShadingContext ctx = new MinimalShadingContext(Random.DEFAULT);
      x.prepareShadingContext(ctx);
      Point2 uv = ctx.getUV();
      if (trim.opacity(new Point2(uv.x(), 1.0 - uv.y())) > 0.5) {
        recorder.record(x);
        if (!recorder.needAllIntersections()) {
          break;
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

      if (rec.isEmpty()) {
        break;
      }
      Intersection x = rec.nearestIntersection();
      MinimalShadingContext ctx = new MinimalShadingContext(Random.DEFAULT);
      x.prepareShadingContext(ctx);
      Point2 uv = ctx.getUV();
      if (trim.opacity(new Point2(uv.x(), 1.0 - uv.y())) > 0.5) {
        recorder.record(x);
        if (!recorder.needAllIntersections()) {
          break;
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

    int id = (twoSided && RandomUtil.coin(xj))
        ? RECTANGLE_SURFACE_BOTTOM
        : RECTANGLE_SURFACE_TOP;

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#getSurfaceArea()
   */
 
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

        local.front = x.isFront();
        local.medium = Medium.VACUUM;
        local.importance = lambda.getColorModel().getWhite(lambda);

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

        Color color = shade();

        stack.pop();
        return color;
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

        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()));
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

   */
  @Override
  public void generateRandomSurfacePoint(int index, ShadingContext context, double ru, double rv, double rj) {
    Point3 p = faces.get(index).generateRandomSurfacePoint(ru, rv, rj);
    Intersection x = super.newSurfacePoint(p, index).setPrimitiveIndex(index);
    x.prepareShadingContext(context);
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#generateRandomSurfacePoint(ca.eandb.jmist.framework.ShadingContext, double, double, double)
   */
 
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

   */
  @Override
  public void generateRandomSurfacePoint(ShadingContext context, double ru, double rv, double rj) {
    Point3 p = sphere.center().plus(RandomUtil.uniformOnSphere(sphere.radius(), ru, rv).toCartesian());
    Intersection x = newSurfacePoint(p);
    x.prepareShadingContext(context);
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#getSurfaceArea()
   */
 
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

    int id = (twoSided && RandomUtil.coin(rj))
        ? DISC_SURFACE_BOTTOM
        : DISC_SURFACE_TOP;

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#getSurfaceArea()
   */
 
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection.prepareShadingContext()

          RandomUtil.uniform(box.spanY(), ru),
          RandomUtil.uniform(box.spanZ(), rv));
    }

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.geometry.AbstractGeometry#getSurfaceArea()
   */
 
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.