Builtin Functions - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Builtin Functions

Description:

Built-in Functions. Chap 5 of OrangeBook. Contents. Math (trignometry, exponential) Geometry ... zz = matrixCompMult (x,y); Texture Access. texture2D ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 12
Provided by: jyunmi
Category:

less

Transcript and Presenter's Notes

Title: Builtin Functions


1
Built-in Functions
  • Chap 5 of OrangeBook

2
Contents
  • Math (trignometry, exponential)
  • Geometry
  • Matrix, vector
  • Texture access
  • Fragment processing
  • Noise (Perlin)

3
Component-wise!
4
Common Functions
5
More on smoothstep
1.0
1.0
0.6
0.4
Ramp down smoothstep (1.0, 0.6, x)
Ramp up smoothstep (0.4, 1.0, x)
6
Common Functions
  • Two versions of min max
  • vec min (vec x, vec y)
  • vec min (vec x, float y)
  • Similarly, for clamp mix
  • vec mix (vec x, vec y, float a)
  • vec mix (vec x, vec y, vec a)

7
Geometry Functions
  • length, distance, dot, cross, normalize
  • reflect (I,n) refract
  • faceforward

I-(In)n
n
I
reflect I - 2(In)n
(In)n
8
Matrix Functions
  • Multiplication
  • mat x, y, z, zz
  • z x y
  • zz matrixCompMult (x,y)

9
Texture Access
  • texture2D
  • texture2DProj
  • texture2DLod
  • texture2DProjLod
  • shadow2D

10
Fragment Processing
  • dFdx
  • fwidth
  • What are the usage?

11
Characteristics of Noise Functions
  • The return values are always in the range -1,1
    and cover at least the range -0.6,0.6 with a
    Gaussian-like distribution.
  • The return values have an overall average of 0.
  • The functions are repeatable, in that a
    particular input value always produces the same
    return value.
  • The spatial frequency is narrowly concentrated,
    centered somewhere between 0.5 and 1.0.
  • They are C1 continuous everywhere that is the
    first derivative is continuous.
Write a Comment
User Comments (0)
About PowerShow.com