Hi everyone,
I am learning ray tracing and there is a very good tutorial here:
http://www.codermind.com/articles/Raytracer-in-C++-Introduction-What-is-ray-tracing.html
But the problem is that it doesn't display image to the screen, instead it creates a texture image which can not be viewed.
I need a way to display to the screen in real time, I don't know about image format, so I want to ask what is the simplest way to display 2D array of pixels to screen? I want to use 2D array because I want to edit each pixel
Regards
Best way to draw ray tracing image to screen?
Based on that tutorial I presume you are using C++.
You need to use any of the zillion drawing libraries that are available.
I'd go with SFML. After you have the library set up on your computer, look here for how to initialize a SFML image with your own pixel array and draw:
http://en.sfml-dev.org/forums/index.php?topic=3543.0
You need to use any of the zillion drawing libraries that are available.
I'd go with SFML. After you have the library set up on your computer, look here for how to initialize a SFML image with your own pixel array and draw:
http://en.sfml-dev.org/forums/index.php?topic=3543.0
Thank you all, I will try.
Well, and I don't mind complicated thing if it is fast. And so, I would want to ask, normally what solution you guys or commercial ray tracing software use to display image? I know that ray tracing is slow but a fast display method is always preferred
Regards
Well, and I don't mind complicated thing if it is fast. And so, I would want to ask, normally what solution you guys or commercial ray tracing software use to display image? I know that ray tracing is slow but a fast display method is always preferred
Regards
I know that ray tracing is slow but a fast display method is always preferred
Ray tracing is so slow, that any method will work. Pixel toaster will happily push 60 fps images to the screen, if you can fill them that fast. (as will pretty much any other windowing toolkit: SFML, SDL, your own OpenGl context...)
Eh, all of them are piss easy to get started with. Pixel Toaster doesn't have much advantage there.
Those are both arbitrarily complicated options. Look at Pixel Toaster, instead.
His raytracer may not need more from the framework/library than the ability to tweak single pixels, but being able to easily draw primitives, render text, etc. could be a big boon for various kinds of debugging, creating live previews, etc. Just yesterday I finished building a small raytracer for a school assignment, and I could definitely have used all of that stuff. I think 80% of my time went to tracking down bugs.
Yeah, it is worth learning and using some ray tracing, but be careful about major performance decline with it which is very challenging to avoid.
Clinton
Clinton
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement