Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a 3D scene format specific or well-suited for raytracing?

I'm working on a raytracer and I don't want reinvent the wheel when it comes to file formats for 3D scenes. I also want to be able to test my program with scenes made by others. I'm a programmer not a 3D modeller.

Is there a 3D scene format specific or well-suited for raytracing?

like image 772
Jan Deinhard Avatar asked Jan 19 '11 12:01

Jan Deinhard


People also ask

Is ray tracing rasterized?

The Fundamentals: Ray Tracing Versus Rasterization Rasterization is an object-based approach to scene rendering. Each object is painted with color first, then logic is applied to show only the pixels that are closest to the eye. By contrast, ray tracing colors the pixels first, then identifies them with objects later.

What is Monte Carlo ray tracing?

Monte Carlo ray tracing (MCRT) is a fundamental simulation method for central receiver systems(CRSs). MCRT is an effective method to describe the radiative flux distribution on the receiver surface reflected by either a single heliostat or all heliostats in a heliostat field.

Why should you consider to perform ray tracing accurately?

Ray tracing makes it possible to determine the quality of the rendered image for image-forming systems, the distribution of light for illuminations systems, and much more.


2 Answers

When I wrote my ray tracer, I wrote an exporter for Blender (it's free). Blender itself can load dozens of formats, then a simple 20 line python script will give you the points you need.

The super nice feature is that within Blender you can convert all the model's faces to triangles. Most ray tracers will only work with triangles (or convert polygons to triangles internally). So having Blender do the heavy work of crunching those polygons is super nice.

To start with 20 lines of code will allow you to export just the polygons. From there, you can extend it to output materials, normals, etc. I like this method, because I can get the data I want in the format I want, but still have the option of importing more complex models.

Other methods will work, but you first have to figure out how to parse a file, then get it in the format you want. I'd rather code a ray tracer than a parser.

like image 123
Timothy Baldridge Avatar answered Oct 23 '22 05:10

Timothy Baldridge


There really isn't a format specific to ray tracing (unless you count PovRay format). Ray tracing is a method of rendering images, which can be applied to any scene. People modeling scenes will be using the modeling software of their choice and save usually in the default format of the modeler.

It looks like you don't have any requirements to load a particular format (or you wouldn't be asking) so I'm guessing you just want to be able to import various geometry from around the net for testing. If that's the case, check out the ompf forum at: http://ompf.org/ They have a section with links to freely available scenes. You can get a feel for what's common there.

Another option is utilize the Open Asset Import Library: http://assimp.sourceforge.net/

this can import a large number of file formats for you. It loads them all into an internal data structure, which you can then process as you see fit. It uses a BSD license so it should be reasonably license compatible with whatever you're doing.

like image 35
phkahler Avatar answered Oct 23 '22 05:10

phkahler