private void CreateRenderedImage(int lightIndex, Bitmap image, ref Ray ray, ref Color pixelColor)
        {
            for (int x = 0; x < image.Width; x++)
            {
                for (int y = 0; y < image.Height; y++)
                {
                    if (option.SuperSampling)
                    {
                        pixelColor = superSampling.GetSampleColor(ray, lightIndex, x, y);
                    }
                    else
                    {
                        SetRayDirectionByPixelPosition(ref ray, scene, x, y);
                        pixelColor = tracer.Trace(ray, lightIndex, 2);
                    }

                    image.SetPixel(x, y, pixelColor);
                }
            }
        }
Пример #2
0
 private void TraceSubPixel(Ray ray, int lightIndex, int pixelPositionX, int pixelPositionY, float divisionPixelX, float divisionPixelY)
 {
     PotatoRenderer.SetRayDirectionByPixelPosition(ref ray, sceneData, pixelPositionX + (divisionPixelX - halfResolution) / halfResolution, pixelPositionY + (divisionPixelY - halfResolution) / halfResolution);
     samplingColor = tracer.Trace(ray, lightIndex);
     AddSamplingColorToColorChannels();
 }