CgDistTexture.dpr 974 B

12345678910111213141516171819202122232425262728
  1. { This little demo shows how to use the GL_TEXTURE_RECT_NV extension for creating
  2. effects applied on the screen (filters, grayscaling etc.).
  3. I tried it on a HUD sprite first but for some reason, its coordinates are messed
  4. up. HUD sprites are using somewhat different calcultions than a regular object
  5. so I guess the vertex program handles the coordinates wrong. Didn't have time
  6. to really look at it so I did a cheesy solution, just putting a plane 'exactly'
  7. in front of the camera. Of course, that doesn't work really well when moving/rotating
  8. the camera.
  9. Anyway, it looks like if you were looking into 3D space but in fact there's nothing
  10. but a flat plane in front of your nose with a snapshot of the scene on it. The scene
  11. itself is behind that plane.
  12. }
  13. program CgDistTexture;
  14. uses
  15. Forms,
  16. fDistTexture in 'fDistTexture.pas' {Form1};
  17. {$R *.res}
  18. begin
  19. Application.Initialize;
  20. Application.CreateForm(TForm1, Form1);
  21. Application.Run;
  22. end.