基于GeometryShader的仿真布匹模拟
I. Introduction
原型:NVIDIA Direct3D SDK 10中cloth例子,Nvidia Direct3D SDK9 中有基于pixelShader的版本。
II. Body Paragraph
完整支持GeometryShader和StreamOutput技术需OpenGL3
其他则需要扩展支持
GL_EXT_geometry_shader4 is available on nVidia Gf 8 series and up. Gf 8 is a SM 4.0 GPU
With ATI/AMD, all the Radeons with a HD in their name are SM 4.0 GPUs but their drivers did not support GS.
On June 10, 2009, Catalyst 9.6 gets released and supports various new extensions including GS
http://www.geeks3d.com/20090610/ati-catalyst-96-beta-a-stack-of-new-opengl-extensions
GLSL 1.2 version : (G80) GL_ARB_geometry_shader4, GL_EXT_gpu_shader4, GL_EXT_bindable_uniform
(# 針對所有GeForce 8系列和更高階的GPU提供OpenGL 3.3的支援。)
(# 在GeForce 400系列和更高階的GPU平台上支援OpenGL 4.1。 )
GTS450 支持 GL_ARB_geometry_shader4, GL_ARB_transform_feedback2/3, GL_NV_transform_feedback[2]
但不支持 GL_EXT_transform_feedback。即NV显卡采用GL_NV_Transform_feedback扩展,而ATI显卡采用GL_EXT_Transform_Feedback扩展
需要改变GS inputType的shader需单独作为一个j3md文件,因updateShaderData只在初始化时设置inputType及outputType
GS阶段所采用的IndexBuffer将影响streamOutput的target VBO中的顶点次序!
现阶段多个springPass之间不协调的原因在于distanceAtRestVB和batchTypeVB并没有随着positionVB的位置调整而调整!!!!!!!!!
若采用位运算方式的话(GL_ARB_shader_bit_encoding),batchTypeVB的方式倒是可以解决,但distanceAtRestVB无法解决!
决定:采取IndexBuffer类似的方式,手动挪移batchTypeVB和distanceAtRestVB中位置顺序(正确!!)
原本DX例子中distance信息是固定的,而粒子间的连接关系和批次关系是存在粒子的“a”通道中,通过位运算来进行判断
Use the quotation citing feature from the Style menu or by using keyboard shortcut Ctrl+Alt+B.
1) Enter subtitles like this
III. Conclusion
Write the conclusion for your report.
References
具体代码见115网盘:GeometryShader.rar
浙公网安备 33010602011771号