Comments (4)
Ok, let's describe how the ray trace works. The ray tracer renderer has:
- A 3D Scene is defined with 4 elements: 3 spheres and a plane.
- The Scene has also lights (ambient and diffuse) and a camera pointing to the center of the Scene
- A 2D image where the 3D scene is rendered using ray tracing
The logic is:
- For each pixel in the 2D image fill the color based on ray tracing.
- Cast a ray with origin (O) the camera that goes through each pixel (this defines the direction)
- Find if the ray hits any object in the Scene.
- If no hits, drop the ray (no effects in the pixel color)
- If the ray hits an object, find the hit point (M)
- If the hit point is shadowed drop the ray (no effects in the pixel color)
- Find the hit point color contribution to the pixel based on:
- Ambient light
- Diffuse light using Lambert shading
- Specular light using Blinn-Phong shading
- Create max_depth reflection rays and repeat the above process
from mcthings.
One of the hardest problems with ray tracing is the intersection point and howto find the direction of the ray from the light to the hit point. In this simple case, we have a plane and a sphere. In these cases, it is pretty simple.
from mcthings.
All done for this first iteration.
from mcthings.
To continue in the future:
https://twitter.com/cyrillerossant/status/1290319169171398662
https://ipython-books.github.io/56-optimizing-cython-code-by-writing-less-python-and-more-c/
http://vispy.org/
from mcthings.
Related Issues (20)
- Learn Vulcan API HOT 3
- Research Open Source Physics engines HOT 5
- Learn Computer Graphics HOT 1
- Research Ray Tracing HOT 11
- Implement a Ray Cast renderer for McThings
- Test that McThings works with MC 1.16.1 HOT 2
- Create a Blender renderer for McThings
- Remove McDrawing reimplementing the Sphere
- Research resources pack in Minecraft HOT 4
- Research shaders in Minecraft HOT 1
- Research the use of textures inside Blender
- Research the use of shaders inside Blender
- Implement voxels collisions in Godot physics testbed HOT 14
- Create a Godot renderer for McThings
- vox2schematic - TypeError: to_nbt() takes 3 positional arguments but 4 were given HOT 1
- Test McThings with the last version of Minecraft HOT 2
- Research the migration from TravisCI to GitHub Actions HOT 1
- vox2schematic not working
- Implement McThings over Godot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcthings.