Ejemplo n.º 1
0
 public SpecularTransmission(float indexOfRefractionIncident, float indexOfRefractionTransmitted,
                             SampledSpectrum s = null) : base(BxDFType.Transmission | BxDFType.Specular)
 {
     _fresnel = new FresnelDielectric(indexOfRefractionIncident, indexOfRefractionTransmitted);
     _s       = s ?? SampledSpectrum.Random();
     IndexOfRefractionIncident    = indexOfRefractionIncident;
     IndexOfRefractionTransmitted = indexOfRefractionTransmitted;
 }
Ejemplo n.º 2
0
 public TestMaterial(float?reflectiveness = null, SampledSpectrum spectrum = null)
 {
     _reflectiveness = reflectiveness ?? StaticRandom.NextFloat();
     _spectrum       = spectrum ?? SampledSpectrum.Random() * 0.3f;
 }
Ejemplo n.º 3
0
 public LambertianReflection(SampledSpectrum spectrum) : base(BxDFType.Reflection | BxDFType.Diffuse)
 {
     _spectrum = spectrum ?? SampledSpectrum.Random();
 }
Ejemplo n.º 4
0
        private void InitNewScene()
        {
            _scene = new Scene();
            var screen = new raytracer.core.Screen(1024, 768);

            _film = new MyFilm(screen, NSamples);
            Camera camera = new SimpleCamera(screen,
                                             Transformation.Translation((float)PositionX.Value, (float)PositionY.Value, (float)PositionZ.Value) *
                                             Transformation.RotateX((float)(RotationX.Value % 360)) *
                                             Transformation.RotateY((float)(RotationY.Value % 360)) *
                                             Transformation.RotateZ((float)(RotationZ.Value % 360)));

            _renderer = new Renderer(_scene,
                                     new GridSampler(screen), camera, _film,
                                     new WhittedIntegrator());
            _scene.Lights.Add(new PointLight(Transformation.Translation(100, 650, -500), SampledSpectrum.White() * 2000000));
            _scene.Lights.Add(new PointLight(Transformation.Translation(0, 0, -1000), SampledSpectrum.Random() * 200000));
            SimpleObjParser(_scene, _file);
        }
 public MatteMaterial(SampledSpectrum spectrum = null)
 {
     _lambertianReflection = new LambertianReflection(spectrum ?? SampledSpectrum.Random());
 }
Ejemplo n.º 6
0
 public ReflectiveMaterial(SampledSpectrum spectrum = null, Fresnel fresnel = null)
 {
     _specular = new SpecularReflection(1, spectrum ?? SampledSpectrum.Random());
 }