Jump to content
  • Advertisement
Sign in to follow this  
Dolf

OpenGL OpenGL & Raytracing

This topic is 3763 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

Hello, I was wondering, if I'd build a raytracing in software, what would be the fastest way to get my image across? glDrawPixels on the entire screen drops my application to 300 fps. And I still want to be able to use opengl commands, because I want to offload the CPU with stuff that can be done on the GPU (primairy ray intersection for instance, and shading). My ultimate goal would be to combine software and hardware. So is there any extension that would allow me proper pixel manipulation? or should I dive into shaders? Regards, Dolf

Share this post


Link to post
Share on other sites
Advertisement
Yes, you ca use glDrawPixels and it should be good enough and fast on todays hw.

Quote:
So is there any extension that would allow me proper pixel manipulation? or should I dive into shaders?

If you want to do raytracing in the shader, then yes it is possible. There are some demoes out there.

http://www.geocities.com/vmelkon/glsl_raytracing.html
I don't have the source anymore.

http://www.humus.ca/index.php?page=3D&&start=16
Raytraced shadows

Share this post


Link to post
Share on other sites
"Yes, you ca use glDrawPixels and it should be good enough and fast on todays hw."
I didn't like the speed of that.

Thanks for the links!

Do i have to raytrace in shaders? or can i raytrace on the cpu and give it to the gpu? using a shader instead of drawpixels?

I was thinking of a hybrid between cpu and gpu, but you recommend doing all the tracing on gpu using shaders?

Share this post


Link to post
Share on other sites
Yes, raytracing can be done in shaders and there was some other guys who had done it. They were able to do more complex models instead of just planes and spheres.

What hybrid model do you have? Because glDrawPixels just renders a ready made image.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Why on earth are you complaining about 300fps?


I believe birds such as pigeons(who see somewhere between the range of 60-200 fps), who may be viewing his material may see only a slightly blurred slide show instead of the animation he requires. Wait no they wouldn't.

Share this post


Link to post
Share on other sites
Without any ray tracing done, just the pure act of sending glDrawPixels, slows me down to 300 fps.
With nothing but an empty screen I was expecting 1500, I've seen that.

About glDrawPixels:
Well, if you render in software to an array of bytes, and then send it to the GPU just to blend it in with the rasterized image.

About my model:
I'm not sure what kind of hybrid I want yet, but I will be going for a real-time implementation.

I think I'd like to leave all the things that rasterization is good at in there for the GPU, and the things the GPU sucks at (like reflections, refractions, soft shadows and maybe global illumination) I'd like to raytrace those.
And with "raytracing" I mean either on the CPU or on the GPU, whatever turns out to be the best.

Edit: I just found out about "render to texture", maybe that would be faster than drawpixels?
Edit again: Or maybe there is a way to get direct access to the framebuffer?

[Edited by - Dolf on March 23, 2008 2:40:54 PM]

Share this post


Link to post
Share on other sites
The GL driver is tuned to execute a certain amount of commands and in the general area of 60 to 100FPS.
300 FPS is meaningless.

Someone needs to write an article on this so that people understand that they must render a lot of stuff and then worry about benchmarking.

Share this post


Link to post
Share on other sites
My point is, I've seen it with 1500 fps in some direct 3d application.

How do i get that same result in opengl? I'm not saying "it's too slow" , i am saying "it's slower than it can be".

Share this post


Link to post
Share on other sites
Quote:
Original post by Dolf
My point is, I've seen it with 1500 fps in some direct 3d application.

How do i get that same result in opengl? I'm not saying "it's too slow" , i am saying "it's slower than it can be".
I'm not an OpenGL person, so this won't be that helpful, but drawing individual pixels is bound to be slow. For a 320x200 screen, you'd be drawing 64,000 individual pixels. In D3D, you'd fill a texture with pixel data, then upload that in one go to the graphics card.

I imagine doing something similar in OGL would give you better performance.

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!