????????? ? OpenGL - PowerPoint PPT Presentation

About This Presentation
Title:

????????? ? OpenGL

Description:

Title: . Author: 02a_ign Last modified by: Alexey Ignatenko Created Date: 4/19/2004 3:55:42 PM Document presentation format – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 48
Provided by: 02a8
Category:
Tags: opengl | composit

less

Transcript and Presenter's Notes

Title: ????????? ? OpenGL


1
????????. ?????????
  • ?????? 11
  • ??????? ?????????

2
?? ??????? ??????
  • ???????? ????????? ????????????
  • ???????? ????????? ??????
  • ???????? ?????????
  • ???????? ????????? ????????????
  • ????? ???????
  • ?????? ????????? ? ?????????
  • ????????? ? ?????????? ??????
  • ????????? ? ?????????? ?????????
  • ?????? ???????????? ?????
  • ???????????????? ???????? (??? ????????????)
  • ????????? ? OpenGL
  • glMaterial, glLight

3
?? ??????
  • ???????????????
  • ???????????
  • ???? ???????????????
  • ??????????? ????????
  • ?????????? ????????
  • ??????????????
  • ???????????
  • ?????-?????
  • ???????? ??????????????
  • ???????????????
  • ???????

4
???????????????
5
???????????????
  • ????????????? ??????????? ??? ?????????????
    (??????????) ??????? ???????????

6
??????????? ????????(Texture mapping)
  • ?????? ????????????? ??????? ???????? (???????)
    ??????? ?????????
  • ????????????? ???????????
  • ????, ???????????? ? 2D ???????, ????????????
    ?? ?????? ??? ????? ????? ?, ??????????
    ?????????? ?????? ????????? ???? ??????. ?.?.,
    ????? ?????? ????????????, ?????????? ????
    ???????????? ?????? ? ???.
  • View-dependent mapping
  • Bump mapping
  • ...

7
?????? ???????????????
  • I
  • ????? ??????? ??? ???????? ????????????, ?????
    ???????? ???????? ???????
  • II
  • ??? ?????????????? ???????????? ???? ????????
    ?????????? ? 2D ???????, ? ?????? ?????????? ? 3D
    ????????????, ??? ?????????? ??????????
    ??????????? ????? ????? ?????????

8
???? ??????? ?????????
  • ????????? ?????????
  • ??????? ???????, ?????? ? ?.?.
  • ?????? ????????
  • ???????? ?????????? ?????????
  • ???????
  • ?????? ?????????
  • ?????????? ?????????
  • ????? ?? ???????
  • ?????? ????? ? ??????

9
?????????? ?????????(?????? ?????)
10
???????? (?????????)
  • Ir kaIa Ii (kd(N.L) ks(R.V)a)
  • ????????? ?? ??????????? - surface color texture
  • ?????? ??????? N - bump mapping
  • ???????????? kd, ks, a - specular
    mapping
  • ???????? ???? Ii -
    environment mapping
  • ????????? -
    displacement mapping
  • ???????????? -
    transparency mapping

11
??????? (1)
12
??????? (2)
  • P - ????? ????????? ????????
  • ????????? P ? ??????????????? ?????????? (s,t)s
    - ??????? ?????????? ? ???????? ?? ??? ?t -
    ?????????? ??????

13
??????????????? ????????? ??? ????????
14
??????????????? ????????? ??? ?????
15
??????????????? ????????? ??? ????
16
?????? ???????????
  • ??????????????? (?-??????) ???????????
  • ????????????? ???????????
  • ?????? ???????? ???????????

17
????-???????
Demo
  • ????-??????? (bump mapping)
  • ??????? ????????? ??????????? "????????" ???
    ????????? ???????????? ?? ???? ?????????
    ???????????? ???????? ? ???????????

18
????? ? ??????????? ????????
  • ??? ??????? ?????????????? ??????
  • ????????????? ?? ????????? ?????????
  • ??? ??????? ??????? ????????
  • ????????? ???? ???????
  • ????????? ??????? (z) ???????
  • ???????? ? ???????? ? z-??????
  • ???? ?????, ??????? ? ????? ?????

z-?????
19
?????????? ???????
20
?????????? ???????
  • ????? ?????????? ??????
  • ?????????? ??????????
  • ???-???????
  • ??????????? ??????????
  • ???????????? ??????????

21
????????? ????? ? ?????????? ??????????
????????? ?????
??????????
22
????????? ????? ? ?????????? ??????????(2)
  • ??????? ?????????? ??????? GL_NEAREST
  • ???????? ?????????? 4-x ???????? ????????
    GL_LINEAR

23
?????????? ??????? mip-mapping (1)
24
?????????? ??????? ?????????? (2)
?????????? ????????
??????? 11
?????????? ????????
?????????? ????????
??????? 11
?????????? ???????? ? 2l ???
25
?????????? ??????? ?????????? (3)
256x256, l0
64x64, l2
16x16, l4
  • ??????????? ?????????? GL_LINEAR_MIPMAP_LINEAR

26
???????????? ??????????
?????
27
????????? ??????? ??????????
????????? ?????
??????????
???????????
????????????
28
????????? ? OpenGL
  • ???????? OpenGL ???????????? ????????? ???????? ?
    ?????????? ???????? (environment mapping)
  • ? ??????? ????????????? ?????????????? ??????????
    ????? ???????????? ????-??????? ? ??.
  • ?????????? ?????????? ??????? ???????
  • ??????? ???????? ??????? ?????????

29
??????????????
30
?????????????? ???????????
  • Compositing n. The combining of two or more
    separately prepared images into one, usually
    through pixel-by-pixel transparency (or alpha)
    computation, and sometimes with z comparison.
    Also, composit v.t. to perform compositing
    adj. being composited n. the result of
    compositing.
  • ????????, ?????? ??????????? ???? ??? ?????
    ?????????? ?????????????? ??????????? ? ????
    ???????????, ?????? ? ??????? ?????????????
    ?????????? ???????????????? (?????-?????), ??????
    ? ?????? ??????? (z-??????????)

31
?????? 1
32
?????? 2
33
?????????? ??????? ????????????
???
???????? ????
?????? ????????? ????? ??????????? ???
??? ?????????? ??? ?????????????
34
?????????? ???????
  • ????????? ???????? ? ?????? ?????????????.
  • ????? ????? ???? ??????? ?? ????????

35
??????????? ????????
???????
???
  • ??? ??????? ??????? ??????????? ??????????
    ???????, ?????????? ??????????????? ???????
  • ????? ??????? ???????????? ??? a
  • Bnew (1-a)BoldaF
  • Bnew Bolda(F- Bold)

1-a
a
???????? ????
36
?????-?????
  • ??? ?????????? ?????????????? RGB ???????????
    ??????????? ?????-???????

RGB -gt RGBA
37
????????????? ?????-??????
  • ???????? ????????????? ?????-??????
  • ??????? ???????? ???????
  • ????????????
  • ??????????
  • ...

38
???????????????
  • Bnew (1-a)BoldaF
  • Bnewnew (1-?)Bnew ?G
  • ??????? ????????? ???????? ??????????? ???
    ?????-??????
  • ?????? ????????????? ?? ???
  • ??? ???? ?? ????? ???????? ?????????? ????
    ??????????? ? ?????-????????

39
??????????????? (2)
  • Bnewnew (1-b)BnewbG
  • (BF)G B(FG)
  • H F G, H RGB g
  • (1-b)((1-a)BaF)bG (1-g)BgH

40
??????????????? (3)
  • (1-a)(1-b)B(a(1-b)FbG) (1-g)BgH
  • (1-a)(1-b) 1-g Þ g ab-ab
  • H a(1-b/g)F(b/g)G
  • g ab-ab
  • H a(1-b/g)F(b/g)G

41
?????? 1
  • ??????????? G ?????? ???????? ??????????? F (a
    1)
  • g ab-ab
  • H a(1-b/g)F(b/g)G gt
  • g 1
  • H (1-b)F(b)G
  • ?.?. ???????? ??????? ???????? ??????????????

42
?????? 2
  • ??????????? ????????? ??????? ??????????? G (b
    1) ?????? F
  • g ab-ab
  • H a(1-b/g)F(b/g)G gt
  • g 1
  • H G
  • ?????????????? ??????????? ?? ??????? ?? a

43
?????????????? ? ????? ?????. ??????.
  • ?????????????????? ????????
  • ????????? ???????????? ??? ? ????? ????? (a 1
    ?? ???? ??????)
  • ??????????? ???????? ??????? ?????? ?????? ??????
    ????. ??????? ?????? ?????? ????? a 1. ???????
    ?? ???????? ????? ????? a ltgt 1
  • ?????????? ??? ?????? ?????. ??????? ?????
    ???????? ?????????????.
  • ????????? ???????????? ?? ?????? ?????, ???
    ????????? ??? ??????????????? ???????. ????????
    ?????????????? ??? ???????????? ?????????

44
?????????????? ? ????? ?????. ?????? 2.
  • ?????????????????? ????????
  • ????????? ?????????? ??? ? ????? ????? (a 0 ??
    ???? ??????)
  • ???????? ?????? ?????????? ??????? 1
  • ? ?????????????? ??????????? ??????? ? a 0 ??
    ???? ?????? ?? ????

45
?????????????? ? ????? ?????. ?????? 3.
  • ?????????????????? ????????
  • ????????? ?????????? ??? ? ????? ????? (a 0 ??
    ???? ??????)
  • ???????? ?????????????? ??????????? ?? ??????? 2
    ?????? ????
  • ?????? ??????? ? a ltgt 0 ????? ???????? ???

46
????????? ? OpenGL
  • OpenGL ???????????? ????????? ???????????
    ????????. ?????-????? ??? ??????????? ?????????
    ????? ?????????? ????? RGBA-???? ?????? ???
    RGBA-???? ???????
  • ??????
  • glEnable(GL_ENABLE)
  • glDisable(GL_DISABLE)
  • glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)

47
?????
  • ???????????????
  • ????????????? ??????????? ??? ?????????????
    (??????????) ??????? ???????????
  • ???? ???????????????
  • bump mapping, specular mapping, environment
    mapping, displacement mapping, transparency
    mapping
  • ??????????? ????????
  • ?????????? ????????
  • ????? ?????????? ??????, ?????????? ??????????,
    ???-???????, ??????????? ??????????, ????????????
    ??????????
  • ??????????????
  • ??????????? ???? ??? ????? ??????????
    ?????????????? ??????????? ? ???? ???????????,
    ?????? ? ??????? ????????????? ??????????
    ????????????????
Write a Comment
User Comments (0)
About PowerShow.com