Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Best way to draw ray tracing image to screen?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 313230   Members   -  Reputation: 117

Like
0Likes
Like

Posted 10 December 2012 - 03:41 AM

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

Sponsor:

#2 Yrjö P.   Crossbones+   -  Reputation: 1064

Like
0Likes
Like

Posted 10 December 2012 - 07:57 AM

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

#3 J. Evola's Apprentice   Members   -  Reputation: 311

Like
0Likes
Like

Posted 10 December 2012 - 09:08 AM

Pure OpenGL

#4 swiftcoder   Senior Moderators   -  Reputation: 4743

Like
0Likes
Like

Posted 10 December 2012 - 09:24 AM

Those are both arbitrarily complicated options. Look at Pixel Toaster, instead.

Tristam MacDonald - SDE @ Amazon - swiftcoding        [Need to sync your files via the cloud? | Need affordable web hosting?]


#5 313230   Members   -  Reputation: 117

Like
0Likes
Like

Posted 10 December 2012 - 10:38 AM

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

#6 swiftcoder   Senior Moderators   -  Reputation: 4743

Like
1Likes
Like

Posted 10 December 2012 - 10:41 AM

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...)

Tristam MacDonald - SDE @ Amazon - swiftcoding        [Need to sync your files via the cloud? | Need affordable web hosting?]


#7 313230   Members   -  Reputation: 117

Like
0Likes
Like

Posted 10 December 2012 - 10:47 AM

Many thanks

#8 Yrjö P.   Crossbones+   -  Reputation: 1064

Like
1Likes
Like

Posted 10 December 2012 - 01:06 PM

Those are both arbitrarily complicated options. Look at Pixel Toaster, instead.

Eh, all of them are piss easy to get started with. Pixel Toaster doesn't have much advantage there.

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.

Edited by Stroppy Katamari, 10 December 2012 - 01:07 PM.


#9 3Ddreamer   Members   -  Reputation: 1414

Like
0Likes
Like

Posted 10 December 2012 - 02:29 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS