gluUnProject & ray together
hello
What do you think about my idea?
i write raytracer, so i need to find ray direction for point (x,y).
My plan is
a) use gluUnProject to obtain v= (x'', y'', z'') coordinates for (x, y)
b) create ray vector direction ( v - eye )
c) v.Normalize()
So, send me some suggests, If you know that will not work, TELL ME!
lekki
What some ray-tracers do in order to optimize "first ray intersection" is to render the whole scene to depth buffer, then fetch from it z values and some id of hit triangle - this way you know what each "screen pixel ray" intersects first.
This doesn't work however with objects like spheres, b-splines etc...
Also, this method won't speed up second or higher intersection.
What you are proposing could work, but is rather not wise idea, since gluUnProject costs a lot.
[edited by - MickeyMouse on April 6, 2004 5:31:02 AM]
This doesn't work however with objects like spheres, b-splines etc...
Also, this method won't speed up second or higher intersection.
What you are proposing could work, but is rather not wise idea, since gluUnProject costs a lot.
[edited by - MickeyMouse on April 6, 2004 5:31:02 AM]
Hi
I dont want to use glUnProject after gl raytracing, i need it before to calculate camera and world setting. I wrote my own intersection.
lekki
I dont want to use glUnProject after gl raytracing, i need it before to calculate camera and world setting. I wrote my own intersection.
lekki
It''s still not best idea to make OpenGL handle your matrices (in OpenGL pojection and modelview ones) but do the whole remaining thing on your own. You better do it all by yourself. OpenGL won''t speed you up at all that case anyway.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement