Archived

This topic is now archived and is closed to further replies.

Deferred shading

This topic is 5145 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 have found this technique recently and I want to know if is possible to do per pixel lighting with it in OpenGL at older graphic card Radeon 7000? If so, can u briefly explain the algoritm or give me some links? thx a lot

Share this post


Link to post
Share on other sites
u really can''t with older hardware, but you can still kind of faked it. I wrote a basic diffuse lighting using combiners (ARB_ENV_COMBINE) on a radeon 7500 mobility (i only used normals in the computations hence it wasn''t correct but gave a rough idea of the algorith). Process, use a VP to output normals to color buffer, where range [-1,1] is mapped [0, 1].. (so the background should be 0.5). set the constant value for the combine to the light vector (also between range [0,1]). Then use DP3 To combine the constant color(light vector) with the colorBuffer(normals), modulate this with the unlit image. It''s really not the best or correct way, but it was a nice excerise to get a hang of the tecnique.

You can store the normals using standard 32 bit color buffer, but For correct lighting you need to put world space positions of your geometry into a floating point colorbuffer (this would imply using a floating point buffer). There are some other things to worry about too, if you want to add differed specular lighting or differed bump mapping. Generally I converted everything into world space. It took me a few passes of the geometry to do the agorithm on my ati 9600. The following extensions are required for the algorithm ARB_FP, ARB_VP, ATI_texture_float, ATI_draw_buffers(not really needed but it can reduce the number or geometry rendering passes), WGL_ATI_pixel_format_float, WGL_ARB_render_texture, WGL_ARB_pbuffer. With the ati card the colorbuffer only had two channels(front and back), if it had four( frontright, frontback, backleft, backright). The generation of the normal, worldposition, specular..etc buffers could be done in one geometry pass. The nice thing about this technique is that it only needs one geometry pass for N lights (But it requires ~N combination passes, though this can be reduced). This this techinque is limited by the fill rate. I''ll see what i can dig up when i get home, but i haven''t worked on this differed lighting stuff in quite a while so this message was stuff from memory, so sorry if it''s a bit rought.

Share this post


Link to post
Share on other sites
It''s pretty straight forward algorithm, provided you have the hardware In the end, I really dont know if its that much of an advantage(in terms of speed) compared to standard Per-pixel lighting, but i do feel its can offer a bit more flexible than the standard approach.

Articles:

http://www.delphi3d.net/articles/viewarticle.php?article=deferred.htm

http://www.beyond3d.com/articles/deflight/

Share this post


Link to post
Share on other sites