Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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: 120

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: 1412

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: 307

Like
0Likes
Like

Posted 10 December 2012 - 09:08 AM

Pure OpenGL

#4 swiftcoder   Senior Moderators   -  Reputation: 10399

Like
0Likes
Like

Posted 10 December 2012 - 09:24 AM

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

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#5 313230   Members   -  Reputation: 120

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: 10399

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 - Software Engineer @Amazon - [swiftcoding]


#7 313230   Members   -  Reputation: 120

Like
0Likes
Like

Posted 10 December 2012 - 10:47 AM

Many thanks

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

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   Crossbones+   -  Reputation: 3167

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

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer





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