-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
308 additions
and
143 deletions.
There are no files selected for viewing
15 changes: 10 additions & 5 deletions
15
example/assets/pages/facemesh-with-machine-learning/shaders/fragmentShader.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
// VSCode Frag | ||
#pragma vscode_glsllint_stage : frag | ||
|
||
// Const | ||
const float PI = 3.1415926535897932384626433832795; | ||
|
||
// Varying | ||
varying vec3 vPos; | ||
varying vec4 vPos; | ||
varying vec2 vUv; | ||
|
||
// Main | ||
void main () { | ||
|
||
gl_FragColor = vec4( gl_PointCoord, 1., 1. ) * vec4( vPos, 1. ); | ||
// Make point rounded | ||
float dist = length( gl_PointCoord - vec2( 0.5 ) ); | ||
float alpha = 1. - smoothstep( 0.45, 0.5, dist ); | ||
|
||
// Bring back pixels | ||
// gl_FragColor = vec4( gl_PointCoord, 1., alpha ) * vPos; | ||
// gl_FragColor = vec4( vPos.xyz, alpha ); | ||
gl_FragColor = vec4( vUv, 1., alpha ); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.