Raytracing Background

From Schmid.wiki
Jump to: navigation, search

Contents

Modelling The World

Light

Facts (?)

  • light consist of photons, which can be considered waves
  • the wavelength of a photon determines the colour perceived by the human brain:
    • long wavelength  : red
    • short wavelength : violet
  • there is a finite number of possible wavelengths

Conjectures

  • some perceived colours are actually mixtures of light waves, such as white, which must contain all frequencies (analogous to white noise)

Objects

Facts (?)

  • objects consist of atoms
  • different atom classes react differently to incoming photons
  • atoms can absorb a photon, converting it to kinetic energy (heat). this energy can be used for changing the path of the electrons or other movement
  • atoms unable to absorb a photon due to an incompatible wavelength of the photon, will either reflect it or let it pass 'through' the atom

Conjectures

  • an atom has an area of influence, in which incoming photons are affected, which enables us to view the atom as a ball with radius > 0
  • when a photon collides with an atom and is reflected, the original ray and the reflected ray are mirrored around a line through the center of the "atom ball" and the collision point

Raytracing

When raytracing a single pixel in a model with only one light source, we use the following algorithm:

  • draw a 3D-line from the observer into space
  • when the line collides with an object, record the collision point
  • draw a line from the light source to the collision point
  • if this line is uninterrupted, add the intensity of the light source to the colour of the point

This algorithm models light rays being spread in all directions when hitting an atom. why is this?

A raytraced image does not show a view of a 3D-model during an infinitely small time frame. rather, it shows the model as a camera would record it during a specific time frame (the shutter speed). An infinitely small time frame would not allow any photons to reach the photographic film, resulting in blackness. During this time frame, photons will be emitted from the light source in all directions, and statistically, all objects that can be reached from the light source will be reached. But given the collision conjecture above, why does the ray from the light source ever hit the camera? if the atoms in the objects remain still, the light would always be reflected in some direction, not necessarily towards the camera. the answer is simple: the atoms never remain still. Even if the picture is taken in space, the light from the flash would heat the object in question enough that the atoms move and therefore reflect light in all directions.

Personal tools