Skip to content

l4cer/Ray-Tracing

Repository files navigation

Ray Tracing

img1

img2

Scene description

Objects

<object geometry="sphere">
    <center>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </center>
    <radius>1.0</radius>
    <material>...</material>
</object>
<object geometry="plane">
    <point>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </point>
    <normal>
        <x>0.0</x>
        <y>0.0</y>
        <z>1.0</z>
    </normal>
    <material>...</material>
</object>
<object geometry="quad">
    <point>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </point>
    <vector_u>
        <x>1.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </vector_u>
    <vector_v>
        <x>0.0</x>
        <y>1.0</y>
        <z>0.0</z>
    </vector_v>
    <material>...</material>
</object>
<object geometry="box">
    <center>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </center>
    <sizes>
        <x>1.0</x>
        <y>1.0</y>
        <z>1.0</z>
    </sizes>
    <material>...</material>
</object>

Materials

<material appearance="light" texture="...">
    ...
</material>
<material appearance="lambertian" texture="...">
    ...
</material>
<material appearance="metal" texture="...">
    <fuzzy>0.2</fuzzy>
    ...
</material>
<material appearance="dielectric" texture="...">
    <refractive_index>1.5</refractive_index>
    ...
</material>

Textures

<material appearance="..." texture="solid">
    ...
    <albedo>
        <r>1.0</r>
        <g>1.0</g>
        <b>1.0</b>
    </albedo>
</material>
<material appearance="..." texture="checker">
    ...
    <odd>
        <r>1.0</r>
        <g>0.0</g>
        <b>0.0</b>
    </odd>
    <even>
        <r>0.0</r>
        <g>0.0</g>
        <b>1.0</b>
    </even>
</material>
<material appearance="..." texture="image">
    ...
    <filename>path/to/image.png</filename>
</material>

Combining them

<object geometry="sphere">
    <center>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </center>
    <radius>1.0</radius>
    <material appearance="dielectric" texture="solid">
        <refractive_index>1.5</refractive_index>
        <albedo>
            <r>1.0</r>
            <g>1.0</g>
            <b>1.0</b>
        </albedo>
    </material>
</object>
<object geometry="box">
    <center>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
    </center>
    <sizes>
        <x>1.0</x>
        <y>1.0</y>
        <z>1.0</z>
    </sizes>
    <material appearance="lambertian" texture="image">
        <filename>textures/rubik.png</filename>
    </material>
</object>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •