fMultiTextures.dfm 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. object FormMultiSampleTextures: TFormMultiSampleTextures
  2. Left = 404
  3. Top = 280
  4. Caption = 'Multisample Texture'
  5. ClientHeight = 378
  6. ClientWidth = 605
  7. Color = clBtnFace
  8. Font.Charset = DEFAULT_CHARSET
  9. Font.Color = clWindowText
  10. Font.Height = -11
  11. Font.Name = 'Tahoma'
  12. Font.Style = []
  13. OldCreateOrder = False
  14. Position = poScreenCenter
  15. OnCreate = FormCreate
  16. OnResize = FormResize
  17. PixelsPerInch = 96
  18. TextHeight = 13
  19. object MainViewer: TGLSceneViewer
  20. Left = 0
  21. Top = 0
  22. Width = 605
  23. Height = 378
  24. Camera = MainCamera
  25. BeforeRender = MainViewerBeforeRender
  26. Buffer.FogEnvironment.FogStart = 10.000000000000000000
  27. Buffer.FogEnvironment.FogEnd = 100.000000000000000000
  28. Buffer.BackgroundColor = clGray
  29. FieldOfView = 129.073303222656300000
  30. PenAsTouch = False
  31. Align = alClient
  32. TabOrder = 0
  33. end
  34. object MainScene: TGLScene
  35. Left = 24
  36. Top = 8
  37. object MainCamera: TGLCamera
  38. DepthOfView = 1024.000000000000000000
  39. FocalLength = 90.000000000000000000
  40. NearPlaneBias = 0.001000000047497451
  41. TargetObject = SceneObjects
  42. Position.Coordinates = {0000204100002041000020410000803F}
  43. object TestLight: TGLLightSource
  44. ConstAttenuation = 1.000000000000000000
  45. SpotCutOff = 180.000000000000000000
  46. end
  47. end
  48. object FBOContainer: TGLDummyCube
  49. CubeSize = 1.000000000000000000
  50. object MultisampleFBO: TGLFBORenderer
  51. ColorTextureName = 'MultisampledColor'
  52. DepthTextureName = 'Depth'
  53. MaterialLibrary = MainMaterialLibrary
  54. ClearOptions = [coColorBufferClear, coDepthBufferClear, coUseBufferBackground]
  55. Camera = MainCamera
  56. RootObject = SceneObjects
  57. TargetVisibility = tvFBOOnly
  58. EnabledRenderBuffers = []
  59. end
  60. end
  61. object SceneObjects: TGLDummyCube
  62. CubeSize = 1.000000000000000000
  63. object GLSphere1: TGLSphere
  64. Material.FrontProperties.Diffuse.Color = {0000000000000000000000000000803F}
  65. Material.PolygonMode = pmLines
  66. Radius = 4.000000000000000000
  67. end
  68. object GLTorus1: TGLTorus
  69. Material.FrontProperties.Diffuse.Color = {C6BF3F3FDCD8583FDCD8583F0000803F}
  70. Direction.Coordinates = {000000000000803F0000000000000000}
  71. Up.Coordinates = {030080A700000000000080BF00000000}
  72. MajorRadius = 3.000000000000000000
  73. MinorRadius = 0.600000023841857900
  74. Sides = 32
  75. StopAngle = 360.000000000000000000
  76. Parts = [toSides, toStartDisk, toStopDisk]
  77. end
  78. object GLTorus2: TGLTorus
  79. Material.FrontProperties.Diffuse.Color = {C6BF3F3FDCD8583FDCD8583F0000803F}
  80. MajorRadius = 3.000000000000000000
  81. MinorRadius = 0.600000023841857900
  82. Sides = 32
  83. StopAngle = 360.000000000000000000
  84. Parts = [toSides, toStartDisk, toStopDisk]
  85. end
  86. object GLCone1: TGLCone
  87. Material.FrontProperties.Diffuse.Color = {E4DB5B3FEBE0E03EE4DB5B3F0000803F}
  88. Direction.Coordinates = {000000000000803F0000000000000000}
  89. Position.Coordinates = {CDCC4C3E00000000CDCC4C3E0000803F}
  90. Up.Coordinates = {0000000000000000000080BF00000000}
  91. BottomRadius = 0.500000000000000000
  92. Height = 5.000000000000000000
  93. end
  94. object GLLines1: TGLLines
  95. AntiAliased = True
  96. LineColor.Color = {EBE0E03EE4DB5B3F9A93133F0000803F}
  97. LinePattern = 255
  98. LineWidth = 5.000000000000000000
  99. Nodes = <
  100. item
  101. X = 6.000000000000000000
  102. end
  103. item
  104. Z = 6.000000000000000000
  105. end
  106. item
  107. X = -6.000000000000000000
  108. end
  109. item
  110. Z = -6.000000000000000000
  111. end
  112. item
  113. X = 6.000000000000000000
  114. end>
  115. Options = []
  116. end
  117. end
  118. object GLScreenQuad: TGLHUDSprite
  119. Material.MaterialLibrary = MainMaterialLibrary
  120. Material.LibMaterialName = 'Result'
  121. Rotation = 0.000000000000000000
  122. end
  123. object GLHUDText1: TGLHUDText
  124. BitmapFont = GLWindowsBitmapFont1
  125. Rotation = 0.000000000000000000
  126. end
  127. end
  128. object MainCadencer: TGLCadencer
  129. Scene = MainScene
  130. OnProgress = MainCadencerProgress
  131. Left = 192
  132. Top = 8
  133. end
  134. object MainMaterialLibrary: TGLMaterialLibrary
  135. Materials = <
  136. item
  137. Name = 'MultisampledColor'
  138. Tag = 0
  139. Material.Texture.ImageClassName = 'TGLBlankImage'
  140. Material.Texture.Image.ColorFormat = 6408
  141. Material.Texture.Disabled = False
  142. end
  143. item
  144. Name = 'Depth'
  145. Tag = 0
  146. Material.Texture.ImageClassName = 'TGLBlankImage'
  147. Material.Texture.Image.ColorFormat = 6408
  148. Material.Texture.TextureFormat = tfExtended
  149. Material.Texture.TextureFormatEx = tfDEPTH_COMPONENT32
  150. Material.Texture.Disabled = False
  151. end
  152. item
  153. Name = 'Result'
  154. Tag = 0
  155. Shader = GLSLShader1
  156. end>
  157. Left = 104
  158. Top = 8
  159. end
  160. object GLSLShader1: TGLSLShader
  161. Enabled = False
  162. FragmentProgram.Code.Strings = (
  163. '#version 150'
  164. '#define SamplesCount 4'
  165. ''
  166. 'in vec4 TexCoord;'
  167. 'out vec4 color;'
  168. 'uniform sampler2DMS TexUnit0;'
  169. 'uniform vec2 ViewerSize;'
  170. ''
  171. 'void main()'
  172. '{'
  173. #9'vec4 final = vec4(0.0, 0.0, 0.0, 0.0);'
  174. #9'int i;'
  175. #9'for (i=0; i<SamplesCount; i++)'
  176. #9'{'#9
  177. #9#9'vec4 sample = texelFetch(TexUnit0, ivec2(ViewerSize* TexCoord.' +
  178. 'xy), i);'
  179. #9#9'final += sample;'
  180. #9'}'
  181. #9'color = final / SamplesCount;'
  182. '}')
  183. FragmentProgram.Enabled = True
  184. VertexProgram.Code.Strings = (
  185. '#version 150'
  186. ''
  187. 'in vec4 FTransform;'
  188. 'out vec4 TexCoord;'
  189. ''
  190. 'void main()'
  191. '{'
  192. #9'gl_Position = FTransform;'
  193. #9'TexCoord = FTransform * 0.5 + 0.5;'
  194. '}')
  195. VertexProgram.Enabled = True
  196. OnApply = GLSLShader1Apply
  197. Left = 24
  198. Top = 120
  199. end
  200. object GLSimpleNavigation1: TGLSimpleNavigation
  201. Form = Owner
  202. GLSceneViewer = MainViewer
  203. FormCaption = 'Multisample Texture - %FPS'
  204. KeyCombinations = <
  205. item
  206. ShiftState = [ssLeft, ssRight]
  207. Action = snaZoom
  208. end
  209. item
  210. ShiftState = [ssLeft]
  211. Action = snaMoveAroundTarget
  212. end
  213. item
  214. ShiftState = [ssRight]
  215. Action = snaMoveAroundTarget
  216. end>
  217. Left = 24
  218. Top = 64
  219. end
  220. object GLWindowsBitmapFont1: TGLWindowsBitmapFont
  221. Font.Charset = DEFAULT_CHARSET
  222. Font.Color = clWhite
  223. Font.Height = -11
  224. Font.Name = 'MS Sans Serif'
  225. Font.Style = []
  226. Left = 104
  227. Top = 64
  228. end
  229. end