Giter Site home page Giter Site logo

space_partitioning_octree_bvh's Introduction

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
AUTHOR: Thomas Diewald

Date:        07.02.2013
last edited: 07.02.2013

author:     www.thomasdiewald.com
blog-post:  www.thomasdiewald.com/blog/?p=1488
source:     www.github.com/diwi/Space_Partitioning_Octree_BVH
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------



################################################################################
--------------------------------------------------------------------------------
Space Partitioning: Octree vs. BVH
--------------------------------------------------------------------------------
################################################################################

source code of my first experiments with space-partitioning techniques: 

 - Octree
 - BVH

 
it was a study to compare performance and usage for raytracing/pathtracing.
most important for me was the traversing-performance for ray-triangle-intersection,
which i needed for the opencl-implementation.
in the end i decided to use the BVH for that, and so the octree functionality 
might be not that "perfect".

a lot of things should/could be improved during building the data-structure.
at the moment it is way to slow for dynamic changes in the scene.
if you notice any errors, feel free to contact me.


for more information, i'd like to refer to my blog-post:
http://thomasdiewald.com/blog/?p=1488

thomas

space_partitioning_octree_bvh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

space_partitioning_octree_bvh's Issues

Comparison method violates its general contract!

java 1.7 throws this exception:

> start building

Exception in thread "Animation Thread" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:747)
at java.util.TimSort.mergeAt(TimSort.java:483)
at java.util.TimSort.mergeCollapse(TimSort.java:410)
at java.util.TimSort.sort(TimSort.java:214)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at DwBVH.BvhBuilder.subdivide(BvhBuilder.java:87)
at DwBVH.BvhBuilder.subdivide(BvhBuilder.java:122)
at DwBVH.BvhBuilder.subdivide(BvhBuilder.java:122)
at DwBVH.BvhBuilder.subdivide(BvhBuilder.java:121)
at DwBVH.BvhBuilder.subdivide(BvhBuilder.java:121)
at DwBVH.BvhBuilder.BUILD_defaultRoutine(BvhBuilder.java:66)
at DwBVH.Bvh.BUILD_defaultRoutine(Bvh.java:62)
at SpacePartitioning.MAIN_bvh_octree_demo.setup(MAIN_bvh_octree_demo.java:144)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:744)

Selection bug

Great project! However, there is a small bug: If you create a BVH with only one face and select it with the mouse, then an exception is thrown. The problem is this line:

this.stack = new BvhTraversalData[bvh.getMaxDepth()*2];

A tree with only a root node has a max depth of 0 => the stack has a size of 0. A fix would be to make the stack slightly bigger:

this.stack = new BvhTraversalData[bvh.getMaxDepth()*2 + 1];

How to compile

How do you use this code, from within Processing, or just javac at the CLI?

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.