defshad

所属分类:图形图像处理
开发工具:Visual C++
文件大小:387KB
下载次数:4
上传日期:2010-12-17 14:40:39
上 传 者sunup2001
说明:  延时渲染,首先准备N个与屏幕同大小的纹理作为渲染缓冲区,接下来向这个纹理渲染东西,一般用FBO,渲染的时候,把每个象素最终的法线值、位置、纹理信息分别渲染到这N个纹理中。这是第一次渲染。然后第二次渲染的时候,把之前得到的纹理中的值作为光照计算的输入值来计算光照。
(Delay rendering, the first screen for N-and render the same size as a buffer texture, the next thing to render the texture, the general use of FBO, render time, the normal end of each pixel value, position, texture information N, respectively, rendering a texture to this. This is the first rendering. Then, when the second rendering, the texture before the value obtained by calculating the input value as a light to calculate the light.)

文件列表:
Deferred Shading (0, 2006-08-29)
Deferred Shading\Bitmap Font (0, 2006-08-29)
Deferred Shading\Bitmap Font\BITMAP_FONT.cpp (2889, 2006-08-29)
Deferred Shading\Bitmap Font\BITMAP_FONT.h (953, 2006-08-29)
Deferred Shading\CIRCULAR_PATH.cpp (1692, 2006-08-29)
Deferred Shading\CIRCULAR_PATH.h (1173, 2006-08-29)
Deferred Shading\Deferred Shading.exe (368640, 2006-08-29)
Deferred Shading\DeferredShadingPass1FP.txt (628, 2006-08-29)
Deferred Shading\DeferredShadingPass1VP.txt (576, 2006-08-29)
Deferred Shading\DeferredShadingPass2FP.txt (933, 2006-08-29)
Deferred Shading\Extensions (0, 2006-08-29)
Deferred Shading\Fps Counter (0, 2006-08-29)
Deferred Shading\Fps Counter\FPS_COUNTER.cpp (973, 2006-08-29)
Deferred Shading\Fps Counter\FPS_COUNTER.h (825, 2006-08-29)
Deferred Shading\GL files (0, 2006-08-29)
Deferred Shading\GL files\extensionList.txt (8371, 2006-08-29)
Deferred Shading\GL files\GLee.c (668766, 2006-08-29)
Deferred Shading\GL files\GLee.h (559562, 2006-08-29)
Deferred Shading\GL files\LoadProgram.cpp (2558, 2006-08-29)
Deferred Shading\GL files\LoadProgram.h (625, 2006-08-29)
Deferred Shading\Image (0, 2006-08-29)
Deferred Shading\Image\IMAGE.h (2247, 2006-08-29)
Deferred Shading\Image\IMAGE_CalculateStride.cpp (1322, 2006-08-29)
Deferred Shading\Image\IMAGE_ExpandPalette.cpp (1790, 2006-08-29)
Deferred Shading\Image\IMAGE_Load.cpp (1573, 2006-08-29)
Deferred Shading\Image\IMAGE_Load24BitBMP.cpp (2536, 2006-08-29)
Deferred Shading\Image\IMAGE_Load8BitBMP.cpp (3160, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadAlpha.cpp (2126, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadBMP.cpp (1638, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadCompressedTrueColorTGA.cpp (4854, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadTGA.cpp (1978, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadUncompressed8BitTGA.cpp (3307, 2006-08-29)
Deferred Shading\Image\IMAGE_LoadUncompressedTrueColorTGA.cpp (2890, 2006-08-29)
Deferred Shading\License.txt (2877, 2006-08-29)
Deferred Shading\light.tga (9877, 2006-08-29)
Deferred Shading\LOG (0, 2006-08-29)
Deferred Shading\LOG\LOG.cpp (2487, 2006-08-29)
Deferred Shading\LOG\LOG.h (1382, 2006-08-29)
Deferred Shading\Main.cpp (21079, 2006-08-29)
... ...

************************************************************************** ** Deferred Shading ** ** www.paulsprojects.net ** ** paul@paulsprojects.net ************************************************************************** Description: This project displays a torus knot lit by 8 point lights. The lights are diffuse only, and their contributions to the scene(including attenuation) are calculated per pixel using fragment programs. This is done in two ways. In the "standard" shading method, a first pass is made to set the depth buffer to hold the depth of the nearest fragment. Then the mesh is drawn once per light, and each time, the lighting contribution is added to the framebuffer. The scissor test is used to restrict drawing to a small window rectangle containing the projection of the sphere of influence of the light. This project's main feature however, is the "deferred" shading method. Here, the mesh is drawn once and the positions and normals at each fragment are saved into a floating point buffer. Then, for each light, this buffer is used as a texture and a flat quad is drawn covering the sphere of influence of each light. A fragment program unpacks the values from the buffer and, using the light's position, color etc as parameters, evaluates the lighting equation and adds it to the framebuffer. The advantage of the deferred shading approach is that the mesh (32000 vertices) need only be drawn once. Requirements: ARB_fragment_program ARB_vertex_buffer_object ARB_vertex_program NV_float_buffer NV_fragment_program NV_texture_rectangle WGL_ARB_extensions_string WGL_ARB_pbuffer WGL_ARB_pixel_format References: "Deferred Shading", Tom Nuydens. From http://www.delphi3d.net/articles/viewarticle.php?article=deferred.htm Keys: F1 - Take a screenshot Escape - Quit 1 - Use deferred shading method 2 - Use standard shading method P - Pause U - Unpause

近期下载者

相关文件


收藏者