jbikker / bvh_article Goto Github PK
View Code? Open in Web Editor NEWCode accompanying the blog post on bvh construction.
License: The Unlicense
Code accompanying the blog post on bvh construction.
License: The Unlicense
Thanks for your great blog posts, I was just trying to play around with the code a bit this evening.
Immediately had troubles to get this to compile in a fresh installation of VS2022. Namely the DEFINE_ENUM_FLAG_OPERATORS
from winnt.h seems missing in the win_tiny.h nowadays. Including the bigger windows.h
again and commenting the tiny header works again:
#include "windows.h"
// #include "lib/win_tiny.h" // windows.h replacement for faster builds
bvh_article/template/precomp.h
Line 79 in c127c63
I'm on win11 with a fairly recent sdk version: 10.0.22621.0 that I just downloaded. Thought I'll leave a quick note here before others spend hours on figuring out what was missing.
Cheers,
Thomas
Maybe add a default bounds
initialization after this line to use the bvhNode[0]
bounding box. If SetTransform() is not called on BLAS, the TLAS intersection code will most probably crash.
Line 70 in d714193
Hi, I loved your tutorials on BVH. I was saving them for reference. And it appears that the site is not inaccessible anymore: https://jacco.ompf2.com/2022/04/13/how-to-build-a-bvh-part-1-basics/
Getting 403 Forbidden.
Could be a temporary glitch
Hi, I am a little confused about the way to calculate orientation calculation.
in chapter2:
https://github.com/jbikker/bvh_article/blob/89bf112b7ca8c277ac0a311119aa2e29d5ee41f1/faster.cpp#L277C1-L279C57
ray.O = float3( -1.5f, -0.2f, -2.5f );
float3 pixelPos = ray.O + p0 + (p1 - p0) * ((x + u) / (float)SCRWIDTH) + (p2 - p0) * ((y + v) / (float)SCRHEIGHT);
ray.D = normalize( pixelPos - ray.O ), ray.t = 1e30f;
Why need to add ray.O for pixelPos, and minus the ray.O to calculate ray,D. It seems the rays are emitted from (0,0,0), but the ray origin point is still ( -1.5f, -0.2f, -2.5f )
and in chapter1:
In chapter1:
https://github.com/jbikker/bvh_article/blob/89bf112b7ca8c277ac0a311119aa2e29d5ee41f1/basics.cpp#L182C1-L184C41
float3 pixelPos = p0 + (p1 - p0) * (x / (float)SCRWIDTH) + (p2 - p0) * (y / (float)SCRHEIGHT);
ray.D = normalize( pixelPos - ray.O );
there is different calculation for pixelPos (no ray.O added)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.