Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromPinkyboi/RT

A Raytracing program from scratch in C language, with complex shapes, texture mapping, soft shadows, multiple lights and fractals.

NotificationsYou must be signed in to change notification settings

KernelOverseer/RT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a 3d object made of polygons, in a box of mirrors

A raytracing program built from scratch in C language, using MinilibX minimal graphics library, with pseudo-xml files as input, a dynamic render realtime viewer, and the ability to save bmp at your resolution of choice, and the ability to render on multiple devices for faster distributed rendering.

This project's main goal is learning raytracing from scratch, making a simple pseudo-xml parser expandable by design, and distributing computational tasks using C sockets to implement cluster rendering.

a scene displaying the use of bump mapping to alter refraction

Features

  • Simple shapes : sphere, cone, cylinder, ...
  • Complex shapes : hyperboloid, torus, hollow cube, ...
  • Shading : diffuse, specular, transparency, reflection, refraction
  • Mappings : diffuse, specular, normal, transparency, reflection.
  • Manipulations : plane cut, object limiting, texture cutting.
  • Anti aliasing : 1x 2x 4x
  • Smooth shadowing
  • Parallel light
  • 3d red-blue stereo rendering
  • Mandelbulb fractal

Installation

OSX & Linux:

make -C ./libs/MinilibX ; make

Usage Example

Open the scene specified in the gui view

./rt scene_file.xml

Render the scene to the bmp file

./rt --no_window save_file.bmp scene_file.xml

The scene file

Example of a scenedemo.xml
<sceneambiant="0.5"AA="4"resolution="720"light_samples="20"></scene><cameraposition="(10, 20, 80)"lookat="(0, 20, 0)"fov="40"></camera><lightcenter="(0, 200, 20)"radius="3"intensity="0.5"color="#FFFFFF"></light><lightcenter="(0, 100, 100)"radius="1"intensity="0.5"color="#FFFFFF"></light><conelength="30"center="(0, 10, 0)"color="#FF00FF"axis="(0, 1, 0)"radius="6"></cone><planecenter="(0, -1, -10)"length="(60, 60)"U="(0, 1, 0)"V="(1, 0, 0)"color="#D3D3D3"></plane> <planecenter="(0, -1, 0)"length="(60, 60)"U="(0, 0, 1)"V="(1, 0, 0)"color="#D3D3D3"></plane><spherecenter="(5, 10, 50)"color="#FF0000"radius="3"></sphere><ellipsoidcenter="(30, 3, -10)"axis="(10,5, 5)"translation="(3, 0, 0)"color="#000000"radius="4"></ellipsoid>

I invite you to discover more about the available tags and properties from the source code and the example scenes inrt-scenes

Result

Rendering result of the previous example

The GUI mode

The GUI mode gives you the freedom of moving the camera, enabling and disabling some effects and saving the result to a bmp.

the GUI

Some Renderings

light going thru a cut objectlight going thru cut object, but with soft shadows oninside a transparent refractive spherepartially transparent sphere with earth normal mappingSimple scene with reflectionscene with procedurally generator textures

Authors

MbarkErras

KernelOverseer

abenaiss

abdzr

About

A Raytracing program from scratch in C language, with complex shapes, texture mapping, soft shadows, multiple lights and fractals.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C77.8%
  • Roff11.3%
  • Objective-C6.9%
  • Makefile2.9%
  • Python0.7%
  • Shell0.2%
  • Perl0.2%

[8]ページ先頭

©2009-2025 Movatter.jp