Two years ago, I showed you how I created a simple ray-tracer from scratch. This is my attempt at improving my first version and showing you how I did it!
► My new Discord server: https://discord.gg/FJqqvqHaZS
► My first Ray-tracing attempt: https://youtu.be/lKIytgt3KXM
► Source code: https://github.com/carl-vbn/opengl-raytracing
► Valuable resources:
– OpenGL tutorials: https://learnopengl.com/
– Ray-tracing blog post: http://three-eyed-games.com/2018/05/03/gpu-ray-tracing-in-unity-part-1/
– ImGUI Library: https://github.com/ocornut/imgui
– TheCherno’s Bloom video: https://youtu.be/tI70-HIc5ro
🎵 Music from Epidemic Sound, register with my link to support the channel and get a discount:
https://www.epidemicsound.com/referral/tgmxaf
Detailed description:
In this video, I explain how I created a ray tracing engine in C++ using OpenGL. Raytracing is a rendering algorithm that can be used to generate photorealistic images with nice shadows and reflections. The technology has recently been made accessible to many when NVIDIA announced their RTX graphics cards. I successfully implemented lighting, soft shadows, ray-traced global illumination, progressive rendering, reflections and more.
Chapters:
0:00 – Intro
1:23 – GPU acceleration
2:06 – Ray-tracing recap
3:10 – Direct illumination
4:37 – First result
4:42 – Soft shadows
5:20 – New result
5:39 – User interface
6:27 – Indirect illumination
8:18 – Progressive rendering
9:42 – Reflections
10:24 – Skybox
10:51 – Recursion problem
13:50 – Anti-aliasing
14:33 – Bloom
15:24 – Final results & conclusion
#Raytracing
#OpenGL
source
Sorry for the short break 🙂
I hope this video was worth the wait!
Also, thank you so much for 10k subscribers!!
EDIT: At around 1:17, I called OpenGL a graphics "library" which isn't the right word. OpenGL is an API, not a library!
“Jagged” is pronounced “JAG-id.”
Super stuff – always wanted to create a raytracer myself, did a bit of work but I think that the hardest bit to do quickly, is sorting the objects and determining the nearest collision.
I thaught Graphics programming was a rocket science, you inspired me a lot, Thanks
I wonder why you didn't just try fork your past Java-based ray tracer by implementing global illumination using a graphics API this time around. Modifying your previous ray tracer not only would've saved a lot of time, but it would've also been a good way to show that you can achieve results that are on par with C# and C++ by using Java with a graphics API. Why do I get the impression that everyone has a stigma that Java is somehow worse than C++? Even if I'm not a programmer (I'm a cartoonist), I still get frustrated by this mentality because c'mon! Look at those Minecraft Java Edition shaders that use experimental, real-time implementations of path tracing with global illumination and they look spectacular! These things are already enough proof that Java is capable of achieving beautiful computer graphics that are on par with Blender's Cycles, Autodesk's Arnold, and LuxCoreRender.
make debian version and ill sub with my 5 alts
you look smart as a graphic engineer, but you sound bad as audio engineer. i had to put volume up so loud, when i forgot i did it and opened other video, my ears hurted
Best video on this topic on YouTube. So well explained and great result.
Hi
I love you im surprised you don't have more subscribers
you know he got programmer socks, if he reprogramms his old project!
Those read, listen to / bugged / eavesdrop / overheared / tapped, watched, spied, copied and steal many of my ideas (=inventions) initiated by me:
+ open, transparent 360° sunlight Buildings, construction methods, architectures, designs, concepts;
+ Step-floor / -storey / -level / -tier pyramid (e.g., as a residential building);
+ 360° stepped floors / storey / level / tier buildings (constructions, architectures, construction methods, designs, concepts, 2D, 3D, models);
+ 3D 360° environment (surround), volume, space (room) audio / sound;
+ 360° environment (surround), volume, room screens (displays), monitors, TVs;
+ Screens (displays), monitors, TVs without backlighting;
+ many things with magnets like Micro-OLED;
+ 360° screens, monitors, TVs, panels, glass;
+ curved screens, monitors, TVs, panels, glass;
+ 360° reflections and light digital: "ENB", "Ray-Tracing" / "RTX", “Lumen illumination” and whatever renaming!
+ Short Throw Projectors;
+ dark backgrounds / themes / skins for windows, browser windows, internet sites, programs / apps, etc.;
+ fanless, passive cooling; +thermal pads; + Water cooling (unwanted, because it conducts electricity) and liquid cooling (wanted) for the computer and personal computer / PC application area!
– I am not the inventor of refrigeration by nitrogen, instant- / blast-freeze / -freezing;
+ 360° open, transparent PC cases;
+ 360° Sphere, Ball as a Wheel (2D, 3D) “Omniwheel” / “Omni-Wheel”;
+ From a standing position / standing a 360° turn / rotation in any direction on all objects, including logically and of course vehicles, transporters, robots of all kinds;
+ Flying objects, planes that take off and land vertically, for example by hot air, example fighter jet;
+ skyscraper up to the weightlessness of space ("space scraper") – "mega construction";
+ LED lights (at least its implementation and intended use outside of tv and pc-monitor); RGB LED “Nanoleaf”, etc.
+ and much more!
+ I'm not the inventor of VR, but of "AR", AR glass, AR glasses;
It was only later that I realized that they derived a lot from my ideas (=inventions), a lot came about that has to do with color and light, through me as an initiator, booster / catalyst, e.g., through my idea, invention of the Screens without a backlight and without a built-in / integrated backlight! It is no coincidence that only afterwards, after I initiated this, they built, built and are building those inventions thanks to my impetus! They sell my ideas (inventions) as theirs! They are not the inventors, but the first technical implementers of my ideas (=inventions)! And those are not the inventors, but the thieves of my ideas (=inventions) initiated by me, because those act as if I wasn't the first hand and the first domino, and they take unjustly, undeservedly a lot of money, stolen money (blood money), recognitions, awards, certificates, fame and history, they boast of my laurels / merits!
Before me they all were stucked at LCD, Plasma TV and less lights!
I have made a deep impact in evolution!
Those manipulate, sabotage, falsify, distort images, paintings, digitized and real, animations, videos, films, also composed of many images, even the publication dates of mine, others and their posts, images, videos, etc.!
You have to understand, those can distort everything that can be heard and seen in real life and digitally!
They block and delete my pictures, videos, posts, comments, comments-answers and answers!
They are poisoning and murdering the world with fake diseases, treatments, "vaccinations"/ "vaccines" and injections by syringe!
Now they also make it out as if they haven't been ripping off, cheating, enslaving, murdering other countries with the money currency, money exchange by even -99% for more than two centuries! And as if I'm not the first to disclose that and more! As if I didn't disclose and initiate > 1.00 Ruble (₽) = 1.00 asian Yen (¥) = 1.00 Euro (€) = 1.00 Dollar ($) = any (X) any country < years ago!
Each and every non-civilian you hear and see on TV is involved! You can hear and see their > blue <, grinning speakers / talkers every day on TV!
Those are white, > blue <, blond / blond-haired, bald, red-haired, grey-eyed, blue-eyed, Christian, Jewish, fascists, Nazi-pigs, child murderers, mass murderers, people murderers (genocides)!
To all dark-haired, black-haired people, defend yourself against the white, > blue <, blond / blond-haired, bald-headed, red-haired, Christians, Jews, because those are the real terrorists, mass murderers, people's mass murderers (genocides), child murderers, fascists, Nazi-pigs!
"Can you back up these claims?"
– "They block and delete my pictures, videos, posts, comments, comments-answers and answers!" certain ones a lot very often!
They block my profile links! Go to my Youtube channel / profile, there you should see a link to my main profile for free, the language of the free site can be set to english on the site in the settings. On my free main site you can read my public posts for free, some with pictures, links and dates.
My YouTube Channel / Mein YouTube Kanal:
https://youtube.com/user/damysticalone87
https://www.youtube.com/user/damysticalone87
http://www.youtube.com/user/damysticalone87
youtube.com/user/damysticalone87
https://www.youtube.com/user/damysticalone87/about
YouTube search username damysticalone87
YouTube damysticalone87
My Odnoklassniki profile / Mein Odnoklassniki Profil:
https://ok.ru/eugenzhenyak
https://ok.ru/eugenzhenyak/statuses
https://ok.ru/eugenzhenyak/statuses/all
https://www.ok.ru/eugenzhenyak
https://www.ok.ru/eugenzhenyak/statuses
http://www.ok.ru/eugenzhenyak
http://www.ok.ru/eugenzhenyak/statuses
ok.ru/eugenzhenyak
ok.ru/eugenzhenyak/statuses/all
ok.ru search username eugenzhenyak
Odnoklassniki eugenzhenyak
https://www.skype.com
https://www.skype.com/de
https://www.skype.com//ru
My free main site: ok.ru/eugenzhenyak/statuses/all
Do the Nvidia neural net bro.
Theres no way that you are a computer scientist. are you a mathematican or physicist?
Interesting preoccupation. However retracing the footsteps of others without original insight or contribution is an excellent way to stuck yourself in a similar rut of obstacles caused by their thinking. For your next project — build an optical gpu. This is your logical next step. Optical computations are instantaneous and easy as to perform as you will discover. I will provide an insight: for years I struggled to find a way of caching optical computations. The answer: Varistors. Variable resistors. That is the key. Once the optical computation is performed you can use a varistor to calibrate an equivalent opposite wavelength in current which whitens the light. In optics, resistor and register are phonemes.
looks like an french accent you got
I made a very similar raytracing engine with OpenGL and C++ a few years ago. The speed of software raytracing is very limited though. I'm currently rewriting it using Vulkan and Rust. I can use Nvidia's hardware accelerated raytracing extensions to speed things up drastically.
Not only great results, but the video aswell must've been very tiresome to do, great work. Did you use Manim for the concept animations?
Cool project, man!
man great stuff
You can do an optimisation by rendering into sparse voxel space instead of screen space. All of those dot products you calculated from the lights are still the same within voxel space, you can just cull the non visble voxels and recalculate whatever lights are in screen space if they move / change intensity. It just becomes a data management task which is much faster. Lumen works like this AFAIK.
OpenGL is a specification. Not library.
"You made a realistic 3D renderer? Good, now make an entire new 3D software with mesh editing and sculpting."
I have a question. When I rotate an image on a 2-dimension plane, and I get the point to show at its new location as being 2.43, 3.76; can the color to copy be calculated as ((0.57 + 0.24) * color at 2,3 + (0.57 + 0.76) * color at 2,4 + (0.43 + 0.24) * color at 3,3 + (0.43 + 0.76) * color at 3,4)/4? With a coordinate being 2.43, I figured that since I was 43 percent of the way from there to 2 and 57 percent of the way from there to 3 that I need to put a 43 percent weight towards 3 and a 57 percent weight toward 2. Is that a good idea?
I recommend adding something called "fresnel" to the engine since the ground plane is looking a bit flat near the horizon. The steeper a ray comes in the more reflective the object gets. This effect gets weaker the rougher the object is. It is also a mandatory feature if you want photorealism since our brains know something is off.
I also recommend adding caustics because it also affects realism. When computing indirect lighting, you should make rays bounce off reflective surfaces and if it reaches a light or a bright surface, you light the original surface accordingly.
Your content is great man. Keep up the good work
can we compile this in linux tho?
amazing
Nice, very nice
If you continue this raytracer, you could add pbr materials and fresnel (for the moment it looks like you blended between metallic and diffuse materials)
What about vulkan raytracing ?
AMAZING !!!
You could still use Java with OpenGL, just to spite the haters.
How long did this take you
how do i open this? i want to test my pc with it but there doesn't appear to be an application file anywhere..
That's how render engine "Cycles" works…
cool cool now remake all of blender
Please make a part 2!
ok now make it game engine
How did you create the boxes from the spheres? I am tired of using the slow voxel code that involves WAY too many plane intersections. Please get back as my raytracers looks awful with the current voxel system.
you dont need to wast time like this. just learn unreal engine 5. it supports ray tracing and there are many more features.
OpenGL is already getting depricated. Use vulkan next time!
you used java and didnt even use opengl? u used the standard extremly bad 3d lib? i want to not be here
If you want even more realistic material behaviour, try looking into GGX scattering, it's a microfacet distribution, meaning it models the materials as a ton of microscopic mirrors oriented depending on smoothness etc. Great video btw!
If you ever do this again, You should use Vulkan. It’s way more efficient than OpenGL from what I hear. I use SDL mostly so I wouldn’t know. But still, if you are to do this again, try Vulkan.