I wrote a Ray Tracer for an assignment this past semester and wanted to keep working on it. There were 5 kinds of materials (for objects) in the assignment and we were given their ambient, diffuse, specular, and shininess values. I'm having a hard time finding a list of these values to create new materials online (one that also included indices of refraction would be fantastic) and was wondering if anyone knew of a good resource for this.
This is the best one I have found so far but it doesn't have that many materials and the materials that have indices of refraction don't have the other values I mentioned above: http://www.nicoptere.net/dump/materials.html
I have never done refraction for a Ray Tracer (planning on learning it for fun), any general advice would be welcome.
For every pixel in the generated Ray Trace image, four rays (or more, depending on the anti-aliasing level) are traced to the corner of each pixel to check for interactions with the objects in each scene. Every time an object is encountered, the color of the surface at that pixel is calculated.
It works by simulating actual light rays, using an algorithm to trace the path that a beam of light would take in the physical world. Using this technique, game designers can make virtual rays of light appear to bounce off objects, cast realistic shadows, and create lifelike reflections.
The ray-tracing algorithm builds an image by extending rays into a scene and bouncing them off surfaces and towards sources of light to approximate the color value of pixels.
The ray-tracing algorithm takes an image made of pixels. For each pixel in the image, it shoots a primary ray into the scene. The direction of that primary ray is obtained by tracing a line from the eye to the center of that pixel.
Use other open source ray tracers as resource, e.g. POV-Ray. You find the definition of materials in the distribution/include
Path.
An example from metals.inc
(put together):
#declare P_Brass1 = color rgb <0.30, 0.20, 0.10>; #declare F_MetalA = finish { ambient 0.35 brilliance 2 diffuse 0.3 metallic specular 0.80 roughness 1/20 reflection 0.1 } #declare T_Brass_1A = texture { pigment { P_Brass1 } finish { F_MetalA } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With