Пример #1
0
 public bool update(ParameterList pl, SunflowAPI api)
 {
     lineColor = pl.getColor("line", lineColor);
     fillColor = pl.getColor("fill", fillColor);
     width = pl.getFloat("width", width);
     cosWidth = (float)Math.Cos(width);
     return true;
 }
Пример #2
0
 public virtual bool Update(ParameterList pl, SunflowAPI api)
 {
     bright = pl.getColor("bright", bright);
     dark = pl.getColor("dark", dark);
     samples = pl.getInt("samples", samples);
     maxDist = pl.getFloat("maxdist", maxDist);
     if (maxDist <= 0)
         maxDist = float.PositiveInfinity;
     return true;
 }
Пример #3
0
 public bool update(ParameterList pl, SunflowAPI api)
 {
     src = pl.getPoint("source", src);
     dir = pl.getVector("dir", dir);
     dir.normalize();
     r = pl.getFloat("radius", r);
     basis = OrthoNormalBasis.makeFromW(dir);
     r2 = r * r;
     radiance = pl.getColor("radiance", radiance);
     return true;
 }
Пример #4
0
 public virtual bool update(ParameterList pl, SunflowAPI api)
 {
     rhoD = pl.getColor("diffuse", rhoD);
     rhoS = pl.getColor("specular", rhoS);
     alphaX = pl.getFloat("roughnessX", alphaX);
     alphaY = pl.getFloat("roughnessY", alphaY);
     numRays = pl.getInt("samples", numRays);
     return true;
 }
Пример #5
0
 public bool Update(ParameterList pl, SunflowAPI api)
 {
     diff = pl.getColor("diffuse", diff);
     spec = pl.getColor("specular", spec);
     string filename;
     filename = pl.getstring("diffuse.texture", null);
     if (filename != null)
         diffmap = TextureCache.getTexture(api.resolveTextureFilename(filename), false);
     filename = pl.getstring("specular.texture", null);
     if (filename != null)
         specmap = TextureCache.getTexture(api.resolveTextureFilename(filename), false);
     diffBlend = MathUtils.clamp(pl.getFloat("diffuse.blend", diffBlend), 0, 1);
     specBlend = MathUtils.clamp(pl.getFloat("specular.blend", diffBlend), 0, 1);
     glossyness = MathUtils.clamp(pl.getFloat("glossyness", glossyness), 0, 1);
     numSamples = pl.getInt("samples", numSamples);
     return true;
 }
Пример #6
0
 public override bool update(ParameterList pl, SunflowAPI api)
 {
     radiance = pl.getColor("radiance", radiance);
     numSamples = pl.getInt("samples", numSamples);
     return base.update(pl, api);
 }
Пример #7
0
 public bool Update(ParameterList pl, SunflowAPI api)
 {
     Vector3 up = pl.getVector("up", null);
     Vector3 east = pl.getVector("east", null);
     if (up != null && east != null)
         basis = OrthoNormalBasis.makeFromWV(up, east);
     else if (up != null)
         basis = OrthoNormalBasis.makeFromW(up);
     numSkySamples = pl.getInt("samples", numSkySamples);
     sunDirWorld = pl.getVector("sundir", sunDirWorld);
     turbidity = pl.getFloat("turbidity", turbidity);
     groundExtendSky = pl.getbool("ground.extendsky", groundExtendSky);
     groundColor = pl.getColor("ground.color", groundColor);
     // recompute model
     initSunSky();
     return true;
 }
Пример #8
0
 public bool Update(ParameterList pl, SunflowAPI api)
 {
     color = pl.getColor("color", color);
     return true;
 }
Пример #9
0
 public bool update(ParameterList pl, SunflowAPI api)
 {
     radiance = pl.getColor("radiance", radiance);
     numSamples = pl.getInt("samples", numSamples);
     radius = pl.getFloat("radius", radius);
     r2 = radius * radius;
     center = pl.getPoint("center", center);
     return true;
 }
Пример #10
0
 public bool update(ParameterList pl, SunflowAPI api)
 {
     lightPoint = pl.getPoint("center", lightPoint);
     power = pl.getColor("power", power);
     return true;
 }
Пример #11
0
 public virtual bool Update(ParameterList pl, SunflowAPI api)
 {
     diff = pl.getColor("diffuse", diff);
     refl = pl.getFloat("shiny", refl);
     return true;
 }
Пример #12
0
 public override bool Update(ParameterList pl, SunflowAPI api)
 {
     radiance = pl.getColor("radiance", radiance);
     numSamples = pl.getInt("samples", numSamples);
     if (base.Update(pl, api)) {
         // precompute triangle areas and normals
         areas = new float[getNumPrimitives()];
         ngs = new Vector3[getNumPrimitives()];
         totalArea = 0;
         for (int tri3 = 0, i = 0; tri3 < triangles.Length; tri3 += 3, i++) {
             int a = triangles[tri3 + 0];
             int b = triangles[tri3 + 1];
             int c = triangles[tri3 + 2];
             Point3 v0p = getPoint(a);
             Point3 v1p = getPoint(b);
             Point3 v2p = getPoint(c);
             ngs[i] = Point3.normal(v0p, v1p, v2p);
             areas[i] = 0.5f * ngs[i].Length();
             ngs[i].normalize();
             totalArea += areas[i];
         }
     } else
         return false;
     return true;
 }
Пример #13
0
 public virtual bool update(ParameterList pl, SunflowAPI api)
 {
     diff = pl.getColor("diffuse", diff);
     return true;
 }
Пример #14
0
 public bool Update(ParameterList pl, SunflowAPI api)
 {
     color = pl.getColor("color", color);
     eta = pl.getFloat("eta", eta);
     f0 = (1 - eta) / (1 + eta);
     f0 = f0 * f0;
     absorptionDistance = pl.getFloat("absorption.distance", absorptionDistance);
     absorptionColor = pl.getColor("absorption.color", absorptionColor);
     return true;
 }
Пример #15
0
        public bool Update(ParameterList pl, SunflowAPI api)
        {
            Point3 corner0 = pl.getPoint("corner0", null);
            Point3 corner1 = pl.getPoint("corner1", null);
            if (corner0 != null && corner1 != null)
            {
                updateGeometry(corner0, corner1);
            }

            // shader colors
            left = pl.getColor("leftColor", left);
            right = pl.getColor("rightColor", right);
            top = pl.getColor("topColor", top);
            bottom = pl.getColor("bottomColor", bottom);
            back = pl.getColor("backColor", back);

            // light
            radiance = pl.getColor("radiance", radiance);
            samples = pl.getInt("samples", samples);
            return true;
        }
Пример #16
0
 public virtual bool update(ParameterList pl, SunflowAPI api)
 {
     diff = pl.getColor("diffuse", diff);
     spec = pl.getColor("specular", spec);
     power = pl.getFloat("power", power);
     numRays = pl.getInt("samples", numRays);
     return true;
 }