Unit1.dfm 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. object Form1: TForm1
  2. Left = 0
  3. Top = 0
  4. Caption = 'Shadows'
  5. ClientHeight = 451
  6. ClientWidth = 560
  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. PixelsPerInch = 96
  17. TextHeight = 13
  18. object Label1: TLabel
  19. Left = 0
  20. Top = 0
  21. Width = 273
  22. Height = 13
  23. Alignment = taCenter
  24. AutoSize = False
  25. Caption = 'Main View'
  26. Color = 16099723
  27. Font.Charset = DEFAULT_CHARSET
  28. Font.Color = clWindowText
  29. Font.Height = -11
  30. Font.Name = 'MS Sans Serif'
  31. Font.Style = [fsBold]
  32. ParentColor = False
  33. ParentFont = False
  34. end
  35. object Label2: TLabel
  36. Left = 280
  37. Top = 0
  38. Width = 273
  39. Height = 13
  40. Alignment = taCenter
  41. AutoSize = False
  42. Caption = 'Lightsource Point of view'
  43. Color = 16099723
  44. Font.Charset = DEFAULT_CHARSET
  45. Font.Color = clWindowText
  46. Font.Height = -11
  47. Font.Name = 'MS Sans Serif'
  48. Font.Style = [fsBold]
  49. ParentColor = False
  50. ParentFont = False
  51. end
  52. object Panel2: TPanel
  53. Left = 280
  54. Top = 16
  55. Width = 273
  56. Height = 273
  57. TabOrder = 0
  58. object Caster: TGLSceneViewer
  59. Left = 8
  60. Top = 8
  61. Width = 256
  62. Height = 256
  63. Camera = GLCamera2
  64. Buffer.FaceCulling = False
  65. FieldOfView = 137.326278686523400000
  66. OnMouseDown = CasterMouseDown
  67. OnMouseMove = CasterMouseMove
  68. OnMouseUp = CasterMouseUp
  69. TabOrder = 0
  70. end
  71. end
  72. object Panel1: TPanel
  73. Left = 0
  74. Top = 16
  75. Width = 273
  76. Height = 273
  77. TabOrder = 1
  78. object Viewer: TGLSceneViewer
  79. Left = 8
  80. Top = 8
  81. Width = 256
  82. Height = 256
  83. Camera = GLCamera1
  84. FieldOfView = 137.326278686523400000
  85. OnMouseDown = ViewerMouseDown
  86. OnMouseMove = ViewerMouseMove
  87. OnMouseUp = ViewerMouseUp
  88. TabOrder = 0
  89. end
  90. end
  91. object Panel3: TPanel
  92. Left = 0
  93. Top = 296
  94. Width = 273
  95. Height = 41
  96. TabOrder = 2
  97. object Label4: TLabel
  98. Left = 25
  99. Top = 6
  100. Width = 72
  101. Height = 11
  102. Caption = 'Camera Distance'
  103. Font.Charset = ANSI_CHARSET
  104. Font.Color = clWindowText
  105. Font.Height = -9
  106. Font.Name = 'Small Fonts'
  107. Font.Style = []
  108. ParentFont = False
  109. end
  110. object TimeLbl: TLabel
  111. Left = 228
  112. Top = 27
  113. Width = 21
  114. Height = 11
  115. Caption = 'Time'
  116. Font.Charset = ANSI_CHARSET
  117. Font.Color = clWindowText
  118. Font.Height = -9
  119. Font.Name = 'Small Fonts'
  120. Font.Style = []
  121. ParentFont = False
  122. end
  123. object DistanceBar: TTrackBar
  124. Left = 6
  125. Top = 16
  126. Width = 115
  127. Height = 16
  128. Hint = 'Moves the main camera closer/further from the teapot'
  129. Max = 30
  130. Min = 1
  131. ParentShowHint = False
  132. Position = 8
  133. SelEnd = 20
  134. SelStart = 1
  135. ShowHint = True
  136. TabOrder = 0
  137. TabStop = False
  138. ThumbLength = 10
  139. OnChange = DistanceBarChange
  140. end
  141. object CastBtn: TButton
  142. Left = 208
  143. Top = 8
  144. Width = 57
  145. Height = 17
  146. Hint =
  147. 'Measure the time it takes in s/100 to render the lightsource z-b' +
  148. 'uffer, generate the shadow texture and render the main view. '
  149. Caption = 'Cast'
  150. TabOrder = 1
  151. OnClick = CastBtnClick
  152. end
  153. end
  154. object Panel4: TPanel
  155. Left = 280
  156. Top = 296
  157. Width = 273
  158. Height = 41
  159. TabOrder = 3
  160. object Label3: TLabel
  161. Left = 25
  162. Top = 6
  163. Width = 72
  164. Height = 11
  165. Caption = 'Camera Distance'
  166. Font.Charset = ANSI_CHARSET
  167. Font.Color = clWindowText
  168. Font.Height = -9
  169. Font.Name = 'Small Fonts'
  170. Font.Style = []
  171. ParentFont = False
  172. end
  173. object Label5: TLabel
  174. Left = 193
  175. Top = 6
  176. Width = 27
  177. Height = 11
  178. Caption = 'Focus'
  179. Font.Charset = ANSI_CHARSET
  180. Font.Color = clWindowText
  181. Font.Height = -9
  182. Font.Name = 'Small Fonts'
  183. Font.Style = []
  184. ParentFont = False
  185. end
  186. object DistanceBar2: TTrackBar
  187. Left = 6
  188. Top = 16
  189. Width = 115
  190. Height = 16
  191. Hint = 'Moves the light closer/further from the teapot.'
  192. Max = 30
  193. Min = 1
  194. ParentShowHint = False
  195. Position = 9
  196. SelEnd = 20
  197. SelStart = 1
  198. ShowHint = True
  199. TabOrder = 0
  200. TabStop = False
  201. ThumbLength = 10
  202. OnChange = DistanceBar2Change
  203. end
  204. object Focal: TTrackBar
  205. Left = 150
  206. Top = 17
  207. Width = 115
  208. Height = 16
  209. Hint =
  210. 'Adjust the Focal length of the lightsource camera, to adjust the' +
  211. ' lightbeam width'
  212. Max = 300
  213. Min = 1
  214. ParentShowHint = False
  215. Frequency = 10
  216. Position = 50
  217. ShowHint = True
  218. TabOrder = 1
  219. TabStop = False
  220. ThumbLength = 10
  221. OnChange = FocalChange
  222. end
  223. end
  224. object Panel5: TPanel
  225. Left = 0
  226. Top = 343
  227. Width = 121
  228. Height = 97
  229. TabOrder = 4
  230. object FrustBox: TCheckBox
  231. Left = 8
  232. Top = 24
  233. Width = 105
  234. Height = 17
  235. Caption = 'Frustrum Shadow'
  236. Checked = True
  237. State = cbChecked
  238. TabOrder = 0
  239. OnClick = FrustBoxClick
  240. end
  241. object RotateBox: TCheckBox
  242. Left = 8
  243. Top = 72
  244. Width = 105
  245. Height = 17
  246. Caption = 'Rotate the Torus'
  247. Checked = True
  248. State = cbChecked
  249. TabOrder = 1
  250. OnClick = RotateBoxClick
  251. end
  252. object ShadowOnBox: TCheckBox
  253. Left = 8
  254. Top = 5
  255. Width = 97
  256. Height = 17
  257. Caption = 'Shadows On'
  258. Checked = True
  259. State = cbChecked
  260. TabOrder = 2
  261. OnClick = ShadowOnBoxClick
  262. end
  263. object SoftBox: TCheckBox
  264. Left = 8
  265. Top = 56
  266. Width = 73
  267. Height = 17
  268. Hint =
  269. 'Tests 4 pixels on the lightsource z-buffer, in stead of 1, to ca' +
  270. 'lculate shadow brightness, and give soft edges to shadows.'
  271. Caption = 'Soft Edges'
  272. ParentShowHint = False
  273. ShowHint = True
  274. TabOrder = 3
  275. OnClick = SoftBoxClick
  276. end
  277. object SkyShadBox: TCheckBox
  278. Left = 8
  279. Top = 40
  280. Width = 97
  281. Height = 17
  282. Caption = 'Sky Shadow'
  283. TabOrder = 4
  284. OnClick = SkyShadBoxClick
  285. end
  286. end
  287. object Panel6: TPanel
  288. Left = 431
  289. Top = 343
  290. Width = 121
  291. Height = 97
  292. TabOrder = 5
  293. object Label9: TLabel
  294. Left = 28
  295. Top = 64
  296. Width = 59
  297. Height = 11
  298. Caption = 'Shadow Alpha'
  299. Font.Charset = ANSI_CHARSET
  300. Font.Color = clWindowText
  301. Font.Height = -9
  302. Font.Name = 'Small Fonts'
  303. Font.Style = []
  304. ParentFont = False
  305. end
  306. object FadeBox: TCheckBox
  307. Left = 8
  308. Top = 0
  309. Width = 97
  310. Height = 17
  311. Caption = 'Depth of view fade'
  312. Font.Charset = ANSI_CHARSET
  313. Font.Color = clWindowText
  314. Font.Height = -9
  315. Font.Name = 'Small Fonts'
  316. Font.Style = []
  317. ParentFont = False
  318. ParentShowHint = False
  319. ShowHint = True
  320. TabOrder = 0
  321. OnClick = FadeBoxClick
  322. end
  323. object dovBar: TTrackBar
  324. Left = 2
  325. Top = 21
  326. Width = 115
  327. Height = 16
  328. Hint = 'Adjust depth of view'
  329. Max = 100
  330. Min = 1
  331. ParentShowHint = False
  332. Frequency = 5
  333. Position = 50
  334. SelEnd = 20
  335. SelStart = 1
  336. ShowHint = True
  337. TabOrder = 1
  338. TabStop = False
  339. ThumbLength = 10
  340. OnChange = dovBarChange
  341. end
  342. object AlphaBar: TTrackBar
  343. Left = 2
  344. Top = 74
  345. Width = 115
  346. Height = 16
  347. Hint = 'Adjust the darkness of shadows'
  348. Max = 256
  349. Min = 1
  350. ParentShowHint = False
  351. Frequency = 10
  352. Position = 128
  353. SelEnd = 20
  354. SelStart = 1
  355. ShowHint = True
  356. TabOrder = 2
  357. TabStop = False
  358. ThumbLength = 10
  359. OnChange = AlphaBarChange
  360. end
  361. end
  362. object Memo1: TMemo
  363. Left = 127
  364. Top = 343
  365. Width = 297
  366. Height = 97
  367. Font.Charset = ANSI_CHARSET
  368. Font.Color = clWindowText
  369. Font.Height = -9
  370. Font.Name = 'Small Fonts'
  371. Font.Style = []
  372. Lines.Strings = (
  373. 'This application casts and draws shadows, using the Z-Buffer met' +
  374. 'hod.'
  375. 'Left-click and drag on the viewers, to rotate the camera angles.'
  376. 'Anything that is not visible from the lightsource viewer(Right) ' +
  377. 'is in '
  378. 'shadow in the main viewer.(Left)'
  379. ''
  380. 'When Depth Fade is on, the light fades as it approaches the far ' +
  381. 'plane.'
  382. 'Shadows can be set to have either hard or soft edges.'
  383. 'The area outside the lightsource view, can be set to be light or' +
  384. ' dark.')
  385. ParentFont = False
  386. TabOrder = 6
  387. end
  388. object GLScene1: TGLScene
  389. Left = 16
  390. Top = 32
  391. object Objects: TGLDummyCube
  392. CubeSize = 1.000000000000000000
  393. object HeightField1: TGLHeightField
  394. Material.MaterialLibrary = GLMaterialLibrary1
  395. Material.LibMaterialName = 'Tiles'
  396. Direction.Coordinates = {000000000000803F0000000000000000}
  397. Position.Coordinates = {00000000000020C0000000000000803F}
  398. Scale.Coordinates = {00002041000020410000004000000000}
  399. Up.Coordinates = {00000000000000000000803F00000000}
  400. XSamplingScale.Min = -1.000000000000000000
  401. XSamplingScale.Max = 1.000000000000000000
  402. XSamplingScale.Step = 0.070000000298023220
  403. YSamplingScale.Min = -1.000000000000000000
  404. YSamplingScale.Max = 1.000000000000000000
  405. YSamplingScale.Step = 0.070000000298023220
  406. Options = [hfoTextureCoordinates]
  407. OnGetHeight = HeightField1GetHeight
  408. end
  409. object Cube1: TGLCube
  410. Material.MaterialLibrary = GLMaterialLibrary1
  411. Material.LibMaterialName = 'PlaneMat'
  412. Position.Coordinates = {CDCCCC3F00000000000000000000803F}
  413. Scale.Coordinates = {CDCCCC3D000020400000404000000000}
  414. end
  415. object Torus1: TGLTorus
  416. Material.Texture.TextureMode = tmModulate
  417. MajorRadius = 1.100000023841858000
  418. MinorRadius = 0.150000005960464500
  419. Rings = 28
  420. Sides = 16
  421. StopAngle = 360.000000000000000000
  422. Parts = [toSides, toStartDisk, toStopDisk]
  423. BehavioursData = {
  424. 0458434F4C02010201060B54474C42496E657274696102001200000000020002
  425. 00050000000000000080FF3F0200080500000000000000000000050000000000
  426. 00000000000500000000000000A0034009020008020008}
  427. end
  428. object Teapot1: TGLTeapot
  429. Material.MaterialLibrary = GLMaterialLibrary1
  430. Material.LibMaterialName = 'BeigeMarble'
  431. Scale.Coordinates = {9A99D93F9A99D93F9A99D93F00000000}
  432. BehavioursData = {
  433. 0458434F4C02010201060B54474C42496E657274696102001200000000020002
  434. 00050000000000000080FF3F0200080500000000000000A00340050000000000
  435. 0000000000050000000000000000000008020008020008}
  436. end
  437. end
  438. object Shadows1: TGLZShadows
  439. Viewer = Viewer
  440. Caster = MemView
  441. FrustShadow = True
  442. SkyShadow = False
  443. Optimise = op9in1
  444. Width = 256
  445. Height = 256
  446. Color.Color = {0000000000000000000000000000003F}
  447. Soft = False
  448. Tolerance = 0.014999999664723870
  449. DepthFade = False
  450. end
  451. object GLCamera1: TGLCamera
  452. DepthOfView = 100.000000000000000000
  453. FocalLength = 50.000000000000000000
  454. TargetObject = Objects
  455. Position.Coordinates = {00000000000000000000A0400000803F}
  456. Left = 272
  457. Top = 200
  458. end
  459. object GLCamera2: TGLCamera
  460. DepthOfView = 50.000000000000000000
  461. FocalLength = 50.000000000000000000
  462. TargetObject = Objects
  463. Position.Coordinates = {000040400000E040000080400000803F}
  464. Left = 280
  465. Top = 208
  466. object GLLightSource1: TGLLightSource
  467. Ambient.Color = {9A99993E9A99993E9A99993E0000803F}
  468. ConstAttenuation = 1.000000000000000000
  469. SpotCutOff = 180.000000000000000000
  470. end
  471. end
  472. end
  473. object GLMaterialLibrary1: TGLMaterialLibrary
  474. Materials = <
  475. item
  476. Name = 'ShadowMat'
  477. Tag = 0
  478. Material.FrontProperties.Ambient.Color = {0000000000000000000000000000803F}
  479. Material.FrontProperties.Diffuse.Color = {0000000000000000000000000000003F}
  480. Material.FrontProperties.Emission.Color = {0000803F0000803F0000803F0000803F}
  481. Material.BlendingMode = bmTransparency
  482. Material.Texture.ImageClassName = 'TGLBlankImage'
  483. Material.Texture.Image.ColorFormat = 6408
  484. end
  485. item
  486. Name = 'PlaneMat'
  487. Tag = 0
  488. Material.Texture.ImageClassName = 'TGLBlankImage'
  489. Material.Texture.Image.ColorFormat = 6408
  490. end
  491. item
  492. Name = 'Tiles'
  493. Tag = 0
  494. Material.Texture.TextureMode = tmModulate
  495. end
  496. item
  497. Name = 'BeigeMarble'
  498. Tag = 0
  499. Material.Texture.TextureMode = tmModulate
  500. end
  501. item
  502. Name = 'Marble'
  503. Tag = 0
  504. Material.Texture.TextureMode = tmModulate
  505. end>
  506. Left = 80
  507. Top = 32
  508. end
  509. object MemView: TGLMemoryViewer
  510. Camera = GLCamera2
  511. Buffer.Lighting = False
  512. Left = 152
  513. Top = 32
  514. end
  515. object AsyncTimer1: TGLAsyncTimer
  516. Enabled = True
  517. Interval = 700
  518. OnTimer = AsyncTimer1Timer
  519. ThreadPriority = tpNormal
  520. Left = 16
  521. Top = 80
  522. end
  523. object GLCadencer1: TGLCadencer
  524. Scene = GLScene1
  525. Enabled = False
  526. OnProgress = GLCadencer1Progress
  527. Left = 16
  528. Top = 128
  529. end
  530. end