Outline Cradle Operations.

Uploaded on:
also, Cool Visual Effects. Operations on Fragments. Profundity Test. Mixing ... GL_LESS - acknowledge piece if alpha < esteem. GL_EQUAL - acknowledge part is alpha = esteem ...
Slide 1

Frame Buffer Operations Obscure Tricks and Cool Visual Effects

Slide 2

Operations on Fragments Depth Test Blending Scissor Test Alpha Test Stencil Test Dithering Logical Operations

Slide 3

Scissor Test glEnable(GL_SCISSOR_TEST) glScissor ( x, y, width, stature) whole number window directions to draw into x,y = bring down left corner ? Utilizes ?

Slide 4

Alpha Test : language structure glEnable (GL_ALPHATEST) glAlphaFunc ( test, compare_value ) compare_value is buoy 0 to 1 test is capacity, for example, GL_LESS -acknowledge section if alpha < esteem GL_EQUAL -acknowledge piece is alpha = esteem GL_NOTEQUAL -acknowledge part if alpha ≠ esteem GL_LEQUAL -<= GL_NEVER -never acknowledge any piece GL_ALWAYS -dependably acknowledge each piece and so on

Slide 5

Alpha Test : utilizes Given our tree made up of a surface of leaves with different alpha qualities, make the leaves gradually vanish by abating changing the alpha values that are acknowledged. In the event that you generally need something to show up, yet at the same time need to utilize the profundity test draw scene once with profundity test on, then turn profundity test off, turn on alpha test for a specific worth, redraw scene

Slide 6

Alpha Test : utilizes Gets greater and greater A star surface that progressions make a composition where each texel has the same RGB, yet shift the Alpha qualities apply the surface (don\'t utilize mixing) amid every drawing, use GL_LESS with various quality, so that diverse regions show up Create a composition of wavy lines?

Slide 7

Stenciling : uses Isn\'t this simply the scissor test? My liveliness is seen through a kitchen window, so the window edge and drapes ought to dependably appear. Draw the window pieces once. Draw the window pieces into the stencil support. Draw the terrace again and again (just the sections that are on the stencil will so up) http://www.uweb.ucsb.edu/~crashnburnjess/For%20Jess/Kitchen-Window.jpg

Slide 8

Stenciling : utilizes Draw Tree and Box Before drawing shadow, make a veil that matches the front of the crate.

Slide 9

Example Draw a square in the stencil cradle. The wireframe pink rope is attracted that cover, so just it shows up in the square. The same pink string is drawn filled on the scene with an alternate stencil test. http://www.sulaco.co.za/opengl4.htm#stencil

Slide 10

How Stenciling Operates for every pixel being drawn into the shading cushion contrast a quality with the relating pixel in stencil support just draw pixels into shading cradle that breeze through the test maybe change the stencil cushion pixel in light of result of that test developer demonstrates the worth, the think about test, and what to do if the test passes or fizzles

Slide 11

Stencil Functions glEnable ( GL_STENCIL_TEST ) glStencilFunc(test, compare_value, cover) glStencilOp (stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass) GL_KEEP, GL_REPLACE, GL_ZERO, GL_INVERT, GL_INCR, and so on

Slide 12

Stencil Pseudo-Code fill stencil cradle with 0s draw sought shape into stencil cushion with 1s either utilize glDrawPixels to compose straight into stencil cushion or draw into the shading cradle with polygon capacities, utilizing glStencilOp to change the stencil bits set the reference quality to 1 and the test capacity to level with (just draw pixels into shading map where stencil is equivalent to 1)

Slide 13

Accumulation Buffer Motion Blur - leave a picture trail redraw the scene again and again while moving an article between every drawing marginally diminish the past scene, glAccum(GL_MULT, rot) move the amassing support into the shading support utilizing glAccum(GL_RETURN, 1.0)

Slide 14

Accumulation Buffer Depth of Field - make far off items a little blury Draw the scene a few times, each with an extremely slight change in projection. Thus, far off articles will move around somewhat more than close questions. This is "jittering". Add each anticipated scene to the aggregation cradle. For instance, draw the scene 10 times with glAccum(GL_ACCUM, 0.1) so that every projection makes up 10% of the last picture. Move the amassing cushion into the shading cradle.

View more...