Ray tracing help

I was just wondering how I'd go about sending a ray to every viewable pixel besides that I know what to do.

Ray tracing is a different type of rendering.  Not sure how it applies to jME?  Maybe a shader based solution is what you are looking for?

I was thinking of that and found an article on it http://gpurt.sourceforge.net/DA07_0405_Ray_Tracing_on_GPU-1.0.5.pdf haven’t gotten around to reading it i’ll do that tonight.

on page 21 of that link i posted it talks about making a uniform grid and I was wondering if i could get some help understanding and putting it to jme



5.1.1. Creating the Uniform Grid
A simple approach can be used to create the uniform grid.
For all triangles Ti in the scene:

1. Calculate the bounding cells (b1, b2) of Triangle Ti

2. Test triangle-box intersection: Ti with every cell Cj 2 (b1, b2)

3. If triangle-box intersection returned true, add a reference of Ti to Cj.

The uniform grid is generated on CPU and stored in textures. This restricts the
current implementation rendering static scenes only. We will learn more about
storing data in textures in section 5.3.

guess i could just make a bunch of smaller bounding boxes inside a exsisting bounding box and use the intersepcts with a ray and do most of the work on the cpu which whould lower the render time alot because the cpu runs at a much higher clock speed but i'll have to bench to see it i'd benifit from it at all.

is there anyway to get the 4 points of a bounding box otherwise my plan is a flop. 

bounding boxes have 8 points… but you can figure them out by adding and subtracting the extents from the center.

alrite thanks  wanna post how just to save me some time

See Box.computeVertices

so i can't use bounding volume it's not a big deal i still have the ray intersection test.  Also from the 8 points returned from box.computeVertices are there 8 verts because the box is rendered in triangles?

Also how can i get the exsisting bounding info or do i just do setModelBound(new Box()); then get the get the 8 points and just sub-divide.

No, no, no…



he was saying look at the source for Box.computeVertices. This will give you the source to calculate the 8 points from BoundingBox.

ohh ok

alrite thats step one is calculate a bounding cell for triangle T(i) so i just subdivied the uniform grid intill it matches the number of triangles?