MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / getFragmentShaderOnlyOddBlock

Function getFragmentShaderOnlyOddBlock

source/MRViewer/MRShaderBlocks.cpp:66–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66std::string getFragmentShaderOnlyOddBlock( bool sampleMask /*= false */ )
67{
68 if ( sampleMask )
69 return R"(
70 gl_SampleMask[0] = gl_SampleMaskIn[0];
71 if (onlyOddFragments )
72 {
73 if ( mod( gl_FragCoord.x + gl_FragCoord.y, 2 ) < 1 )
74 gl_SampleMask[0] = gl_SampleMaskIn[0] & 0xaaaaaaaa;
75 else
76 gl_SampleMask[0] = gl_SampleMaskIn[0] & 0x55555555;
77 }
78)";
79 else
80 return R"(
81 if (onlyOddFragments && ((int(gl_FragCoord.x) + int(gl_FragCoord.y)) % 2) == 1)
82 discard;
83)";
84}
85
86std::string getFragmentShaderHeaderBlock( bool gl4, bool alphaSort )
87{

Callers 1

getMeshFragmentShaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected