1 / 23

Banda Grafica

Banda Grafica. Banda grafica. Buffers. Generare varfuri. Procesare varfuri. Generare primitive. Procesare primitive. Generare fragmente. Procesare fragmente. Op raster. 1. Banda grafica fixa. 2. Transformarea varfurilor. 3. Asamblarea primitivelor si rasterizarea.

dwight
Télécharger la présentation

Banda Grafica

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Banda Grafica

  2. Banda grafica Buffers Generare varfuri Procesare varfuri Generare primitive Procesare primitive Generare fragmente Procesare fragmente Op raster 1

  3. Banda grafica fixa 2

  4. Transformarea varfurilor 3

  5. Asamblarea primitivelor si rasterizarea • Asamblarea primitivelor • View frustum clipping • Rasterizarea • Pixel • Continutul framebufferului de la o anumita locatie • Culoare • Adancime • Fragment • Starea necesara pentru updatarea unui anumit pixel • Interpolarea, Texturarea si Colorarea 4

  6. Operatii Raster 5

  7. Vizualizarea operatiilor din banda grafica 6

  8. Banda Grafica Programabila 7

  9. Geometry shader Geometry Shader 8

  10. Cg • C pentru grafica • Controlul formei si al miscarii obiectelor folosind direct hardware-ul grafic • Nou nivel de abstractizare peste limbajul de asamblare al hardwareului grafic • Dezvoltat in colaborare de Nvidia si Microsoft • Compatibil cu HLSL (DirectX) si GLSL (OpenGL) 9

  11. Cg 10

  12. Profilurile Cg 1.5 11

  13. Profiluri Cg 2.0 Cg 2.1 12

  14. Mediul Cg 13

  15. Compilarea, incarcarea si executia programelor Cg, intr-o aplicatie OpenGL • 1) #include <Cg/cg.h> • 2) #include <Cg/cgGL.h> • 3) CGcontext context = cgCreateContext(); • 4) CGprogram program = cgCreateProgram(context, CG_SOURCE, VertexProgramString, CG_PROFILE_ARBVP1, "main", args); • 5) cgGLLoadProgram(program); • 6) CGparameter Parametru = cgGetNamedParameter(program, "param"); • CGparameter Parametru = cgGetNamedParameter(program, "param"); • 7) cgGLEnableProfile(CG_PROFILE_ARBVP1); cgGLBindProgram(program); cgGLDisableProfile(CG_PROFILE_ARBVP1); • 8) cgDestroyProgram(program); cgDestroyContext(context); cgCreateProgramFromFile() cgCreateProgram() cgGLGetLatestProfile() 14

  16. Scurta prezentare limbaj • Tipuri de date • Tipuri de date de baza - Tipuri de date matrice • Float float1x1 m11; • Half float2x3 m23; • Int float4x4 m44; • Fixed • Bool • Sampler • Tipuri de date vector • float4 pos; • float3, float2, float1 • bool4, bool3, etc • Ex: a = b * float4(1.0, 3.0, 5.0, -1.0); 15

  17. Scurta prezentare limbaj • Constante • f, h, x • Ex : 2.0f, 2.0h • Structuri • Ex: struct mystruct { ……….}; • Tablouri • Ex: float x[4], y[3][3]; • Controlul fluxului • If/Else • While • For 16

  18. Scurta prezentare limbaj • Functii • function f1(in float x); • function f1(out float x); • function f1(inout float x); • Operatori Aritmetici • + , - , * , / • Ex: float3(a, b, c) * float3(A, B, C) = float3(a*A, b*B, c*C) • Operatori booleeni si de comparatie • && , || , ! , < , <= , != , >= , > • Operatorul swizzle • (.) • float3(a, b, c).zyx => produce float3(c, b, a) 17

  19. Biblioteca de functii standard a limbajului Cg • Functii matematice • Ex: cross(a,b) • Functii geometrice • Ex: normalize(v) • Functii de aplicare a texturilor • Ex: tex2D(sampler2D, float2 s) 18

  20. Vertex program 19

  21. Fragment Program 20

  22. Transformari World Space Object Space Transformarea de modelare Transformarea de vizualizare Eye Space Clip Space Transformarea de proiectie Impartirea perspectiva Normalized Device Space Transformarea in poarta de afisare Window Space 21

  23. Transformari Coordonate Observator Coordonate Obiect Matricea Modelview Matricea Projection Coordonate de decupare Matricea Modelview Projection Coordonate Obiect Coordonate de decupare 22

More Related