Giter Site home page Giter Site logo

s-litvin / raycasting Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 899 KB

Ray casting is the use of ray–surface intersection tests to solve a variety of problems in 3D computer graphics and computational geometry.

Home Page: https://s-litvin.github.io/raycasting/

HTML 0.01% JavaScript 99.99% CSS 0.01%
javascript raycasting games game-engine graphics-programming algorithms line-intersection p5js dithering dithering-algorithms

raycasting's Introduction

Raycasting

Ray casting is the most basic of many computer graphics rendering algorithms that use the geometric algorithm of ray tracing. Ray tracing-based rendering algorithms operate in image order to render three-dimensional scenes to two-dimensional images. Geometric rays are traced from the eye of the observer to sample the light (radiance) travelling toward the observer from the ray direction. The speed and simplicity of ray casting comes from computing the color of the light without recursively tracing additional rays that sample the radiance incident on the point that the ray hit. This eliminates the possibility of accurately rendering reflections, refractions, or the natural falloff of shadows; however all of these elements can be faked to a degree, by creative use of texture maps or other methods. The high speed of calculation made ray casting a handy rendering method in early real-time 3D video games.

For monochrome displays I added ordered dithering algorithm for rendering.

Demo

Control the camera view with the keyboard arrow and the mouse.

Check this demo on GitHub page: https://s-litvin.github.io/raycasting/

alt text

Or, you can enable 'Dither' effect for monochrome dislays: alt text

© 2023

raycasting's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

raycasting's Issues

Performance optimisation

Any performance optimisations needed. First of all, the dithering option slowing down rendering. Maybe it need to use pure canvas instead of a p5js library, or use off-screen buffer to draw.
And for the mobile devices or slow computers frame rate can be beter then now.

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.