BubbleShader

所属分类:DirextX编程
开发工具:Visual C++
文件大小:1007KB
下载次数:19
上传日期:2010-07-24 06:48:52
上 传 者mr.wyf
说明:  Directx+hlsl实现的泡泡,非常漂亮,值得仔细研究,会为你的程序添色不少
(Directx+ hlsl realization of the bubble, very beautiful, worthy of careful study, will add color to your program a lot)

文件列表:
BubbleShader\winmain.rc (5124, 2001-09-21)
BubbleShader\media\rainbowfilm_smooth.bmp (196664, 2002-06-24)
BubbleShader\media\room-dxt5.dds (393344, 2002-07-09)
BubbleShader\shaders\Bubble.psh (597, 2002-06-24)
BubbleShader\shaders\Bubble.vsh (4210, 2002-07-16)
BubbleShader\Bubble.cpp (19113, 2002-07-09)
BubbleShader\Bubble.dsp (5228, 2002-07-10)
BubbleShader\Bubble.dsw (617, 2002-06-21)
BubbleShader\Bubble.exe (356352, 2002-07-10)
BubbleShader\directx.ico (1078, 2001-07-13)
BubbleShader\resource.h (1380, 2001-09-21)
BubbleShader\framework\d3dapp.cpp (75356, 2010-06-11)
BubbleShader\framework\d3dapp.h (9179, 2001-10-31)
BubbleShader\framework\d3dfile.cpp (24189, 2001-10-31)
BubbleShader\framework\d3dfile.h (4344, 2001-10-31)
BubbleShader\framework\d3dfont.cpp (23795, 2001-10-31)
BubbleShader\framework\d3dfont.h (2487, 2001-10-31)
BubbleShader\framework\d3dres.h (1664, 2001-08-17)
BubbleShader\framework\d3dutil.cpp (23266, 2001-10-31)
BubbleShader\framework\d3dutil.h (10718, 2001-10-31)
BubbleShader\framework\dxutil.cpp (23668, 2001-10-31)
BubbleShader\framework\dxutil.h (5147, 2001-10-31)
BubbleShader\Bubble.vcproj (9208, 2010-06-11)
BubbleShader\Bubble.sln (877, 2010-06-11)
BubbleShader\Bubble.suo (9728, 2010-06-11)
BubbleShader\Bubble.vcproj.PC-201002061744.Administrator.user (1427, 2010-06-11)
BubbleShader\BubbleDebug.exe (1375744, 2010-06-11)
BubbleShader\media (0, 2002-07-22)
BubbleShader\shaders (0, 2002-07-22)
BubbleShader\framework (0, 2002-07-22)
BubbleShader (0, 2010-06-11)

//----------------------------------------------------------------------------- // Name: Bubble Sample // // Copyright (c) 2002 ATI Technologies Inc. All rights reserved. //----------------------------------------------------------------------------- Description =========== The bubble sample demonstrates the use of vertex and pixel shaders to procedurally generate a pulsating soap bubble. Rendering bubbles is an excellent candidate for vertex and pixel shaders because they are dynamic, reflective and partially transparent. Path ==== Source: source\DirectX\Bubble User's Guide ============ The following keys are implemented. The dropdown menus can be used for some of the same controls. Toggles the vertex shader

Toggles the pixel shader Starts and stops the scene Advances the scene by a small increment Prompts user to select a new rendering device or display mode Toggles between fullscreen and windowed modes Exits the app. Programming Notes ================= The Bubble sample creates a soap bubble effect by rendering a dynamically deforming sphere with a base texture and cubic environment map. The vertex shader uses four sine waves traveling in different directions over the surface of the bubble to perturb the vertex position in the direction of the normal. In order to perturb the normal, cosine waves traveling in the same four directions are used. In order to provide a consistent looking warping across vertices, the tangent and bi-normal are used to guide the direction of the sinusoidal warp. The pixel shader uses the brightly colored rainbow film map as a base texture. This texture map is meant to simulate the soap film appearance of a bubble. The environment map is modulated with this texture. The white highlights are stored in the alpha of the environment map as a glow map, and are linearly interpolated into the result. The final alpha value used for blending with the frame buffer is the fresnel term plus the glow map.


近期下载者

相关文件


收藏者