Page 1 of 1

A community driven ray tracer

Posted: Sat Feb 06, 2016 7:48 am
by Samuel
Edit:
There doesn't seem to be much interest in this topic and I want to start diving further into the ray tracer.
So for the time being I'll work on the project solo, and then maybe down the line I'll share it on the forums.
If anyone does come along and is interested in helping then you'll probably have better luck reaching me by PM.


Original Post:
Hello everyone,

I have recently started to write a ray tracer. For those of you who don't know what a ray tracer is here's a wiki page that explains what one is and how it works. The reason I want to create a ray tracer is it will be a fun side project and a good learning experience. Who knows it may even come in handy down the line for someone or even myself for that matter.

What I'd like to find out is if anyone would be interested in helping to develop it. If people are interested in helping then I have no problem making the project open source and creating a topic for it here on the forums. Things like source code location and a name for it could be decided a little later on.

A little information on how I'm planning out the ray caster is in order.
I think it would be best to use PB's Ogre implementation as a base for cameras, objects, and so on.
I also think it would be a good idea to allow straight opengl and directx too, but I think the built in 3D commands might be better as the building block. I'm open to different opinions, though.

I also don't plan on adding any modeling to this software (example blender). In other words you could only render realistic images based on the objects imported into it.
I know this seems limited compared to software like blender, but this isn't meant to be a rival software.
If someone wanted to go that route they can, but I don't think I would have the stamina for that.

Currently, the ray tracer is still pretty simple. It has the basic ray triangle system already in place, but none of the fancy rays, yet (shadows, reflections, etc). It's not optimized either, but it's a base to work off of.

So, I'd like to hear what all of you have to say about it. Think it's a good or bad idea? Are you interested in helping?
Any advice on open source project handling? Anything that anyone wants to say and I'll be all ears.

Re: A community driven ray tracer

Posted: Sat Feb 06, 2016 12:22 pm
by Kukulkan
Hi Samuel,

try searching the forum for "raytracing" and you will find some PB coded raytracer and possibly also the users who are interested ;-)

Re: A community driven ray tracer

Posted: Sat Feb 06, 2016 5:32 pm
by Samuel
Thanks for the tip. The only topic (in the english forums) that I could find that covered true ray tracing was this one. http://www.purebasic.fr/english/viewtop ... =7&t=15568

It's cool to see that someone else has attempted to work with ray tracing and PB. Portions of their code may also come in handy. They wrote some geometry ray intersection routines that I haven't written, yet.
Unfortunately, that topic was over ten years old. I'm not sure if many of those people still hang around the forums, but if they do and are interested maybe they'll see my topic.

I'll just play the waiting game for a while and see what happens.

Re: A community driven ray tracer

Posted: Wed Feb 10, 2016 8:21 pm
by applePi
Samuel, there is CodeArchiv_v4-Beta in http://www.purearea.net/pb/CodeArchiv/CodeArchiv.html
look in CodeArchiv\Graphics\Raytracing. there are two examples Raytracing_RenderMovingPlanets and Raytracing_RenderStatic , by the same author in your link Dreglor, but updated by Andre for PB v4.00. i have downloaded PB v4.00 from the museum in purebasic.com and the examples runs okay. you may find it useful especially the Raytracing_RenderMovingPlanets demo
EDIT: also look http://purebasic.fr/english/viewtopic.php?t=20244 look first example it looks interesting and runs okay in PB v4.00 just edit the first error msg to: If OpenWindow(1, 0, 0, Width, Height, "test")
it run in winxp but don't know if it will run in windows7++

Re: A community driven ray tracer

Posted: Wed Feb 10, 2016 10:12 pm
by IdeasVacuum
A very worthy project Samuel. I don't have enough spare time (or expertise) to help the code along, but I can provide sample CAD STL files.

Re: A community driven ray tracer

Posted: Thu Feb 11, 2016 8:03 pm
by Samuel
@applePi
Thanks for pointing out those examples. I'm sure portions of their code will come in handy.

@IdeasVacuum
At the moment, I only have a Stanford PLY importer, but there are several others that need to be created to allow a wider variety of models.
Looking at the STL format it doesn't seem too complicated so it should be able to be added without that much of a hassle.

I'd also like to add importers for these formats.
Collada (.dae)
Wavefront (.obj)
Ogre3D (.mesh)
DirectX (.x)

At the moment though, my to do list is pretty full with more important features. So, it may be a while before I can add any of these importers.

Re: A community driven ray tracer

Posted: Sat Feb 20, 2016 4:42 pm
by newtheogott
Instead of using your Power in a completely new project, the alternative would be to take a look into Freeware/Open Source Projects that are already on a good level and contribute your time there, for example:

Luxrender
ask "Dade" or "BYOB"
or
POV-Ray
Talk to "Clipka"

They will be happy to get new contributors that help with programming.

Take a look what you can do with it:
Note: This crystals were grown using POV-Ray.
Image
Image

Re: A community driven ray tracer

Posted: Sat Feb 20, 2016 6:02 pm
by Samuel
Those are some nice renders, but I'm not really interested in contributing. Looking at the noise in the images I'm guessing their using path tracing and for now I'm only interested in ray tracing.
Also I usually prefer starting from the beginning instead of jumping into a project midway.

Anyway thanks for bringing those projects to my attention. I'm always interested in seeing how other peoples projects grow.

Re: A community driven ray tracer

Posted: Sun Feb 21, 2016 1:22 pm
by marc_256
Hi Samuel,

I used POV-RAY for years now, and i still using it.

It is a very interesting idea,
but this is a huge work to make it work as perfection.

myself i'm a 3D designer, can give you some ideas and help you with some sources from some books I brought long time ago,
but i'm not the best 3D programmer.

what was missing in pov-ray, was a good working IDE user interface !!!
and the most important thing is speed, so maybe ASM is needed here ?

marc,

Re: A community driven ray tracer

Posted: Mon Feb 22, 2016 9:18 pm
by Samuel
Hello Marc,

Adding a decent user interface shouldn't be too much of a problem. If no one else wants to write one then I'll do it. I've had to write several from scratch before (non and hardware accelerated ones). Most important things are the workflow and look of it.

I agree with you on the speed being very important. In my opinion the one thing more important then that is the rendered image quality.
Idle was kind enough to give me some pointers on asm and help me with some of my math procedures in an unrelated project. I'll try to carry that knowledge over to this project.

If you have any ideas you want to talk about then I'm all ears. You can PM me or post them here.