How could I understand samplemask in OpenGL ES spec? -


i reading gles spec samplemask.

there paragraph samplemask couldn't understand. below snippet spec.

when state specifies multiple fragment shader invocations given fragment, sample mask single fragment shader invocation may specify subset of covered samples fragment. in case, bit corresponding each covered sample set in 1 fragment shader invocation.

can give me example or me understand it? i'm quite confused part "a subset of covered samples fragment"

thanks.

the sample mask (also called coverage mask) defines samples in pixel inside primitive being rasterized, , have survived zs testing. doesn't mean if have 1 sample per pixel (you either render fragment or not), if using multi-sampling have multiple sample points per pixel. on edge of triangle rasterization might hit 3 of 4 samples , have coverage mask of b0111, indicates samples write framebuffer.

for multi-sample anti-aliasing execute 1 fragment shader invocation per pixel, irrespective of coverage mask, fragment have (in our example) coverage mask of b0111.

if using sample-rate shading in opengl es 3.x execute 3 fragment shader invocations, 1 each sample hit, have coverage mask b0001, b0010 , b0100, each writing 1 sub-pixel sample in pixel unique fragment color.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -