Code Monkey home page Code Monkey logo

numworks-modular-raytracing's Introduction

Numworks-Modular-Raytracing

My first modular Ray tracing engine made for numworks calculator

Table of Contents

Credit

Blender Support

Template to add object manually

Somes images

For The futur

Huge thanks to Sebastian Lague https://www.youtube.com/watch?v=Qz0KTGYJtUk&t=1418s

to cs.princeton.edu https://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/raycast/sld017.htm

to antonako and idmean https://stackoverflow.com/a/6178290

and to Ray Tracing in One Weekend https://raytracing.github.io

Blender Support

To convert a blender scene into the raytracer I made a python script (its bad).

First to optimize the rendering engine if the object has sphere in its name is will be considered as a sphere with a fixed radius and nothing else

And if it has plane it will be considered as an infinite plane and nothing else

The spcript take 1 material per object and all the materials need to be just a Principled BSDF attached to a material output

Next all the meshes in your scene need to be tris not quad to convert them you can use the triangulate modifier: First add the modifier the object

image

Then apply it

image

Next, you need to select all the object in the scene and then run the script

image

The output of the script will be in a file named ‘scene.txt’.

image

Just copy the content of the file in the appropriate part of the code

Template to add object manually

mesh

{

    'type': 'mesh',
    'mesh': mesh,
    'position': (-0.91, -5.46, 22.11),
    'color': (1, 1, 1),
    'metallic': 0,
    'roughness': 1,
    'specular': 0,
    'emmisiveColor': (1, 1, 1),
    'emmisiveStrenght': 0
},

sphere

{
    'type': 'sphere',
    'position': (-1, 0, -7),
    'radius': 1,
    'color': (0, 1, 0),
    'metallic': 0,
    'roughness': 1,
    'specular': 0,
    'emmisiveColor': (1, 1, 1),
    'emmisiveStrenght': 0
},

plane

{
    'type': 'plane',
    'position': (0, -5.46001, 0),
    'normal': (0, 1, 0),
    'size': 5,
    'color': (1, 1, 1),
    'metallic': 0,
    'roughness': 1,
    'specular': 0,
    'emmisiveColor': (1, 1, 1),
    'emmisiveStrenght': 0
},

Somes images ! Some of these images and time might be outdated !

pc-11m 43s numworks n110 ~32h 10m 19s

image

pc-5m 12s numworks n110 ~12h 43m 6s

image

pc-30m 15s numworks n110 ~3j 1h 59m 11s

image

pc-20m 24s numworks n110 ~2j 1h 53m 42s

image

image

The numworks n110 take roughly 146,75 the time of my computer

For The futur

For the future of this project, I would like to add glass support and fix the glitches with the mesh and planes

Some’s optimization

And convert this code to C++ to make it into a Numworks app to run faster but i dont C how to do it (sorry)

(Sorry for bad English)

numworks-modular-raytracing's People

Contributors

legoman0701 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.