Jump to content
  • Advertisement
Sign in to follow this  
Geometrian

OpenGL Fundamental Python Ray-Tracer

This topic is 3786 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Before you make any judgements: I'm going to try to make a ray-tracer without OpenGL. It will use only Python and Pygame. The idea is that the rays will be rendered to a Pygame surface and then the surface will be drawn. Again, no OpenGL, so no, this is not a graphics question. I have made a basic raytracer, just by sitting down and coding it. It renders as many objects (I've only got spheres) as you want, but it is very slow and it only does basic colors. As of yet, there are no shadows, reflections, refractions, lights, anti-aliasing, etc. These are, of course, the things which most attract me about ray-tracing, so they must be added now. As far as code goes, I get the feeling I'm doing it all wrong. So, I'm looking for a basic ray-tracer's code, in Python, which can render polygons, (triangles and/or quads) with shadows and color. After that, I think I can figure out how to do reflections, refractions, and anti-aliasing. Thanks, Geometrian

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Geometrian
Again, no OpenGL, so no, this is not a graphics question.
Of course it is a graphics question. OpenGL is just one option for hardware acceleration of graphics and vector processing in general. Moved.

Share this post


Link to post
Share on other sites
Quote:
Original post by Geometrian
Hi,

Before you make any judgements:
I'm going to try to make a ray-tracer without OpenGL.


Why do you think OpenGL should be a standard tool when dealing with raytracing? Actually, OpenGL has nothing to do with raytracing the 90% of the cases: the only two exceptions that come to my mind are using textures as target for the raytracing and then using OpenGL to show that texture, and experimenting a bit with raytracing on the graphic board. These cases aside, I don't see how OpenGL relates with raytracing...

Quote:

I have made a basic raytracer, just by sitting down and coding it. It renders as many objects (I've only got spheres) as you want, but it is very slow and it only does basic colors.


Depending upon which were your expectations, what you see is truly slow or simply what you get given the algorithm you choose. Compared with rasterization on graphic hardware sw raytracing is several times slower. In addition, python is not really what I would consider the best tool for this job, although nothing prevent from doing it (and they already did it).

Share this post


Link to post
Share on other sites
Quote:
Original post by thedustbustr
googled for 2 seconds and found this and this (spanish link)
hmmmm. The link works, but the file seems to be corrupted.


Quote:
Original post by cignox1Why do you think OpenGL should be a standard tool when dealing with raytracing? Actually, OpenGL has nothing to do with raytracing the 90% of the cases: the only two exceptions that come to my mind are using textures as target for the raytracing and then using OpenGL to show that texture, and experimenting a bit with raytracing on the graphic board. These cases aside, I don't see how OpenGL relates with raytracing...
I wasn't sure, and I didn't want people to make assumptions.
Quote:
Depending upon which were your expectations, what you see is truly slow or simply what you get given the algorithm you choose. Compared with rasterization on graphic hardware sw raytracing is several times slower. In addition, python is not really what I would consider the best tool for this job, although nothing prevent from doing it (and they already did it).
That's fine. I can do optimisations later. I realise that it will almost certainly not be realtime or anything. The goal here is to make something as realistic as possible. I'll start with basic scene renderings and work up to shadows and reflections.

Share this post


Link to post
Share on other sites
Quote:
googled for 2 seconds and found this and this (spanish link)
hmmmm. The link works, but the file seems to be corrupted.
Quote:
Why do you think OpenGL should be a standard tool when dealing with raytracing? Actually, OpenGL has nothing to do with raytracing the 90% of the cases: the only two exceptions that come to my mind are using textures as target for the raytracing and then using OpenGL to show that texture, and experimenting a bit with raytracing on the graphic board. These cases aside, I don't see how OpenGL relates with raytracing...
I wasn't sure, and I didn't want people to make assumptions.
Quote:
Depending upon which were your expectations, what you see is truly slow or simply what you get given the algorithm you choose. Compared with rasterization on graphic hardware sw raytracing is several times slower. In addition, python is not really what I would consider the best tool for this job, although nothing prevent from doing it (and they already did it).
That's fine. I can do optimisations later. I realise that it will almost certainly not be realtime or anything. The goal here is to make something as realistic as possible. I'll start with basic scene renderings and work up to shadows and reflections.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!