VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Semi-realtime Raytracer 2: Primitives

Almar Joling  (9 Submissions)   Graphics   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Complete rebuild of my previous port of the C++ raytracer. This supports: Spheres, Triangles, Planes, Cylinders. Also supports shadows(!), reflections(!!), and multiple _colored_ light sources. Hence why it is so slow. You can now turn on/off options, so you can see everything nicely. Note that you MUST compile to get a bit decent framerate. With triangle support, it's in theory possible to load 3D models and raytrace them.
I might optimize the code later (it's become a bit messy), but it really depends on your votes.
Note that the rendered scene might look a bit chaotic. This is more because of the large "gaps" between every frame.
Note that Raytracers are known for their slowness. That's why there aren't (m)any real-time raytraced programs yet.

API Declarations
Public Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long

Rate Semi-realtime Raytracer 2: Primitives (10(10 Vote))

Download Semi-realtime Raytracer 2: Primitives

Semi-realtime Raytracer 2: Primitives Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters