Comments (5)
so maybe it's the code behind the BVH who's bad, i will try to look into the PBRT Book code base and import as a third party there bvh to see if i work. and also look into radeon rays
from nerv_pathtracer.
So, looking at the code of PBRT didn't help, I will look into 3 potential sources :
- RTOW BVH tutorial
- Radeon Ray BVH
- Tinsel CUDA BVH
We have to keep in mind with the GLSL BVH traversal it cannot be don't with recursive functions.
from nerv_pathtracer.
this will mark the point of merge for the bvh because i'm loosing to much time on the bvh, i want to focus more on the light transport part.
I will do a recap of what the bvh do and not do as of now :
- bvh is creating a tree that work for the up to the leaf node but after the triangle detection is bugged
it might come from two thing, the triangle in the bvh are poorly setup so the leaf boxs contains the wrong tris or it's my traversal in the code who's wrong.
bvh will have more support in the future but taking a break on it as of know
from nerv_pathtracer.
the bug is found !
As you can see in the picture above the triangle are outside the leaf rather being in it.
The triangles in the nodes are wrong, so the bug come from here.
from nerv_pathtracer.
alright after some dumping of the BVH and the Triangles data, i've come up with a small python script to debug the whole thing :
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import numpy as np
import matplotlib.pyplot as plt
import pandas
#open the data files
bvh = np.array(pandas.read_csv("bvh.csv"))
tris = np.array(pandas.read_csv("tris.csv"))
#selection a triangle to watch
nTri = 122
#get the triangle and the bvh leaf
index = np.where(triangle[:,0] == nTri)
indexBVH = np.where(bvh[:,9] == nTri)
#data alignement
tri = tris[index,:][0][0]
leaf = bvh[indexBVH,:][0][0]
#ploting
fig = plt.figure()
ax = Axes3D(fig)
#plot the triangle
x = [tri[1],tri[5],tri[9]]
y = [tri[2],tri[6],tri[10]]
z = [tri[3],tri[7],tri[11]]
verts = [list(zip(x,y,z))]
ax.add_collection3d(Poly3DCollection(verts))
#plot the bvh node
xs = [leaf[1],leaf[5]]
ys = [leaf[2],leaf[6]]
zs = [leaf[3],leaf[7]]
ax.scatter(xs, ys, zs, marker=m, color='red')
#show everything
plt.show()
this show us as it should the wrong leaf and the wrong tris
here the data files if you want to experiment yourself
dump.zip
from nerv_pathtracer.
Related Issues (15)
- Should logs file still be included in the repo ?
- refractoring and clean up HOT 1
- Compilation under Linux and MacOS is not possible HOT 1
- Better BVH
- Raytracer doesn't have throughput setup
- hello!When I finished compiling, whether I was running debug or release mode, the interface was pitch black. What was the reason? The mouse couldn't move HOT 2
- Document the code HOT 1
- Need to fix shader issue
- cannot load transparent texture HOT 1
- Camera shader info
- FreeLook is not working properly HOT 4
- camera in the shader got swaped up and front verctors
- GPU Progressive Renderer HOT 2
- No GUI
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 nerv_pathtracer.